百度推出了熊掌号,想提交的内容在搜索结果中以结构化样式展现,需要做好页面改造。这个功能自由织梦在360搜索中有了解过,如果你想让百度更喜欢你的网站,也想点击率更高就赶紧动手把!
![](http://freedede.oss-cn-hangzhou.aliyuncs.com/2020/10/yMr22y.png?x-oss-process=style/syzhong)
添加canonical标签
要求href的内容为MIP页或H5页对应的PC页地址;如果没有PC页,则填写当前页面地址,支持http和https
<link rel="canonical" href="http(s)://xxx"/>
本博客就是自适应网站,可以填写如下,
首页模板
<link rel="canonical" href="{dede:global.cfg_basehost/}"/>
列表模板
<link rel="canonical" href="{dede:type}[field:typeurl/]{/dede:type}"/>
文章模板
<link rel="canonical" href="{dede:field.arcurl/}"/>
标签首页模板和标签列表都可以用
<link rel="canonical" href="{dede:php}echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];{/dede:php}"/>
有些tag标签使用的是中文,这个获取的是当前页面的URL
添加JSON_LD数据
![](http://freedede.oss-cn-hangzhou.aliyuncs.com/2020/10/3mIB7r.jpg?x-oss-process=style/syzhong)
↑以上红色框出来的需要根据实际情况调整
把以下代码放在页面的最底部就行了,没必要放在</head>头部,下面xxxxx是你的秘钥,每个人的都不同。
<script type="application/ld+json">
{
"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
"@id": "https://ziyuan.baidu.com/college/articleinfo?id=1464",
"appid": "xxxxx",
"title": "{dede:field.title/}",
"images": [
"{dede:field.litpic/}",
"https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo_top_ca79a146.png",
"https://m.baidu.com/static/index/plus/plus_logo.png"
],
"description": "{dede:field.description/}",
"pubDate": "{dede:field.pubdate function="MyDate('Y-m-d\TH:i:s',@me)"/}",
"upDate": "{dede:field.pubdate function="MyDate('Y-m-d\TH:i:s',@me)"/}",
"lrDate": "{dede:field.pubdate function="MyDate('Y-m-d\TH:i:s',@me)"/}"
}
</script>
缩略图只支持无缩略图、1个或3个。
在线校验工具
![](http://freedede.oss-cn-hangzhou.aliyuncs.com/2020/10/quUJbi.png?x-oss-process=style/syzhong)
第一项选择需要校验的URL地址;
第二项选择否,本博客没必要采用MIP改造,根据自己实际情况选择;
第三项是页面的所有代码,在所在的页面右键->查看源代码->复制粘贴进去。
![](http://freedede.oss-cn-hangzhou.aliyuncs.com/2020/10/fuqEBv.png?x-oss-process=style/syzhong)
点击下面的“校验”按钮即可,如果出错会弹出提示如下
![](http://freedede.oss-cn-hangzhou.aliyuncs.com/2020/10/Rrumue.png?x-oss-process=style/syzhong)
自己查看对比,直至校验通过为止。
|