mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-13 08:12:48 +02:00
feat(docs,blog,pages): add support for "unlisted" front matter - hide md content in production (#8004)
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
7a023a2c41
commit
683ba3d2a0
131 changed files with 2449 additions and 303 deletions
|
@ -133,8 +133,15 @@ async function createBlogFeedFile({
|
|||
}
|
||||
}
|
||||
|
||||
function shouldBeInFeed(blogPost: BlogPost): boolean {
|
||||
const excluded =
|
||||
blogPost.metadata.frontMatter.draft ||
|
||||
blogPost.metadata.frontMatter.unlisted;
|
||||
return !excluded;
|
||||
}
|
||||
|
||||
export async function createBlogFeedFiles({
|
||||
blogPosts,
|
||||
blogPosts: allBlogPosts,
|
||||
options,
|
||||
siteConfig,
|
||||
outDir,
|
||||
|
@ -146,6 +153,8 @@ export async function createBlogFeedFiles({
|
|||
outDir: string;
|
||||
locale: string;
|
||||
}): Promise<void> {
|
||||
const blogPosts = allBlogPosts.filter(shouldBeInFeed);
|
||||
|
||||
const feed = await generateBlogFeed({
|
||||
blogPosts,
|
||||
options,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue