feat(content-docs): draft docs excluded from build & sidebars (#6457)

Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
Jody Heavener 2022-04-13 13:02:05 -03:00 committed by GitHub
parent ee4c984bc7
commit 5fb0a2e274
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 396 additions and 58 deletions

View file

@ -346,6 +346,8 @@ declare module '@docusaurus/plugin-content-docs' {
* @see {@link DocMetadata.prev}
*/
pagination_prev?: string | null;
/** Should this doc be excluded from production builds? */
draft?: boolean;
};
export type LastUpdateData = {
@ -390,6 +392,10 @@ declare module '@docusaurus/plugin-content-docs' {
slug: string;
/** Full URL to this doc, with base URL and version path. */
permalink: string;
/**
* Draft docs will be excluded for production environment.
*/
draft: boolean;
/**
* Position in an autogenerated sidebar slice, acquired through front matter
* or number prefix.
@ -597,6 +603,8 @@ declare module '@docusaurus/plugin-content-docs/client' {
/** The doc with `slug: /`, or first doc in first sidebar */
mainDocId: string;
docs: GlobalDoc[];
/** Unversioned IDs. In development, this list is empty. */
draftIds: string[];
sidebars?: {[sidebarId: string]: GlobalSidebar};
};