GitHub - splub/hexo-search: hexo search component · GitHub
Skip to content
 
 

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

Hexo-Search

hexo博客搜索插件

jekyll博客搜索插件请前往 Jekyll-Search

截图

hexo-search.jpg

也可以打开http://codeboy.me查看效果

操作

  1. 点击右下角图标进行搜索
  2. 双击ctrl键进行搜索或关闭
  3. 搜索页面点击右上角关闭按钮关闭搜索试图

加入步骤

  1. 安装搜索插件:

    npm install hexo-search-data-plugin --save
    

    或者在package.json中添加一下依赖:

    "hexo-search-data-plugin":"^1.0.0"
    

    之后执行npm update即可

  2. 将search目录放至于hexo主题的source文件夹下,其中search目录结构如下:

     search
     ├── cb-footer-add.html
     ├── css
     │   └── cb-search.css
     ├── img
     │   ├── cb-close.png
     │   └── cb-search.png
     └── js
         ├── bootstrap3-typeahead.min.js
         └── cb-search.js
    
  3. 在当前主题的layout/_partial/after-footer.ejs 中的末尾加入 cb-footer-add.html 中的内容即可, 添加完毕后 cb-footer-add.html 文件可以删除。

如果主题不存在after-footer.ejs文件,也可以添加在footer.ejs中。

注意事项

  1. bootstrap3-typeahead.min.js 的引入必须在jquery.min.js引入之后!

  2. 默认联想8个,如果需要更多的话,请检索 bootstrap3-typeahead.min.js 中的items:8, 将8替换成自己需要的数值。

  3. 文章标题请不要使用回车等符号,回车等符号会造成json解析错误。

更新历史

v1.0.1

  • 添加错误console输出。搜索没提示,看console。

v1.0.0

  • 支持hexo博客中进行文章搜索。

有任何问题何以发送邮件到app@codeboy.me进行交流。

About

hexo search component

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages