Skip to content

Commit

Permalink
expose frontmatter globally
Browse files Browse the repository at this point in the history
  • Loading branch information
kaytwo authored Mar 22, 2021
1 parent 7834948 commit ff408e1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-content-docs/src/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,6 @@ export function processDocMetadata({
)
: undefined,
sidebar_label: sidebarLabel,
frontMatter,
};
}
1 change: 1 addition & 0 deletions packages/docusaurus-plugin-content-docs/src/globalData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function toGlobalDataDoc(doc: DocMetadata): GlobalDoc {
id: doc.unversionedId,
path: doc.permalink,
sidebar: doc.sidebar,
frontMatter: doc.frontMatter,
};
}

Expand Down
2 changes: 2 additions & 0 deletions packages/docusaurus-plugin-content-docs/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export type DocMetadataBase = LastUpdateData & {
// eslint-disable-next-line camelcase
sidebar_label?: string;
editUrl?: string | null;
frontMatter?: object;
};

export type DocNavLink = {
Expand Down Expand Up @@ -174,6 +175,7 @@ export type GlobalDoc = {
id: string;
path: string;
sidebar: string | undefined;
frontMatter?: object;
};

export type GlobalVersion = {
Expand Down

0 comments on commit ff408e1

Please sign in to comment.