schema.org - 第二页和连续页的类别页面json-ld模式?
问题描述
我们有一个分页的类别页面。我们不清楚如何处理分页中的模式,尤其是对于第二页和后续页面。
下面是我们目前定义的。第一页的CollectionPage
架构:
{
"@context":"http://schema.org",
"@type":"CollectionPage",
"@id":"https://www.example.com/cat?pg=1",
"url":"https://www.example.com/cat?pg=1",
"breadcrumb":{...},
}
而且,第一页的ItemList
架构:
{
"@context":"https://schema.org",
"@type":"ItemList",
"@id":"https://www.example.com/cat?pg=1#cat-page", // 1st pg URL, with hash URI
"url":"https://www.example.com/cat?pg=1", // 1st pg URL
"name":"Running Shoes",
"numberOfItems":"490",
"mainEntityOfPage":"https://www.example.com/cat?pg=1", // 1st pg URL
"itemListElement":[
{
"@type":"ListItem",
"position":"1",
"url":"..."
},{
...
},{
"@type":"ListItem",
"position":"50", // 50 items per page
"url":"..."
}
]
}
在第 2 页和后续页面上,我们只有一个ItemList
,如下所示:
{
"@context":"https://schema.org",
"@type":"ItemList",
"@id":"https://www.example.com/cat?pg=1#cat-page", // 1st pg URL, with hash URI
"url":"https://www.example.com/cat?pg=1", // 1st pg URL
"name":"Running Shoes",
"numberOfItems":"490",
"mainEntityOfPage":"https://www.example.com/cat?pg=1", // 1st pg URL (CollectionPage there)
"itemListElement":[
{
"@type":"ListItem",
"position":"51",
"url":"..."
},{
...
},{
"@type":"ListItem",
"position":"100", // 50 items per page
"url":"..."
}
]
}
注意第二页ItemList
有它@id
,url
并且mainEntityOfPage
都使用第一页的 URL,第二页的 URL 没有使用。itemListElement
与第一页声明相比,只有数组发生了变化。
Google说(第 1 点,最后一张图)对于 HTML 数据,它会整理分页列表并构建单页摘要。对于模式,ItemListnumberOfItems
被定义为保存跨页面的项目总数。因此,它希望消费者将ItemList
. 尽管 HTML 和 Schema 是不同的实体,但我假设像 Google 和其他人这样的消费者将处理分页模式 ItemList。
但是,不清楚的是如何声明@id
,url
和mainEntityOfPage
分页的ItemList
. 我将它们设置为指向它在第一页上的第一个实例。
查询是:这是为分页类别页面执行模式的正确方法吗?或者,我们缺少一些东西或者可能是更好的方法?
解决方案
推荐阅读
- android - 为 Room TypeConverter 配置 Moshi
- numpy - 获取 numpy 数组的索引,其中值与自身偏移一定量
- databricks - 结构化流上作业管道的 delta Lake 最佳分区策略
- c++ - 如何检查字符串中子字符串出现的次数?
- java - 为什么“java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to”错误适用于有界类型参数而不适用于正式类型参数?
- excel - 将工作表从文件夹中分组的多个工作簿复制到主文件
- javascript - 显示用户相对时区的 UTC 时间戳的时间
- html - 如何修复从鼠标悬停宽度变化的周围 div 的 div 移位?
- linux - 从 SH 运行命令
- julia - Julia 中是否有任何 #define 等价物?