Skip to content

Commit

Permalink
move to frontmatter
Browse files Browse the repository at this point in the history
  • Loading branch information
endiliey committed Nov 19, 2019
1 parent a902648 commit 5614e25
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
5 changes: 0 additions & 5 deletions packages/docusaurus-plugin-content-docs/src/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ export default async function processMetadata({
delete metadata.custom_edit_url;
}

if (metadata.hide_table_of_contents) {
metadata.hideTableOfContents = Boolean(metadata.hide_table_of_contents);
delete metadata.hide_table_of_contents;
}

if (showLastUpdateAuthor || showLastUpdateTime) {
// Use fake data in dev for faster development
const fileLastUpdateData =
Expand Down
2 changes: 0 additions & 2 deletions packages/docusaurus-plugin-content-docs/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ export interface MetadataRaw extends OrderMetadata {
editUrl?: string;
lastUpdatedAt?: number;
lastUpdatedBy?: string;
hide_title?: boolean;
hide_table_of_contents?: boolean;
[key: string]: any;
}

Expand Down
9 changes: 7 additions & 2 deletions packages/docusaurus-theme-classic/src/theme/DocItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@ function DocItem(props) {
lastUpdatedAt,
lastUpdatedBy,
keywords,
hideTableOfContents,
} = metadata;
const {
frontMatter: {
hide_title: hideTitle,
hide_table_of_contents: hideTableOfContents,
},
} = DocContent;

const metaImageUrl = siteUrl + useBaseUrl(metaImage);

Expand Down Expand Up @@ -91,7 +96,7 @@ function DocItem(props) {
<div className="col">
<div className={styles.docItemContainer}>
<article>
{!metadata.hide_title && (
{!hideTitle && (
<header>
<h1 className={styles.docTitle}>{metadata.title}</h1>
</header>
Expand Down

0 comments on commit 5614e25

Please sign in to comment.