0%

hexo 博客搭建之站内搜索

来给博客加个搜索功能吧~

1. 安装站内搜索插件
1
$ npm install hexo-generator-searchdb  --save
2. 在 主题配置文件:_config.next.yml 中,修改代码以启用插件
1
2
3
4
5
6
7
8
9
10
11
12
13
# Local Search
# Dependencies: https://github.com/theme-next/hexo-generator-searchdb
local_search:
enable: true
# 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
# Unescape html strings to the readable one.
unescape: false
# Preload the search data when the page loads.
preload: false
3. 结束