Hexo使用攻略:(九)为Hexo添加百度搜索

默认的Hexo用的是Google的搜索,因为某些不可抗拒的原因,访问起来不是很流畅,所以我们设置成百度搜索。

打开themes/light/layout/_widget/search.ejs文件,里面内容替换为:

1
2
3
4
5
6
7
8
9
10
<div class="search">
<form action="//baidu.com/baidu" method="get" accept-charset="utf-8">
<input type="search" name="word" results="0" placeholder="<%= __('search') %>">
<input type="hidden" name="si" value="<%- config.url.replace(/^https?:\/\//, '') %>">
<input name=tn type=hidden value="bds">
<input name=cl type=hidden value="3">
<input name=ct type=hidden value="2097152">
<input name=s type=hidden value="on">
</form>
</div>