mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-31 09:57:03 +02:00
refactor(v2): convert blog page to be added to routes by plugin lifecycle
This commit is contained in:
parent
74d26d4f3d
commit
7475051526
4 changed files with 37 additions and 64 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue