具有非链接级别的面包屑
Breadcrumb with non-linked level
我尝试为具有以下结构的网站实现 JSON-LD 面包屑导航:
Home
Topic A (No content)
Article A1
Article A2
Topic B (No content)
Article B1
Article B2
Topic C (No content)
Article C1
Article C2
我的问题是第 2 级(主题 A/B/C)上的所有页面都是主导航无法访问的空白页面。人们不应导航到 "Topic A" 等
如何在我的 JSON-LD 面包屑中表达这种行为?
这是我的 JSON-LD 在第 "Article A1" 页的样子:
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://example.com/"
},{
"@type": "ListItem",
"position": 2,
"name": "Topic A",
"item": ""
},{
"@type": "ListItem",
"position": 3,
"name": "Article A1",
"item": "https://example.com/topic-a/article-a1"
}]
}
当我尝试用 https://search.google.com/structured-data/testing-tool 验证上面的代码时,它总是抱怨:
itemListElement
@type ListItem
position 2
name Topic A
item Field item requires a value.
指定 URL 以外的任何内容将导致:
Value for field item must be a valid URL.
如何描述使用 JSON-LD 的 URL 无法访问二级页面?
痕迹导航的作用是查看层次结构中的当前页面,并导航到其父页面。 Page-less 条目不应出现在那里,因为无法导航到它们。
Schema.org 的 BreadcrumbList
类型仅适用于网页(但这样的 page-less 主题当然不是网页):
A BreadcrumbList is an ItemList consisting of a chain of linked Web pages, typically described using at least their URL and their name, and typically ending with the current page.
这也是 Google 对其 Breadcrumbs rich result 的要求(如果您想获得此功能):
A user can navigate all the way up in the site hierarchy, one level at a time, by starting from the last breadcrumb in the breadcrumb trail.
因此,您可以省略 BreadcrumbList
中的 page-less 主题,或者将它们设为实际页面。
如果您不希望它们作为页面存在,您仍然可以传达主题是什么(参见下面 about
的示例),但我不希望这些数据被消费者使用对您的面包屑感兴趣的人:
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement":
[
{
"@type": "ListItem",
"position": 1,
"item":
{
"@id": "https://example.com/",
"@type": "WebPage",
"name": "Home"
}
},
{
"@type": "ListItem",
"position": 2,
"item":
{
"@id": "https://example.com/article-a1",
"@type": "WebPage",
"name": "Article A1",
"about": {
"@type": "Thing",
"name": "Topic A"
}
}
}
]
}
HTML+RDFa:
<ol typeof="schema:BreadcrumbList">
<li property="schema:itemListElement" typeof="schema:ListItem">
<a property="schema:item" typeof="schema:WebPage" href="https://example.com/">
<span property="schema:name">Home</span>
</a>
<meta property="schema:position" content="1" />
</li>
<li property="schema:itemListElement" typeof="schema:ListItem">
<a property="schema:item" typeof="schema:WebPage" href="https://example.com/article-a1">
<span property="schema:name">Article A1</span>
<span property="schema:about" typeof="schema:Thing">
<meta property="schema:name" content="Topic A" />
</span>
</a>
<meta property="schema:position" content="2" />
</li>
</ol>
我尝试为具有以下结构的网站实现 JSON-LD 面包屑导航:
Home
Topic A (No content)
Article A1
Article A2
Topic B (No content)
Article B1
Article B2
Topic C (No content)
Article C1
Article C2
我的问题是第 2 级(主题 A/B/C)上的所有页面都是主导航无法访问的空白页面。人们不应导航到 "Topic A" 等
如何在我的 JSON-LD 面包屑中表达这种行为?
这是我的 JSON-LD 在第 "Article A1" 页的样子:
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://example.com/"
},{
"@type": "ListItem",
"position": 2,
"name": "Topic A",
"item": ""
},{
"@type": "ListItem",
"position": 3,
"name": "Article A1",
"item": "https://example.com/topic-a/article-a1"
}]
}
当我尝试用 https://search.google.com/structured-data/testing-tool 验证上面的代码时,它总是抱怨:
itemListElement
@type ListItem
position 2
name Topic A
item Field item requires a value.
指定 URL 以外的任何内容将导致:
Value for field item must be a valid URL.
如何描述使用 JSON-LD 的 URL 无法访问二级页面?
痕迹导航的作用是查看层次结构中的当前页面,并导航到其父页面。 Page-less 条目不应出现在那里,因为无法导航到它们。
Schema.org 的 BreadcrumbList
类型仅适用于网页(但这样的 page-less 主题当然不是网页):
A BreadcrumbList is an ItemList consisting of a chain of linked Web pages, typically described using at least their URL and their name, and typically ending with the current page.
这也是 Google 对其 Breadcrumbs rich result 的要求(如果您想获得此功能):
A user can navigate all the way up in the site hierarchy, one level at a time, by starting from the last breadcrumb in the breadcrumb trail.
因此,您可以省略 BreadcrumbList
中的 page-less 主题,或者将它们设为实际页面。
如果您不希望它们作为页面存在,您仍然可以传达主题是什么(参见下面 about
的示例),但我不希望这些数据被消费者使用对您的面包屑感兴趣的人:
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement":
[
{
"@type": "ListItem",
"position": 1,
"item":
{
"@id": "https://example.com/",
"@type": "WebPage",
"name": "Home"
}
},
{
"@type": "ListItem",
"position": 2,
"item":
{
"@id": "https://example.com/article-a1",
"@type": "WebPage",
"name": "Article A1",
"about": {
"@type": "Thing",
"name": "Topic A"
}
}
}
]
}
HTML+RDFa:
<ol typeof="schema:BreadcrumbList">
<li property="schema:itemListElement" typeof="schema:ListItem">
<a property="schema:item" typeof="schema:WebPage" href="https://example.com/">
<span property="schema:name">Home</span>
</a>
<meta property="schema:position" content="1" />
</li>
<li property="schema:itemListElement" typeof="schema:ListItem">
<a property="schema:item" typeof="schema:WebPage" href="https://example.com/article-a1">
<span property="schema:name">Article A1</span>
<span property="schema:about" typeof="schema:Thing">
<meta property="schema:name" content="Topic A" />
</span>
</a>
<meta property="schema:position" content="2" />
</li>
</ol>