refactor(theme-classic): use front matter from metadata for BlogPostPage (#6240)

This commit is contained in:
Joshua Chen 2022-01-06 01:55:04 +08:00 committed by GitHub
parent 8fe1ddf46a
commit b0c23275f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,14 +16,17 @@ import TOC from '@theme/TOC';
function BlogPostPage(props: Props): JSX.Element {
const {content: BlogPostContents, sidebar} = props;
const {assets, metadata} = BlogPostContents;
const {
// TODO this frontmatter is not validated/normalized, it's the raw user-provided one. We should expose normalized one too!
title,
description,
nextItem,
prevItem,
date,
tags,
authors,
frontMatter,
assets,
metadata,
} = BlogPostContents;
const {title, description, nextItem, prevItem, date, tags, authors} =
metadata;
} = metadata;
const {
hide_table_of_contents: hideTableOfContents,
keywords,