Hexo 全站搜索插件

Hexo常用插件之全站搜索

hexo-generator-search
hexo-generator-searchdb

1.安装插件
1
2
npm install hexo-generator-search  --save
npm install hexo-generator-searchdb --save
2.配置hexo站点主配置文件_config.yml,在文件末尾添加
1
2
3
4
5
6
# Local search
search:
path: search.xml
field: post
format: html
limit: 10000

enablefalse 改为 true

1
2
3
4
5
6
7
8
# Local search
local_search:
enable: false
# if auto, trigger search by changing input
# if manual, trigger search by pressing enter key or search button
trigger: auto
# show top n results per article, show all results by setting to -1
top_n_per_article: 1