以下是一个设置网页标题、面包屑及文章分页的 Rich Snippets 示例
<html>
<head>
<title>网站页面标题</title>
<!-- 其他元标签 -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebPage",
"name": "网站页面标题",
"breadcrumb": {
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "https://example.com/articles",
"name": "文章分类"
}
},
{
"@type": "ListItem",
"position": 2,
"item": {
"@id": "https://example.com/articles/456",
"name": "文章标题"
}
}
]
},
"hasPart": [
{
"@type": "WebPageElement",
"name": "分页1",
"isAccessibleForFree": true,
"cssSelector": "#page1"
},
{
"@type": "WebPageElement",
"name": "分页2",
"isAccessibleForFree": true,
"cssSelector": "#page2"
}
]
}
</script>
</head>
<body>
<!-- 页面内容及分页 -->
<div id="page1"></div>
<div id="page2"></div>
</body>
</html>
以下是一个设置网站品牌名称、联系人、位置及营业时间的 Rich Snippets 示例
<html>
<head>
<title>网站品牌名称</title>
<!-- 其他元标签 -->
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Organization",
"name": "网站品牌名称",
"logo": "https://example.com/logo.jpg",
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+1234567890",
"contactType": "customer service",
"areaServed": "CN",
},
"location": {
"@type": "Place",
"name": "店铺名称",
"address": {
"@type": "PostalAddress",
"addressCountry": "CN",
"addressLocality": "城市",
"addressRegion": "省份",
"postalCode": "邮编",
"streetAddress": "街道地址"
}
},
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
],
"opens": "09:00",
"closes": "18:00"
}
],
}
</script>
</head>
<body>
<!-- 页面内容 -->
</body>
</html>