refactor(v2): convert blog page to be added to routes by plugin lifecycle

This commit is contained in:
Yangshun Tay 2019-03-03 22:14:16 -08:00
parent 74d26d4f3d
commit 7475051526
4 changed files with 37 additions and 64 deletions

View file

@ -88,6 +88,9 @@ class BlogPost extends React.Component {
const {metadata = {}, siteConfig = {}} = this.context;
const {baseUrl, favicon} = siteConfig;
const {language, title} = metadata;
const {modules} = this.props;
const BlogPostContents = modules[0];
return (
<Layout>
<Head defaultTitle={siteConfig.title}>
@ -96,7 +99,7 @@ class BlogPost extends React.Component {
{language && <html lang={language} />}
</Head>
{this.renderPostHeader()}
{this.props.children}
<BlogPostContents />
</Layout>
);
}