mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-19 11:12:36 +02:00
feat: siteConfig.markdown.parseFrontMatter hook (#9624)
This commit is contained in:
parent
28e7298211
commit
affca7a9a2
27 changed files with 486 additions and 133 deletions
|
@ -19,7 +19,7 @@ import {
|
|||
createAbsoluteFilePathMatcher,
|
||||
normalizeUrl,
|
||||
DEFAULT_PLUGIN_ID,
|
||||
parseMarkdownString,
|
||||
parseMarkdownFile,
|
||||
isUnlisted,
|
||||
isDraft,
|
||||
} from '@docusaurus/utils';
|
||||
|
@ -113,7 +113,11 @@ export default function pluginContentPages(
|
|||
frontMatter: unsafeFrontMatter,
|
||||
contentTitle,
|
||||
excerpt,
|
||||
} = parseMarkdownString(content);
|
||||
} = await parseMarkdownFile({
|
||||
filePath: source,
|
||||
fileContent: content,
|
||||
parseFrontMatter: siteConfig.markdown.parseFrontMatter,
|
||||
});
|
||||
const frontMatter = validatePageFrontMatter(unsafeFrontMatter);
|
||||
|
||||
if (isDraft({frontMatter})) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue