From fe07329bf9fb80e2eb1af89609ecb299b0bc8ab3 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 7 Mar 2023 21:46:10 +0800 Subject: [PATCH] docs: revise frontmatter docs --- docs/guide/frontmatter.md | 12 ++- docs/reference/default-theme-config.md | 10 +-- docs/reference/default-theme-layout.md | 2 +- docs/reference/frontmatter-config.md | 117 ++++++++----------------- 4 files changed, 51 insertions(+), 90 deletions(-) diff --git a/docs/guide/frontmatter.md b/docs/guide/frontmatter.md index 8c3b04d54ae..e0b15e88733 100644 --- a/docs/guide/frontmatter.md +++ b/docs/guide/frontmatter.md @@ -1,6 +1,8 @@ # Frontmatter -Any Markdown file that contains a YAML frontmatter block will be processed by [gray-matter](https://github.com/jonschlinkert/gray-matter). The frontmatter must be at the top of the Markdown file, and must take the form of valid YAML set between triple-dashed lines. Example: +## Usage + +VitePress supports YAML frontmatter in all Markdown files, parsing them with [gray-matter](https://github.com/jonschlinkert/gray-matter). The frontmatter must be at the top of the Markdown file (before any elements including `