rrit
(Ayke)
1
TL;DR:目前,我们正在为每一个页面、子页面、主题等告知 Google 该页面本身具有 \"url\":\"https://www.example.com/\"。
– 对于 URL 类似于 https://meta.discourse.org/t/add-sitelinks-search-box-to-the-homepage-only/219299 的主题页面来说,这绝对是错误的。
Sitelinks Search Box 的代码目前已在每个页面、类别和主题上实现:
<script type="application/ld+json">
{
"@context":"http://schema.org",
"@type":"WebSite",
"url":"https://www.example.com/",
"potentialAction":{
"@type":"SearchAction",
"target":"https://www.example.com/search?q={search_term_string}",
"query-input":"required name=search_term_string"
}
}
</script>
例如,请参阅 Google Search Console 报告“增强功能”->“Sitelinks 搜索框”
根据 Google 的说法,它应该只添加到主页:
2 个赞
rrit
(Ayke)
2
关于 Googles 的更多背景信息:“仅将 [搜索摘要的 application/ld+json 数据] 标记添加到主页,不要添加到任何其他页面。”
此 \u003cscript type='application/ld+json'\u003e 会向 Google 提供有关其定义的实际页面/网址内容的信息。
目前,我们告诉 Google 每个页面、子页面、主题等,该页面本身是:
\"@type\":\"WebSite\"
\"url\":\"https://www.example.com/\"
– 对于网址为 https://meta.discourse.org/t/add-sitelinks-search-box-to-the-homepage-only/219299 的主题页面来说,这绝对是错误的。
我们应该从除主页以外的所有页面中删除 application/ld+json data。
或者,我们应该为每个子页面声明代表该页面内容的正确的、特定于页面的 application/ld+json data。
关于如何为 List 页面(例如“轮播”)正确使用 application/ld+json data 的示例
3 个赞
sam
(Sam Saffron)
3
是的,此功能仅属于主页和类别/标签页,欢迎提交 PR 改进。
2 个赞
rrit
(Ayke)
4
1 个赞
nat
(Natalie T)
7
嘿,感谢你提交的优秀 PR——它现在已经被合并了。
2 个赞