local_search
local_search:
enable: false
preload: false # Preload the search data when the page loads该配置项用于设置网站搜索功能,非常实用,建议开启。开启后,头部导航栏右侧将出现搜索按钮。

搜索功能配置流程:
在 Hexo 项目根目录下安装插件
hexo-generator-searchdb。$ npm install hexo-generator-searchdb在 Hexo 配置文件
_config.redefine.yml里最底下添加如下配置项。# Search ## See: https://github.com/theme-next/hexo-generator-searchdb search: path: search.json field: post content: true format: striptags主题配置文件
_config.redefine.yml的local_search.enable配置项的值设为true。local_search: enable: true
全站文章搜索效果图:

最后更新于