Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#强烈建议#给head头部加防止百度转码代码 #258

Closed
araolin opened this issue Jun 29, 2015 · 4 comments
Closed

#强烈建议#给head头部加防止百度转码代码 #258

araolin opened this issue Jun 29, 2015 · 4 comments

Comments

@araolin
Copy link
Contributor

araolin commented Jun 29, 2015

百度转码出发点是好的,帮网民快速打开网页。但是这样一来我们的主题什么的显示一团糟。
移动网络,手机百度结果,访问你的网站会被百度转码,例如手机百度arao进入我的网站,杯具就出现了。
screenshot_2015-06-29-23-12-00
毁了一个好主题不说,居然还挂上了百度联盟广告。
解决方法:
找到head.swig,路径在your-hexo-site\themes\next\layout\_partials目录下,在<meta charset="UTF-8"/>下面添加两行代码

<meta http-equiv=”Cache-Control” content=”no-transform” />
<meta http-equiv=”Cache-Control” content=”no-siteapp” />

添加完后没那么快被取消转码,大约3~5个小时左右百度会取消转码(百度官方声明为5天),请耐心等待生效。

@chitanda
Copy link
Contributor

为啥我百度blog进去就没有。。

@araolin
Copy link
Contributor Author

araolin commented Jun 29, 2015

好神奇的说,我手机百度了“主题 - NexT.Mist”,有一些会有一些没有,不过加上那两行代码稳妥点吧

@iissnan iissnan added this to the v0.4.4 milestone Jun 30, 2015
iissnan added a commit that referenced this issue Jul 8, 2015
iissnan added a commit that referenced this issue Jul 8, 2015
@araolin
Copy link
Contributor Author

araolin commented Jul 11, 2015

@iissnan 前面给的代码有误,导致我禁止百度转码没成功,引号应该全部是英文半角引号。准确代码如下:

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

@iissnan
Copy link
Owner

iissnan commented Jul 13, 2015

@araolin 多谢提醒,我使用的是英文半角引号。

@iissnan iissnan closed this as completed Jul 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants