feat: prototype blog post generation in dev server

This commit is contained in:
endiliey 2018-07-30 01:35:35 +08:00
parent 8cbd23d690
commit 7ecd4c9bef
9 changed files with 112 additions and 31 deletions

13
lib/core/blogPost.js Normal file
View 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;