hexo博客搜索插件请前往 Hexo-Search
也可以打开https://www.codeboy.me查看效果
将search目录放至于博客根目录下,其中search目录结构如下:
search
├── cb-footer-add.html
├── cb-search.json
├── css
│ └── cb-search.css
├── img
│ ├── cb-close.png
│ └── cb-search.png
└── js
├── bootstrap3-typeahead.min.js
└── cb-search.js
在 _include/footer.html
中的 </footer>
后加入 cb-footer-add.html
中的内容即可。
1.需要事先引入 jquery 与 bootstrap3(js与css文件) 框架,如果没有的话,操作如下:
在_include/head.html
中引入以下代码:
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css">
在_include/footer.html
中引入以下代码:
<!-- jQuery -->
<script src="//cdn.bootcss.com/jquery/2.2.2/jquery.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="//cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
bootstrap3-typeahead.min.js
的引入必须在jquery.min.js
引入之后,即在footer.html
中的行数更靠后!
2.默认联想8个,如果需要更多的话,请检索 bootstrap3-typeahead.min.js
中的 items:8 , 将 8 替换成自己需要的数值。
Copyright 2016 Yuedong.li
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
有任何问题,欢迎发送邮件到app@codeboy.me交流.