我正在将Schema.org结构化数据实现到我的杂志式网站中,并且对使用多个列表有一些担忧。
我的主页上有两个部分:“最新”和“最受欢迎”。两个部分均包含五个微型文章。我已经将这两个部分都视为“列表”。这是一个部分的示例-显然,其他部分与文章相同:
这是我的Schema JSON-LD。为了使该示例易于阅读并删除了域名/名称,我在...
处将其简化了一点。到目前为止,我仅在此{{1 }},并使用Google的结构化数据测试工具对其进行测试,将返回零警告和零错误:
ItemList
但是,如上所述,本<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"numberOfItems": "5",
"itemListOrder": "Descending",
"itemListElement": [
{
"@type": "Article",
"position": "1",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "/motoring/audi-launches-2019-sq8-tdi/"
},
"articleSection": "Motoring",
"headline": "Audi launches 2019 SQ8 TDI",
"datePublished": "2019-09-01",
"dateModified": "2019-09-01",
"image": "/content/uploads/2019/08/2019-audi-sq8-tdi-001-800.jpg",
"url": "/motoring/audi-launches-2019-sq8-tdi/",
"author": "The Author",
"publisher": {
"@type": "Organization",
"name": "Company Name",
"url": "https://company.name",
"logo": {
"@type": "ImageObject",
"url": "https://company.name/logo.png"
},
"founder": "Founder",
"foundingDate": "2019"
}
},
{
"@type": "Article",
"position": "2",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "/gadgets-tech/meet-keysmart-the-smart-key-oraganiser/"
},
"articleSection": "Gadgets & Tech",
"headline": "Meet Keysmart: The smart key organiser",
"datePublished": "2019-09-01",
"dateModified": "2019-09-01",
"image": "/content/uploads/2019/08/the-smartkey-orgainser-001-800.jpg",
"url": "/gadgets-tech/meet-keysmart-the-smart-key-oraganiser/",
"author": "The Author",
"publisher": {
"@type": "Organization",
"name": "Company Name",
"url": "https://company.name",
"logo": {
"@type": "ImageObject",
"url": "https://company.name/logo.png"
},
"founder": "Founder",
"foundingDate": "2019"
}
},
...
]
}
</script>
仅适用于五篇“最新”文章。我现在想为另一部分“最受欢迎”添加结构化数据,但不确定如何最好地使用它。
ItemList
中,
创建一个新的ItemList
还是创建一个新的脚本/ JSON?怎么
这个最好的实现?请提供示例。ItemList
。我使用类型'WebPage'是正确的还是应该
使用类型“ Article”?答案 0 :(得分:2)
通常使用HTML5语义元素(主要,部分等)+正确的网站大纲(每个列表均使用H2等)。
关于您的架构。 最好的想法是在“微数据”视图中进行思考。
您的列表未嵌套
<ul>
<li>
<ul><li></li></ul>
</li>
<li>
<ul><li></li></ul>
</li>
</ul>
嵌套列表示例: https://schema.org/OfferCatalog#offer-3
在这种情况下,我认为最好/简单的想法是使用两个单独的列表“对象” (并为每个列表添加名称/ url /等等)-示例概述(缺少短代码的属性):
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"name": "Recent Articles",
"numberOfItems": "1",
"itemListOrder": "Descending",
"itemListElement": [
{
"@type": "Article",
"position": "1",
"headline": "I am recent Article"
}
]
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"name": "Popular Articles",
"numberOfItems": "1",
"itemListOrder": "Descending",
"itemListElement": [
{
"@type": "Article",
"position": "1",
"headline": "I am Popular Article"
}
]
}
</script>
尝试这个想法:
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/itemref
https://moz.com/blog/search-marketers-guide-to-itemref-itemid
示例(对组织的引用组织对象):
<!-- Organization -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"@id": "#Organization-name",
"name": "My Organization"
}
</script>
<!-- Recent Articles -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"name": "Recent Articles",
"numberOfItems": "1",
"itemListOrder": "Descending",
"itemListElement": [
{
"@type": "Article",
"position": "1",
"headline": "I am recent Article",
"publisher": {
"@id": "#Organization-name"
}
}
]
}
</script>
<!-- Popular Articles -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "ItemList",
"name": "Popular Articles",
"numberOfItems": "1",
"itemListOrder": "Descending",
"itemListElement": [
{
"@type": "Article",
"position": "1",
"headline": "I am Popular Article",
"publisher": {
"@id": "#Organization-name"
}
}
]
}
</script>