本地搜索服务

参考:Local Search

使用NexT自带的本地搜索服务

下载

$ npm install hexo-generator-searchdb --save

Hexo配置

search:
  path: search.xml
  field: post
  format: html
  limit: 10000

NexT配置

# 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