mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 09:07:29 +02:00
feat: prototype blog post generation in dev server
This commit is contained in:
parent
8cbd23d690
commit
7ecd4c9bef
9 changed files with 112 additions and 31 deletions
13
lib/core/blogPost.js
Normal file
13
lib/core/blogPost.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
const React = require('react');
|
||||
import blogDatas from '@generated/blogDatas';
|
||||
|
||||
// inner blog component for the article itself, without sidebar/header/footer
|
||||
class BlogPost extends React.Component {
|
||||
render() {
|
||||
const {match} = this.props;
|
||||
const post = blogDatas.find(blog => blog.path === match.path);
|
||||
return <div className="post">{post && post.content}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = BlogPost;
|
Loading…
Add table
Add a link
Reference in a new issue