Yoast SEO 开发者文档

title: "Howto" post_status: publish comment_status: open taxonomy: category: - yoast-developer post_tag: - Pieces - Schema - Features


import YoastSchemaExample from '../../../../src/components/YoastSchemaExample';

描述一个包含一系列 stepsHowTo 指南。

触发条件

当页面内容包含 HowTo 区块 时,应将其作为顶级节点添加到图谱中。

必需属性

有效的 HowTo 必须包含以下属性。

故障场景

如果 HowTostep 的任何必填字段缺失或无效,则不应输出该节点。

如果未输出某个节点,则任何原本会声明与其存在关系的实体都应移除这些引用。

可选属性

以下属性应在可用且有效时添加:

条件属性

当页面包含有效的 Article

当 HowToStep 包含一个或多个图像时

HowToStep 具有名称和描述时

HowToStepnamedescription 中没有文本时

HowToStepdescription 但没有 name

Examples

Minimum criteria

{{ "@context": "https://schema.org", "@graph": [ { "@type": "HowTo", "@id": "https://www.example.com/#/schema/HowTo/abc123", "mainEntityOfPage": { "@id": "https://www.example.com/example-page/" }, "name": "HowTo example", "step": [ { "@type": "HowToStep", "@id": "https://www.example.com/#/schema/HowToStep/abc123", "name": "Example step 1", "url": "https://www.example.com/example-page/#how-to-step-1", "itemListElement": [ { "@type": "HowToDirection", "text": "The step description." } ] }, { "@type": "HowToStep", "text": "Example step 2 (no description)", "url": "https://www.example.com/example-page/#how-to-step-2" } ] } ] }}

Extended criteria

{{ "@context": "https://schema.org", "@graph": [ { "@type": "HowTo", "@id": "https://www.example.com/#/schema/HowTo/abc123", "mainEntityOfPage": { "@id": "https://www.example.com/#/schema/Article/abc123" }, "name": "HowTo example", "description": "HowTo description", "inLanguage": "en-US", "totalTime": "P2DT0H0M", "step": [ { "@type": "HowToStep", "@id": "https://www.example.com/#/schema/HowToStep/abc123", "name": "Example step 1", "url": "https://www.example.com/example-page/#how-to-step-1", "image": { "@id": "https://www.example.com/uploads/example-image.jpg" }, "itemListElement": [ { "@type": "HowToDirection", "text": "The step description." } ] }, { "@type": "HowToStep", "@id": "https://www.example.com/#/schema/HowToStep/def456", "text": "Example step 2 (no description)", "url": "https://www.example.com/example-page/#how-to-step-2", "image": { "@id": "https://www.example.com/uploads/example-image-2.jpg" } }, { "@type": "HowToStep", "@id": "https://www.example.com/#/schema/HowToStep/ghi789", "name": "Example step 3", "url": "https://www.example.com/example-page/#how-to-step-3", "itemListElement": [ { "@type": "HowToDirection", "text": "The first paragrah in the step description." }, { "@type": "HowToDirection", "text": "The second paragrah in the step description." } ] } ] } ] }}