schema-gen
Generate valid Schema.org JSON-LD structured data markup for any schema type.
Supported Schema Types
| Type | Key Fields | Google Rich Result |
|---|
| Person | name, jobTitle, url, image, sameAs, worksFor | Yes |
| Organization |
name, url, logo, description, sameAs, foundingDate | Yes |
|
Product | name, description, image, price, availability, brand | Yes |
|
Article | headline, author, datePublished, image, publisher | Yes |
|
FAQ | questions (question + answer pairs) | Yes |
|
HowTo | name, steps (name + text), totalTime | Yes |
|
LocalBusiness | name, address, telephone, openingHours, geo | Yes |
|
Event | name, startDate, location, description, offers | Yes |
|
WebSite | name, url, potentialAction (SearchAction) | Yes (Sitelinks) |
|
BreadcrumbList | items (name + url position pairs) | Yes |
|
VideoObject | name, description, thumbnailUrl, uploadDate, duration | Yes |
|
SoftwareApplication | name, operatingSystem, applicationCategory, offers | Yes |
How to Generate
When asked to generate schema markup:
- 1. Identify which schema type is needed based on the user's request
- Ask for the required fields (or extract from context)
- Generate valid JSON-LD with:
-
@context: always
https://schema.org
-
@type: the schema type name
- All provided fields properly formatted
- 4. Output in a code block with
json syntax highlighting - Wrap in
<script type="application/ld+json"> tags for HTML insertion
Output Format
Always output like this:
CODEBLOCK0
Important Notes
- - Always include INLINECODE5
- Remove empty/null fields from output
- For FAQ schema: each question needs both
@type: "Question" and an acceptedAnswer with INLINECODE8 - For HowTo: each step needs INLINECODE9
- For BreadcrumbList: each item needs
@type: "ListItem" with position (number) - Validate at: https://search.google.com/test/rich-results
- For addresses: use
@type: "PostalAddress" with streetAddress, addressLocality, addressRegion, postalCode, addressCountry - For geo: use
@type: "GeoCoordinates" with latitude, longitude
schema-gen
为任何 schema 类型生成有效的 Schema.org JSON-LD 结构化数据标记。
支持的 Schema 类型
| 类型 | 关键字段 | Google 富搜索结果 |
|---|
| Person | name, jobTitle, url, image, sameAs, worksFor | 是 |
| Organization |
name, url, logo, description, sameAs, foundingDate | 是 |
|
Product | name, description, image, price, availability, brand | 是 |
|
Article | headline, author, datePublished, image, publisher | 是 |
|
FAQ | questions (question + answer 配对) | 是 |
|
HowTo | name, steps (name + text), totalTime | 是 |
|
LocalBusiness | name, address, telephone, openingHours, geo | 是 |
|
Event | name, startDate, location, description, offers | 是 |
|
WebSite | name, url, potentialAction (SearchAction) | 是 (站点链接) |
|
BreadcrumbList | items (name + url position 配对) | 是 |
|
VideoObject | name, description, thumbnailUrl, uploadDate, duration | 是 |
|
SoftwareApplication | name, operatingSystem, applicationCategory, offers | 是 |
如何生成
当被要求生成 schema 标记时:
- 1. 根据用户请求确定所需的 schema 类型
- 询问必填字段(或从上下文中提取)
- 生成有效的 JSON-LD,包含:
- @context:始终为 https://schema.org
- @type:schema 类型名称
- 所有提供的字段格式正确
- 4. 在带有 json 语法高亮的代码块中输出
- 包裹在
重要说明
- - 始终包含 @context: https://schema.org
- 从输出中移除空/空值字段
- 对于 FAQ schema:每个问题都需要 @type: Question 和一个包含 @type: Answer 的 acceptedAnswer
- 对于 HowTo:每个步骤都需要 @type: HowToStep
- 对于 BreadcrumbList:每个项目都需要 @type: ListItem 并包含 position(数字)
- 验证地址:https://search.google.com/test/rich-results
- 对于地址:使用 @type: PostalAddress,包含 streetAddress、addressLocality、addressRegion、postalCode、addressCountry
- 对于地理坐标:使用 @type: GeoCoordinates,包含 latitude、longitude