Skip to content

搜索服务

NexT提供了本地搜索服务和在线搜索服务,

下载

$ npm install hexo-generator-searchdb --save

Hexo _config.yml

在底部添加如下设置

search:
  path: search.xml
  field: post
  content: true
  format: html

NexT _config.yml

打开Local Search功能

# Local Search
# Dependencies: https://github.com/next-theme/hexo-generator-searchdb
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
  # Unescape html strings to the readable one.
  unescape: false
  # Preload the search data when the page loads.
  preload: false

Firefox不支持LocalSearch

发现在Firefox上无法正常使用搜索服务,而ChromeOpera没有问题。相关问题如下:

相关阅读