hexo + Butterfly本地搜索功能
安装依赖
前往博客根目录,打开cmd命令窗口执行
1 | npm install hexo-generator-search --save |
注入配置
修改站点配置文件_config.yml,添加代码如下:
1 | search: |

修改主题配置文件
修改主体下的D:\blog\butt\node_modules\hexo-theme-butterfly\ _config.yml(我的目录:D:\blog\butt\ _config.butterfly.yml,可以将主题下的配置文件复制粘贴到根目录下改名为 _config.butterfly.yml),搜索search,修改为如下参数
1 | search: |
预览效果
开启本地server
1 | hexo c && hexo g && hexo s |
访问:http://localhost:4000/ ,即可看到想要的搜索功能了

本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Ethaniel!
评论





