feat(content-pages): front matter validation, include front matter in metadata (#6400)

This commit is contained in:
Joshua Chen 2022-01-19 20:44:58 +08:00 committed by GitHub
parent e5801e49f6
commit fdf59f30f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 103 additions and 37 deletions

View file

@ -1,2 +1,3 @@
# Index
Markdown index page
Markdown index page

View file

@ -39,11 +39,20 @@ describe('docusaurus-plugin-content-pages', () => {
type: 'mdx',
permalink: '/hello/',
source: path.posix.join('@site', pluginPath, 'hello', 'index.md'),
description: 'Markdown index page',
frontMatter: {},
title: 'Index',
},
{
type: 'mdx',
permalink: '/hello/mdxPage',
source: path.posix.join('@site', pluginPath, 'hello', 'mdxPage.mdx'),
description: 'my mdx page',
title: 'mdx page',
frontMatter: {
description: 'my mdx page',
title: 'mdx page',
},
},
{
type: 'jsx',
@ -64,6 +73,9 @@ describe('docusaurus-plugin-content-pages', () => {
'hello',
'translatedMd.md',
),
description: 'translated markdown page',
frontMatter: {},
title: undefined,
},
{
type: 'jsx',
@ -113,11 +125,20 @@ describe('docusaurus-plugin-content-pages', () => {
type: 'mdx',
permalink: '/hello/',
source: path.posix.join('@site', pluginPath, 'hello', 'index.md'),
description: 'Markdown index page',
frontMatter: {},
title: 'Index',
},
{
type: 'mdx',
permalink: '/hello/mdxPage',
source: path.posix.join('@site', pluginPath, 'hello', 'mdxPage.mdx'),
description: 'my mdx page',
title: 'mdx page',
frontMatter: {
description: 'my mdx page',
title: 'mdx page',
},
},
{
type: 'jsx',
@ -128,6 +149,9 @@ describe('docusaurus-plugin-content-pages', () => {
type: 'mdx',
permalink: '/hello/translatedMd',
source: path.posix.join(frTranslationsPath, 'hello', 'translatedMd.md'),
description: 'translated markdown page (fr)',
frontMatter: {},
title: undefined,
},
{
type: 'jsx',