hexo 无法搜索问题

# 一般 Hexo 博客无法搜索主要有 2 种以下情况:

  • 搜索插件没有配置好
  • 文章中包含特殊字符

# 一、搜索插件的配置

编辑 站点配置文件 ,新增以下内容到任意位置:

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

编辑 主题配置文件 ,启用本地搜索功能:

# Local search
local_search:
  enable: true

安装搜索插件

 npm install hexo-generator-searchdb --save

+ hexo-generator-searchdb@1.0.8
added 119 packages in 8.327s

# 二、文章中特殊字符

# 检查 search.mxl 的状态

ggSet1

# 浏览器直接访问 search.xml 文件看看:

8ZPJND

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2015-2021 zhou chen
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信