• Stars
    star
    433
  • Rank 100,464 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A plugin to generate search data for Hexo.

hexo-generator-search

npm npm

Generate search data for Hexo 3.x and 4.x. This plugin is used for generating a search index file, which contains all the neccessary data of your articles that you can use to write a local search engine for your blog. Supports both XML and JSON format output.

Install

$ npm install hexo-generator-search --save

Options

You can configure this plugin in your root _config.yml.

search:
  path: search.xml
  field: post
  content: true
  template: ./search.xml
  • path - file path. By default is search.xml . If the file extension is .json, the output format will be JSON. Otherwise XML format file will be exported.
  • field - the search scope you want to search, you can chose:
    • post (Default) - will only covers all the posts of your blog.
    • page - will only covers all the pages of your blog.
    • all - will covers all the posts and pages of your blog.
  • content - whether contains the whole content of each article. If false, the generated results only cover title and other meta info without mainbody. By default is true.
  • template (Optional) - path to a custom XML template

Exclude indexing

To exclude a certain post or page from being indexed, you can simply insert indexing: false setting at the top of its front-matter, e.g.:

title: "Code Highlight"
date: "2014-03-15 20:17:16"
tags: highlight
categories: Demo
description: "A collection of Hello World applications from helloworld.org."
toc: true
indexing: false
---

Then the generated result will not contain this post or page.

FAQ

What's this plugin supposed to do?

This plugin is used for generating a xml / json file from your Hexo blog that provides data for searching.

Where's this file saved to?

After executing hexo g you will get the generated result at your public folder.

How to use this plugin in my Hexo blog?

You have two choices:

  • you don't want to write search engine by yourself. There are many themes that take use this plugin for local searching that works out of box.
  • you are familiar with Ajax and jQuery and would like to write your own search engine. You can implement one by yourself according to the example theme I give. Read the source code of this theme. Generally there are 3 steps:
    1. write a search view. This is the place for displaying a search form and search results ;
    2. write a search script. This script tells the browser how to grab search data and filter out contents what we're searching;
    3. tell hexo to connect the above two part.

More Repositories

1

wukong-robot

🤖 wukong-robot 是一个简单、灵活、优雅的中文语音对话机器人/智能音箱项目,支持ChatGPT多轮对话能力,还可能是首个支持脑机交互的开源智能音箱项目。
Python
5,319
star
2

cmake-demo

《CMake入门实战》源码
CMake
2,009
star
3

dingdang-robot

🤖 叮当是一款可以工作在 Raspberry Pi 上的中文语音对话机器人/智能音箱项目。
Python
1,857
star
4

BeamerStyleSlides

🌈Beamer风格的幻灯片模板集。包含了PowerPoint和Keynote两套格式。
TeX
949
star
5

hexo-theme-freemind

Most powerful bootstrap theme for hexo.
CSS
392
star
6

Learn-Python-The-Hard-Way

My answer for the book Learn Python The Hard Way
Python
238
star
7

QtEVM

C++ implementation of EVM(Eulerian Video Magnification), based on OpenCV and Qt.
C++
166
star
8

hexo-theme-wixo

A wiki theme for Hexo.
CSS
155
star
9

comment.js

[Archived] A tiny comment system based on Github issue comments.
JavaScript
113
star
10

wukong-contrib

来自用户贡献的wukong-robot插件集
Python
82
star
11

2dMorphing

2D Image Morphing Algorithms based on mesh warping. C++ project, which is transplanted from the c codes given by Yurong Sun and George Wolberg. Details: http://davis.wpi.edu/~matt/courses/morph/2d.htm
C++
68
star
12

orgwiki

用org-mode搭建的wiki,已经停止更新。新的笔记放在http://hahack.com/wiki
JavaScript
42
star
13

wzpan.github.io

个人博客,转载请保留出处。
HTML
36
star
14

rhubarb-lip-sync-ccc

Cocos Creator extension for rhubarb-lip-sync
JavaScript
30
star
15

2048

使用 Cocos Creator 开发微信小游戏 2048(代码基于 Cocos Creator 1.10)
JavaScript
29
star
16

MusicBoxApi

从网易云音乐Musicbox项目抽离出来的API,去掉了界面相关逻辑。
Python
28
star
17

wukong-itchat

用于微信控制wukong-robot
Python
26
star
18

hexo-tag-bootstrap

Bootstrap tag plugins for Freemind.
JavaScript
25
star
19

org-beamer-cn

[Deprecated] org-mode Simple Chinese Template for Beamer
24
star
20

ChatGPT-python-example

演示如何使用4行代码调用ChatGPT的官方API
Python
21
star
21

dingdang-smart-mi-fan

叮当机器人的智米电风扇插件
Python
17
star
22

xiaoai-wukong

小爱音箱联动wukong-robot
Python
15
star
23

awesome-config

My config file for Awesome window manager.
Lua
14
star
24

python-muse

A toy project to demonstrate how to interact with Muse Headband in Python.
Python
12
star
25

wukong-starter

wukong-robot 的基本环境安装脚本
Python
11
star
26

wukong-robot-pi-installer

wukong-robot 的树莓派 docker 安装脚本
Shell
9
star
27

dissertation

LaTeX source code of my master dissertation.
TeX
9
star
28

FC-EVM

Foreground Constrained Eulerian Video Magnification(FC-EVM)
C++
9
star
29

lipsync-demo

Cocos lipsync 插件的 demo 示例
JavaScript
8
star
30

chinese-chess-bot

中国象棋QQ频道机器人
Python
8
star
31

ReSpeaker-Switcher

ReSpeaker 2-Mics Pi HAT 麦克风开关
Python
7
star
32

wukong-qq-guild

wukong-robot 的 QQ 频道机器人客户端
Python
6
star
33

oil-price-bot

油价助手QQ频道机器人
Python
6
star
34

python2-miio

Python2 library for interfacing with Xiaomi miio components
Python
5
star
35

Qt_Toys

Some toy exemplars for Qt start-up.
C++
4
star
36

git-repo-sync

A tool to sync all branches from a git repo to another.
Python
3
star
37

wukong-doc

wukong-robot 的 reference 文档
HTML
3
star
38

wukong-next

腾讯 Next 课堂版本的 wukong-robot
Python
2
star
39

awesome-instant-apps

Awesome list for google instant apps.
2
star
40

MiMeshHelper

🤖 小米 Mesh 助手
Python
2
star
41

infer-xcode-plugin

Facebook infer plugin for xcode.
Objective-C
1
star
42

MuseFlappyBird

Use Muse headband to play Flappy Bird game with blink event.
Python
1
star
43

hexo-theme-freemind-blog

source blog repo for hexo-theme-freemind
HTML
1
star
44

timeline

my story
CSS
1
star
45

handout-with-script

A LaTeX template for writing script with handout of slides.
1
star