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:
Jody Heavener 2022-11-03 06:31:41 -07:00 committed by GitHub
parent 7a023a2c41
commit 683ba3d2a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
131 changed files with 2449 additions and 303 deletions

View file

@ -90,6 +90,10 @@ declare module '@docusaurus/plugin-content-blog' {
* Marks the post as draft and excludes it from the production build.
*/
draft?: boolean;
/**
* Marks the post as unlisted and visibly hides it unless directly accessed.
*/
unlisted?: boolean;
/**
* Will override the default publish date inferred from git/filename. Yaml
* only converts standard yyyy-MM-dd format to dates, so this may stay as a
@ -222,6 +226,10 @@ declare module '@docusaurus/plugin-content-blog' {
readonly frontMatter: BlogPostFrontMatter & {[key: string]: unknown};
/** Tags, normalized. */
readonly tags: Tag[];
/**
* Marks the post as unlisted and visibly hides it unless directly accessed.
*/
readonly unlisted: boolean;
};
/**
* @returns The edit URL that's directly plugged into metadata.
@ -407,9 +415,15 @@ declare module '@docusaurus/plugin-content-blog' {
}
>;
export type BlogSidebarItem = {
title: string;
permalink: string;
unlisted: boolean;
};
export type BlogSidebar = {
title: string;
items: {title: string; permalink: string}[];
items: BlogSidebarItem[];
};
export type BlogContent = {
@ -428,6 +442,7 @@ declare module '@docusaurus/plugin-content-blog' {
/** Blog post permalinks. */
items: string[];
pages: BlogPaginated[];
unlisted: boolean;
};
export type BlogPost = {