Frontmatter 包含页面的元数据,例如 title。它以 YAML 格式编写,位于页面顶部的 --- 之间。
例如:
---
title: Create a Cloudflare Tunnel
pcx_content_type: how-to
products:
- cloudflare-tunnel
description: Set the required and optional frontmatter fields that carry a page's metadata, such as title, description, and pcx_content_type.
sidebar:
order: 2
---有关可用字段的更多信息,请参阅 Nimbus 文档 ↗。
每个带有 pcx_content_type 的页面必须包含:
| 字段 | 描述 |
|---|---|
title |
页面标题。纯文本。 |
pcx_content_type |
页面的内容类型。请参阅内容类型。 |
description |
用于 <meta name="description"> 标签的 1-2 句摘要。请参阅编写描述。 |
description 字段会填充 HTML 头部中的 <meta name="description"> 标签。对于搜索引擎、AI 爬虫和 llms.txt 消费者在决定是否展示或引用某个页面时,这是唯一且最重要的元数据字段。
一个优秀的描述:
- 由 1-2 句独立完整的句子组成(目标字数为 50-160 个字符/汉字)。
- 指明产品或功能名称。
- 说明该页面如何帮助读者操作或理解。
- 从页面中提取出来时,可以作为一个独立的答案片段。
不要以诸如 “This page describes...”(本页描述了...)、“Learn more about...”(了解更多关于...)或 “This document explains...”(本文档解释了...)之类的通用开头词起笔。这些会浪费最宝贵的元数据空间,且没有增加任何实质性信息。
现有的 summary 字段对于页面上的体验仍然有用,但对于 AI 和搜索目的而言,它是次于 description 的。
description: Set the required and optional frontmatter fields that carry a page's metadata, such as title, description, and pcx_content_type.description: Set the required and optional frontmatter fields that carry a page's metadata, such as title, description, and pcx_content_type.description: Set the required and optional frontmatter fields that carry a page's metadata, such as title, description, and pcx_content_type.description: Set the required and optional frontmatter fields that carry a page's metadata, such as title, description, and pcx_content_type.有关 sidebar、tags、products、difficulty 和 reviewed 等可选字段,请参阅自定义属性。
有关可用字段的更多信息,请参阅 Nimbus 文档 ↗。