这篇文章是紧跟上篇文章的,没有阅读上篇文章的小伙伴可以点击下面↓↓↓进去阅读
JSON-LD格式
接下来,SEO 现在能够将 JSON-LD 设置为一种结构化数据形式。结构化数据是一种标准化格式,用于提供有关网页的信息和对网页内容进行分类。
如果使用应用程序目录,请确保添加 useAppDir={true} 属性,并且您正在使用 page.js 中的组件
下面您将找到一个非常基本的页面,该页面实现了每种可用的 JSON-LD 类型:
- Article
- Breadcrumb
- 博客
- Campground
- Recipe
- 附加链接搜索框
- Course
- 数据
- 公司联系方式
- FAQ页面
- 操作方法
- 招聘启事
- 本地业务
- 产品
- 社交资料
- 新闻报道
- 公园
JSON-LD 安全性
只是关于安全性的快速说明。要将 JSON-LD 放到页面上,它需要位于 script 标记中。 为此,请使用带有 的 script 标记。
因此,如果将任何内容直接从 URL 传递到以下组件之一,请确保在需要时先对其进行清理。
查看实施详细信息。
处理多个实例
如果您的页面需要给定 JSON-LD 组件的多个实例,您可以指定唯一属性,并将处理其余部分。
这对于博客卷、搜索结果和概述页面非常方便。
请充分研究何时应该添加多个 JSON-LD 实例,以及不应该添加多个 JSON-LD 实例。
<ExampleJsonLd keyOverride="my-new-key" />
Article
import { ArticleJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Article JSON-LD</h1>
<ArticleJsonLd
useAppDir={false}
url="https://example.com/article"
title="Article headline"
images={[
'https://example.com/photos/1x1/photo.jpg',
'https://example.com/photos/4x3/photo.jpg',
'https://example.com/photos/16x9/photo.jpg',
]}
datePublished="2015-02-05T08:00:00+08:00"
dateModified="2015-02-05T09:00:00+08:00"
authorName={[
{
name: 'Jane Blogs',
url: 'https://example.com',
},
{
name: 'Mary Stone',
url: 'https://example.com',
},
]}
publisherName="Gary Meehan"
publisherLogo="https://www.example.com/photos/logo.jpg"
description="This is a mighty good description of this article."
isAccessibleForFree={true}
/>
</>
);
export default Page;
Breadcrumb
import { BreadcrumbJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Breadcrumb JSON-LD</h1>
<BreadcrumbJsonLd
itemListElements={[
{
position: 1,
name: 'Books',
item: 'https://example.com/books',
},
{
position: 2,
name: 'Authors',
item: 'https://example.com/books/authors',
},
{
position: 3,
name: 'Ann Leckie',
item: 'https://example.com/books/authors/annleckie',
},
{
position: 4,
name: 'Ancillary Justice',
item: 'https://example.com/books/authors/ancillaryjustice',
},
]}
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
itemListElements | |
itemListElements.position | Breadcrumb在Breadcrumb轨迹中的位置。位置 1 表示小径的开始。 |
itemListElements.name | 为用户显示的痕迹导航的标题。 |
itemListElements.item | 表示痕迹导航的网页的 URL。 |
其他 如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
博客
import { ArticleJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Blog JSON-LD</h1>
<ArticleJsonLd
type="BlogPosting"
url="https://example.com/blog"
title="Blog headline"
images={[
'https://example.com/photos/1x1/photo.jpg',
'https://example.com/photos/4x3/photo.jpg',
'https://example.com/photos/16x9/photo.jpg',
]}
datePublished="2015-02-05T08:00:00+08:00"
dateModified="2015-02-05T09:00:00+08:00"
authorName="Jane Blogs"
description="This is a mighty good description of this blog."
/>
</>
);
export default Page;
Campground
import { CampgroundJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Campground JSON-LD</h1>
<CampgroundJsonLd
id="https://www.example.com/campground/rip-van-winkle-campground"
name="Rip Van Winkle Campgrounds"
url="https://www.example.com/campground"
telephone="+18452468114"
images={['https://example.com/photos/1x1/photo.jpg']}
address={{
streetAddress: '149 Blue Mountain Rd',
addressLocality: 'Saugerties',
addressRegion: 'NY',
postalCode: '12477',
addressCountry: 'US',
}}
description="Description about Rip Van Winkle Campgrounds"
geo={{
latitude: '42.092599',
longitude: '-74.018580',
}}
openingHours={[
{
opens: '09:00',
closes: '17:00',
dayOfWeek: [
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday',
],
validFrom: '2019-12-23',
validThrough: '2020-04-02',
},
]}
petsAllowed
rating={{
ratingValue: '5',
ratingCount: '18',
}}
amenityFeature={{
name: 'Showers',
value: true,
}}
priceRange="$$"
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
@id | 以 URL 形式提供特定Campground的全局唯一 ID。 |
address | 具体Campground位置的地址 |
address.addressCountry | 2 个字母的 ISO 3166-1 alpha-2 国家/地区代码 |
address.addressLocality | 城市 |
address.addressRegion | 省/市/自治区/直辖市/自治区(如适用)。 |
address.postalCode | 邮政编码。 |
address.streetAddress | 街道编号、街道名称和单元号。 |
name | Campground名称。 |
description | Campground描述。 |
支持的属性
财产 | 信息 |
---|---|
geo | Campground的地理坐标。 |
geo.latitude | Campground位置的纬度 |
geo.longitude | Campground位置的经度 |
images | Campground的一张或多张图片。对于有效标记是必需的,具体取决于类型 |
telephone | Campground电话号码是客户的主要联系方式。 |
url | 特定Campground的完全限定 URL。 |
openingHours | Campground的开放时间规范。您可以将其作为单个对象提供,也可以将其作为具有以下属性的对象数组提供。 |
openingHours.opens | 地点或服务在一周中给定日期的开放时间。 |
openingHours.closes | 地点或服务在一周中给定日期的关闭时间。 |
openingHours.dayOfWeek | 这些开放时间有效的星期几。可以是字符串或字符串数组。 |
openingHours.validFrom | 项目生效的日期。 |
openingHours.validThrough | 项目无效的日期。 |
isAccessibleForFree | Campground是否免费开放。 |
petsAllowed campgroud | 是否允许宠物入住。 |
amenityFeature | 露营地的便利设施(例如特色或服务)。 |
amenityFeature.name | 设施的名称。 |
amenityFeature.value | 便利设施的价值。 |
priceRange | 露营地的价格范围,例如 $$$。 |
rating | 露营地的平均评分基于多个评分或评论。 |
rating.ratingValue | 内容的分级。 |
rating.ratingCount | 评分总数的计数。 |
其他 如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
Recipe
import { RecipeJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Recipe JSON-LD</h1>
<RecipeJsonLd
name="Party Coffee Cake"
description="This coffee cake is awesome and perfect for parties."
datePublished="2018-03-10"
authorName={['Jane Blogs', 'Mary Stone']}
prepTime="PT20M"
cookTime="PT30M"
totalTime="PT50M"
keywords="cake for a party, coffee"
yields="10"
category="Dessert"
cuisine="American"
calories={270}
'https://example.com/photos/1x1/photo.jpg',
'https://example.com/photos/4x3/photo.jpg',
'https://example.com/photos/16x9/photo.jpg',
]}
ingredients={[
'2 cups of flour',
'3/4 cup white sugar',
'2 teaspoons baking powder',
'1/2 teaspoon salt',
'1/2 cup butter',
'2 eggs',
'3/4 cup milk',
]}
instructions={[
{
name: 'Preheat',
text: 'Preheat the oven to 350 degrees F. Grease and flour a 9x9 inch pan.',
url: 'https://example.com/party-coffee-cake#step1',
image: 'https://example.com/photos/party-coffee-cake/step1.jpg',
},
]}
aggregateRating={{
ratingValue: '5',
ratingCount: '18',
}}
video={{
name: 'How to make a Party Coffee Cake',
description: 'This is how you make a Party Coffee Cake.',
contentUrl: 'http://www.example.com/video123.mp4',
embedUrl: 'http://www.example.com/videoplayer?video=123',
uploadDate: '2018-02-05T08:00:00+08:00',
duration: 'PT1M33S',
thumbnailUrls: [
'https://example.com/photos/1x1/photo.jpg',
'https://example.com/photos/4x3/photo.jpg',
'https://example.com/photos/16x9/photo.jpg',
],
expires: '2019-02-05T08:00:00+08:00',
hasPart: {
'@type': 'Clip',
name: 'Preheat oven',
startOffset: 30,
url: 'http://www.example.com/example?t=30',
},
watchCount: 2347,
publication: {
'@type': 'BroadcastEvent',
isLiveBroadcast: true,
startDate: '2020-10-24T14:00:00+00:00',
endDate: '2020-10-24T14:37:14+00:00',
},
regionsAllowed: ['IT', 'NL'],
}}
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
name | 配方的名称 |
description | 配方说明 |
authorName | 配方作者的姓名。可以是字符串或字符串数组。 |
ingredients | 成分字符串列表 |
instructions | - |
instructions.name | 指令步骤的名称。 |
instructions.text | 指令步骤的方向。 |
其他 如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
附加链接搜索框
import { SiteLinksSearchBoxJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Sitelinks Search Box JSON-LD</h1>
<SiteLinksSearchBoxJsonLd
url="https://www.example.com"
potentialActions={[
{
target: 'https://query.example.com/search?q',
queryInput: 'search_term_string',
},
{
target: 'android-app://com.example/https/query.example.com/search/?q',
queryInput: 'search_term_string',
},
]}
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
url | 与附加链接搜索框关联的网站的网址 |
potentialActions | 一个或两个 SearchAction 对象的数组。描述要将查询发送到的 URI 以及发送的请求的语法 |
potentialActions.target | 对于网站,应接收和处理搜索查询的处理程序的 URL;对于应用,应处理查询的搜索引擎的 intent 处理程序的 URI |
potentialActions.queryInput | 目标中使用的占位符,用于替换用户给定的查询 |
其他 如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
Course
import { CourseJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Course JSON-LD</h1>
<CourseJsonLd
courseName="Course Name"
description="Introductory CS course laying out the basics."
provider={{
name: 'Course Provider',
url: 'https//www.example.com/provider',
}}
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
courseName | Course的标题。 |
description | Course说明。显示限制为 60 个字符。 |
provider.name | Course提供者名称。 |
provider.url | Course提供者名称 URL。 |
推荐属性
财产 | 信息 |
---|---|
providerUrl | Course提供者的 URL。 |
其他 如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
数据
import { DatasetJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Dataset JSON-LD</h1>
<DatasetJsonLd
description="The description needs to be at least 50 characters long"
name="name of the dataset"
license="https//www.example.com"
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
description | 描述数据集的简短摘要。需要介于 50 到 5000 个字符之间。 |
name | 分发数据集时所依据的许可证。 |
推荐属性
财产 | 信息 |
---|---|
license | Course提供者的 URL。 |
其他 如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
公司联系方式
import { CorporateContactJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Corporate Contact JSON-LD</h1>
<CorporateContactJsonLd
url="http://www.your-company-site.com"
logo="http://www.example.com/logo.png"
contactPoint={[
{
telephone: '+1-401-555-1212',
contactType: 'customer service',
email: 'customerservice@email.com',
areaServed: 'US',
availableLanguage: ['English', 'Spanish', 'French'],
},
{
telephone: '+1-877-746-0909',
contactType: 'customer service',
email: 'servicecustomer@email.com',
contactOption: 'TollFree',
availableLanguage: 'English',
},
{
telephone: '+1-877-453-1304',
contactType: 'technical support',
contactOption: 'TollFree',
areaServed: ['US', 'CA'],
availableLanguage: ['English', 'French'],
},
]}
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
url | 公司官方网站主页的 URL。 |
contactPoint | |
contactPoint.telephone | 电话号码的国际化版本,以“+”符号和国家/地区代码开头 |
contactPoint.contactType | 电话号码用途的描述,即 .Technical Support |
推荐的 ContactPoint 属性
财产 | 信息 |
---|---|
contactPoint.areaServed | String或企业服务的地理区域。示例或Array"US"[“US”, “CA”, “MX”] |
contactPoint.availableLanguage | 有关所用语言的详细信息。示例或"English"[“English”, “French”] |
contactPoint.email | 与企业合作的电子邮件’ |
gecontactPointo.contactOption | 有关电话号码的详细信息。例"TollFree" |
其他 如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
FAQ页面
import { FAQPageJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>FAQ Page JSON-LD</h1>
<FAQPageJsonLd
mainEntity={[
{
questionName: 'How long is the delivery time?',
acceptedAnswerText: '3-5 business days.',
},
{
questionName: 'Where can I find information about product recalls?',
acceptedAnswerText: 'Read more on under information.',
},
]}
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
mainEntity | |
mainEntity.questionName | 问题的全文。例如,“交货时间是多长时间? |
mainEntity.acceptedAnswerText | 问题的完整答案。 |
其他如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
操作方法
import { HowToJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>How-to JSON-LD</h1>
<HowToJsonLd
name="How to tile a kitchen backsplash"
image="https://example.com/photos/1x1/photo.jpg"
estimatedCost={{ currency: 'USD', value: '100' }}
supply={['tiles', 'thin-set', 'mortar', 'tile grout', 'grout sealer']}
tool={['notched trowel', 'bucket', 'large sponge']}
step={[
{
url: 'https://example.com/kitchen#step1',
name: 'Prepare the surfaces',
itemListElement: [
{
type: 'HowToTip',
text: 'Turn off the power to the kitchen and then remove everything that is on the wall, such as outlet covers, switchplates, and any other item in the area that is to be tiled.',
},
{
type: 'HowToDirection',
text: 'Then clean the surface thoroughly to remove any grease or other debris and tape off the area.',
},
],
image: 'https://example.com/photos/1x1/photo-step1.jpg',
},
]}
totalTime="P2D"
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
name | 贴士文章的名称 |
step | 一组 HowToStep 元素,这些元素包含操作方法的完整说明。 |
支持的属性
财产 | 信息 |
---|---|
estimatedCost | 执行指令时消耗的耗材的估计成本。 |
image | 已完成的操作方法的图像。 |
supply | 执行指令或指示时消耗的电源。 |
tool | 执行指令或方向时使用(但未使用)的对象。 |
totalTime | 执行所有指令或指示所需的总时间(包括准备耗材的时间),采用 ISO 8601 持续时间格式。 |
其他如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
招聘启事
import { JobPostingJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Job Posting JSON-LD</h1>
<JobPostingJsonLd
datePosted="2020-01-06T03:37:40Z"
description="Company is looking for a software developer...."
hiringOrganization={{
name: 'company name',
sameAs: 'www.company-website-url.dev',
}}
jobLocation={{
streetAddress: '17 street address',
addressLocality: 'Paris',
addressRegion: 'Ile-de-France',
postalCode: '75001',
addressCountry: 'France',
}}
title="Job Title"
baseSalary={{
currency: 'EUR',
value: 40, // Can also be a salary range, like [40, 50]
unitText: 'HOUR',
}}
employmentType="FULL_TIME"
jobLocationType="TELECOMMUTE"
validThrough="2020-01-06"
applicantLocationRequirements="FR"
experienceRequirements={{
occupational: {
minimumMonthsOfExperience: 12,
},
educational: {
credentialCategory: 'high school',
},
experienceInPlaceOfEducation: true,
}}
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
datePosted | 雇主以 ISO 8601 格式发布职位的原始日期 |
description | HTML 格式的作业完整描述 |
hiringOrganization | 一个对象,包含有关公司招聘的信息,其中包含以下字段或匿名招聘时的字符串’confidential’ |
hiringOrganization.name | 提供工作职位的公司名称 |
hiringOrganization.sameAs | 引用网页的 URL |
title | 职位的标题(不是职位的标题) |
validThrough | 以 ISO 8601 格式发布的招聘信息到期日期 |
支持的属性
财产 | 信息 |
---|---|
applicantLocationRequirements | 员工可能所在的地理位置,才有资格进行远程工作 |
baseSalary | |
baseSalary.currency | 表示货币金额的货币 |
baseSalary.value | 定量值的值。您还可以提供一系列最低和最高工资。. |
baseSalary.unitText | 指示计量单位的字符串 基本工资准则 |
employmentType | 就业类型 就业类型指南 |
jobLocation | 员工将上班的企业的实际位置(例如办公室或工作场所),而不是发布工作的位置。 |
jobLocation.streetAddress | 街道地址。例如,1600 Amphitheatre Pkwy |
jobLocation.addressLocality | 地点。例如,山景城。 |
jobLocation.addressRegion | 该地区。例如,CA。 |
jobLocation.postalCode | 邮政编码。例如,94043 |
jobLocation.addressCountry | 国家。例如,美国。您还可以提供双字母 ISO 3166-1 alpha-2 国家/地区代码。 |
jobLocationType | 作业地点作业地点类型指南的说明 |
hiringOrganization.logo | 第三方招聘网站上的徽标 招聘组织指南 |
experienceRequirements.occupational.minimumMonthsOfExperience | 职位发布所需的最低工作月数。经验和教育要求 |
experienceRequirements.educational.credentialCategory | 招聘信息所需的教育水平。使用以下选项之一:、、、、high schoolassociate degreebachelor degreeprofessional certificatepostgraduate degree |
experienceRequirements.experienceInPlaceOfEducation | 布尔值:如果设置为 true,则此属性指示招聘信息是否接受经验来代替其正式教育资格。如果设置为 true,则必须同时包含 experienceRequirements 和 educationRequirements 属性。 |
其他如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
本地业务
本地业务由属性子集支持。
<LocalBusinessJsonLd
type="Store"
id="http://davesdeptstore.example.com"
name="Dave's Department Store"
description="Dave's latest department store in San Jose, now open"
url="http://www.example.com/store-locator/sl/San-Jose-Westgate-Store/1427"
telephone="+14088717984"
address={{
streetAddress: '1600 Saratoga Ave',
addressLocality: 'San Jose',
addressRegion: 'CA',
postalCode: '95129',
addressCountry: 'US',
}}
geo={{
latitude: '37.293058',
longitude: '-121.988331',
}}
images={[
'https://example.com/photos/1x1/photo.jpg',
'https://example.com/photos/4x3/photo.jpg',
'https://example.com/photos/16x9/photo.jpg',
]}
sameAs={[
'www.company-website-url1.dev',
'www.company-website-url2.dev',
'www.company-website-url3.dev',
]}
openingHours={[
{
opens: '08:00',
closes: '23:59',
dayOfWeek: [
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
],
validFrom: '2019-12-23',
validThrough: '2020-04-02',
},
{
opens: '14:00',
closes: '20:00',
dayOfWeek: 'Sunday',
validFrom: '2019-12-23',
validThrough: '2020-04-02',
},
]}
rating={{
ratingValue: '4.5',
ratingCount: '2',
}}
review={[
{
author: 'John Doe',
datePublished: '2006-05-04',
name: 'A masterpiece of literature',
reviewBody:
'I really enjoyed this book. It captures the essential challenge people face as they try make sense of their lives and grow to adulthood.',
reviewRating: {
bestRating: '5',
worstRating: '1',
reviewAspect: 'Ambiance',
ratingValue: '4',
},
},
{
author: 'Bob Smith',
datePublished: '2006-06-15',
name: 'A good read.',
reviewBody: "Catcher in the Rye is a fun book. It's a good book to read.",
reviewRating: {
ratingValue: '4',
},
},
]}
makesOffer={[
{
priceSpecification: {
type: 'UnitPriceSpecification',
priceCurrency: 'EUR',
price: '1000-10000',
},
itemOffered: {
name: 'Motion Design Services',
description:
'We are the expert of animation and motion design productions.',
},
},
{
priceSpecification: {
type: 'UnitPriceSpecification',
priceCurrency: 'EUR',
price: '2000-10000',
},
itemOffered: {
name: 'Branding Services',
description:
'Real footage is a powerful tool when it comes to show what the business is about. Can be used to present your company, show your factory, promote a product packshot, or just tell any story. It can help create emotional links with your audience by showing punchy images.',
},
},
]}
areaServed={[
{
geoMidpoint: {
latitude: '41.108237',
longitude: '-80.642982',
},
geoRadius: '1000',
},
{
geoMidpoint: {
latitude: '51.108237',
longitude: '-80.642982',
},
geoRadius: '1000',
},
]}
action={{
actionName: 'potentialAction',
actionType: 'ReviewAction',
target: 'https://www.example.com/review/this/business',
}}
/>
必需属性
财产 | 信息 |
---|---|
@id | 以 URL 形式提供特定营业地点的全局唯一 ID。 |
type | LocalBusiness 或任何子类型 |
address | 具体营业地点地址 |
address.addressCountry | 2 个字母的 ISO 3166-1 alpha-2 国家/地区代码 |
address.addressLocality | 城市 |
address.addressRegion | 省/市/自治区/直辖市/自治区(如适用)。 |
address.postalCode | 邮政编码。 |
address.streetAddress | 街道编号、街道名称和单元号。 |
name | 公司名称。 |
支持的属性
财产 | 信息 |
---|---|
description | 营业地点说明 |
geo | 企业的地理坐标。 |
geo.latitude | 营业地点的纬度 |
geo.longitude | 营业地点的经度 |
rating | 基于多个评级或评论的业务平均评级。 |
rating.ratingValue | 内容的分级。 |
rating.ratingCount | 评分总数的计数。 |
priceRange | 商家的相对价格范围。 |
servesCuisine | 餐厅供应的美食类型。 |
images | 企业的一张或多张图片。对于有效标记是必需的,具体取决于类型 |
telephone | 企业电话号码是客户的主要联系方式。 |
url | 特定营业地点的完全限定 URL。 |
sameAs | 表示此业务的 URL 数组 |
openingHours | 营业时间规范。您可以将其作为单个对象提供,也可以将其作为具有以下属性的对象数组提供。 |
openingHours.opens | 地点或服务在一周中给定日期的开放时间。 |
openingHours.closes | 地点或服务在一周中给定日期的关闭时间。 |
openingHours.dayOfWeek | 这些开放时间有效的星期几。可以是字符串或字符串数组。参考 DayOfWeek |
openingHours.validFrom | 项目生效的日期。 |
openingHours.validThrough | 项目无效的日期。 |
review | 对当地业务的审查。 |
review.author | 此内容或评级的作者。 |
review.reviewBody | 审核的实际正文。 |
review.datePublished | 首次广播/出版日期。 |
review.name | 项的名称。 |
review.rating | 这篇评论中给出的评级 |
review.rating.ratingValue | 内容的分级。 |
review.rating.reviewAspect | 此评论或评级与已审核项目的这一部分或方面相关。 |
review.rating.worstRating | 此评级系统中允许的最低值。如果省略 worstRating,则假定为 1。 |
review.rating.bestRating | 此评级系统中允许的最高值。如果省略 bestRating,则假定为 5 |
areasServed | 提供服务或提供项目所在的地理区域。 |
areasServed.GeoCircle | GeoCircle是表示圆形地理区域的 GeoShape。 |
areasServed.GeoCircle.geoMidpoint | 指示位于 GeoShape 中心的 GeoCoordinates,例如 GeoCircle。 |
areasServed.GeoCircle.geoMidpoint.latitude | 位置的纬度。例如:37.42242 |
areasServed.GeoCircle.geoMidpoint.longitude | 项的名称。 |
areasServed.GeoCircle.geoRadius | 表示 GeoCircle 的大致半径(米,除非通过距离表示法另有说明)。 |
makesOffer | 指向组织或个人提供的产品或服务的指针。 |
makesOffer.offer | 转让项目的某些权利或提供服务的要约 |
makesOffer.offer.priceSpecification | 一个或多个详细的价格规格,指示单价和交货或付款费用。 |
makesOffer.offer.priceSpecification.priceCurrency | 价格的货币,或附加到 PriceSpecification 及其子类型时的价格组件。 |
makesOffer.offer.priceSpecification.price | 产品或附加到 PriceSpecification 及其子类型时价格组件的报价。 |
makesOffer.offer.itemOffered | 提供(或要求)的物品 |
makesOffer.offer.itemOffered.name | 项目的名称 |
makesOffer.offer.itemOffered.description | 项的说明。 |
action | 直接代理和间接参与者对直接对象执行的操作。 |
action.target | 指示 Action 的目标 EntryPoint。 |
其他如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
注意:
对于您可以使用的大多数类型,建议使用图像,如有疑问,则应添加图像。
商标
import { LogoJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Logo JSON-LD</h1>
<LogoJsonLd
logo="http://www.your-site.com/images/logo.jpg"
url="http://www.your-site.com"
/>
</>
);
export default Page;
财产 | 信息 |
---|---|
url | 与徽标关联的网站的 URL。 |
logo | 代表组织的徽标的 URL。 |
其他如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
产品
import { ProductJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Product JSON-LD</h1>
<ProductJsonLd
productName="Executive Anvil"
images={[
'https://example.com/photos/1x1/photo.jpg',
'https://example.com/photos/4x3/photo.jpg',
'https://example.com/photos/16x9/photo.jpg',
]}
description="Sleeker than ACME's Classic Anvil, the Executive Anvil is perfect for the business traveler looking for something to drop from a height."
brand="ACME"
color="blue"
manufacturerName="Gary Meehan"
manufacturerLogo="https://www.example.com/photos/logo.jpg"
material="steel"
slogan="For the business traveller looking for something to drop from a height."
disambiguatingDescription="Executive Anvil, perfect for the business traveller."
releaseDate="2014-02-05T08:00:00+08:00"
productionDate="2015-02-05T08:00:00+08:00"
purchaseDate="2015-02-06T08:00:00+08:00"
award="Best Executive Anvil Award."
reviews={[
{
author: 'Jim',
datePublished: '2017-01-06T03:37:40Z',
reviewBody:
'This is my favorite product yet! Thanks Nate for the example products and reviews.',
name: 'So awesome!!!',
reviewRating: {
bestRating: '5',
ratingValue: '5',
worstRating: '1',
},
publisher: {
type: 'Organization',
name: 'TwoVit',
},
},
]}
aggregateRating={{
ratingValue: '4.4',
reviewCount: '89',
}}
offers={[
{
price: '119.99',
priceCurrency: 'USD',
priceValidUntil: '2020-11-05',
itemCondition: 'https://schema.org/UsedCondition',
availability: 'https://schema.org/InStock',
url: 'https://www.example.com/executive-anvil',
seller: {
name: 'Executive Objects',
},
},
{
price: '139.99',
priceCurrency: 'CAD',
priceValidUntil: '2020-09-05',
itemCondition: 'https://schema.org/UsedCondition',
availability: 'https://schema.org/InStock',
url: 'https://www.example.ca/executive-anvil',
seller: {
name: 'Executive Objects',
},
},
]}
mpn="925872"
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
lowPrice | 所有优惠中的最低价格。使用浮点数。 |
priceCurrency | 用于描述产品价格的货币,采用三个字母的 ISO 4217 格式。 |
推荐属性
财产 | 信息 |
---|---|
highPrice | 所有优惠中的最高价格。使用浮点数。 |
offerCount | 产品的报价数量。 |
offers | 转让项目某些权利或提供服务的要约。您可以将其作为单个对象提供,也可以将其作为具有以下属性的对象数组提供。 |
其他如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
社交资料
import { SocialProfileJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Social Profile JSON-LD</h1>
<SocialProfileJsonLd
type="Person"
name="your name"
url="http://www.your-site.com"
sameAs={[
'http://www.facebook.com/your-profile',
'http://instagram.com/yourProfile',
'http://www.linkedin.com/in/yourprofile',
'http://plus.google.com/your_profile',
]}
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
type | 个人或组织 |
name | 个人或组织的名称 |
url | 个人或组织的官方网站的 URL。 |
sameAs | 个人或组织的官方社交媒体资料页面的 URL 数组 |
其他如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
Google 支持的社交资料
- Google+
- YouTube
- Myspace
- SoundCloud
- Tumblr
新闻报道
import { NewsArticleJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>News Article JSON-LD</h1>
<NewsArticleJsonLd
url="https://example.com/article"
title="Article headline"
images={[
'https://example.com/photos/1x1/photo.jpg',
'https://example.com/photos/4x3/photo.jpg',
'https://example.com/photos/16x9/photo.jpg',
]}
section="politic"
keywords="prayuth,taksin"
datePublished="2015-02-05T08:00:00+08:00"
dateModified="2015-02-05T09:00:00+08:00"
authorName="Jane Blogs"
publisherName="Gary Meehan"
publisherLogo="https://www.example.com/photos/logo.jpg"
description="This is a mighty good description of this article."
body="This is all text for this news article"
isAccessibleForFree={true}
/>
</>
);
export default Page;
公园
import { ParkJsonLd } from 'next-seo';
const Page = () => (
<>
<h1>Park JSON-LD</h1>
<ParkJsonLd
id="https://www.example.com/park/minnewaska-state-park"
name="Minnewaska State Park"
url="https://www.example.com/park"
telephone="+18452550752"
images={['https://example.com/photos/1x1/photo.jpg']}
address={{
streetAddress: '5281 Route 44-55',
addressLocality: 'Kerhonkson',
addressRegion: 'NY',
postalCode: '12446',
addressCountry: 'US',
}}
description="A wonderful description about Minnewaska State Park"
geo={{
latitude: '41.735149',
longitude: '-74.239037',
}}
openingHours={[
{
opens: '09:00',
closes: '18:00',
dayOfWeek: [
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday',
],
validFrom: '2019-12-23',
validThrough: '2020-04-02',
},
]}
/>
</>
);
export default Page;
必需属性
财产 | 信息 |
---|---|
@id | 以 URL 形式提供特定公园的全局唯一 ID。 |
address | 具体公园位置的地址 |
address.addressCountry | 2 个字母的 ISO 3166-1 alpha-2 国家/地区代码 |
address.addressLocality | 城市 |
address.addressRegion | 省/市/自治区/直辖市/自治区(如适用)。 |
address.postalCode | 邮政编码。 |
address.streetAddress | 街道编号、街道名称和单元号。 |
name | 公园名称。 |
description | 公园描述。 |
支持的属性
财产 | 信息 |
---|---|
geo | 公园的地理坐标。 |
geo.latitude | 公园位置的纬度 |
geo.longitude | 公园位置的经度 |
images | 公园的一张或多张图片。对于有效标记是必需的,具体取决于类型 |
telephone | 企业电话号码是客户的主要联系方式。 |
url | 特定公园的完全限定 URL。 |
openingHours | 公园的开放时间规范。您可以将其作为单个对象提供,也可以将其作为具有以下属性的对象数组提供。 |
openingHours.opens | 地点或服务在一周中给定日期的开放时间。 |
openingHours.closes | 地点或服务在一周中给定日期的关闭时间。 |
openingHours.dayOfWeek | 这些开放时间有效的星期几。可以是字符串或字符串数组。 |
openingHours.validFrom | 项目生效的日期。 |
openingHours.validThrough | 项目无效的日期。 |
isAccessibleForFree | 公园是否免费开放。 |
其他如果使用新的应用目录,则应将其设置为 true。如果在应用目录之外,则不需要。
如需要搜索引擎优化学习资料的小伙伴可以私信我或者扫描下面图片↓↓↓,可以免费领取seo最新面试题和SEO的学习资料同时我们也有相应的学习群可以一起交流学习。