mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-30 09:27:04 +02:00
feat & refactor: webpack-serve-waitpage and lint
This commit is contained in:
parent
82be417197
commit
d9a86a54c1
9 changed files with 75 additions and 54 deletions
|
@ -1,13 +1,13 @@
|
|||
import React from '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;
|
||||
import React from '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;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import {render} from 'react-dom';
|
||||
import {BrowserRouter, Route, Switch, Link} from 'react-router-dom';
|
||||
import BlogPost from './blogPost';
|
||||
import blogDatas from '@generated/blogDatas';
|
||||
import BlogPost from './blogPost';
|
||||
|
||||
class App extends React.Component {
|
||||
render() {
|
||||
|
@ -15,13 +15,11 @@ class App extends React.Component {
|
|||
))}
|
||||
</Switch>
|
||||
<div>
|
||||
{blogDatas.map(({path}) => {
|
||||
return (
|
||||
<div key={path}>
|
||||
<Link to={path}>{path}</Link>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
{blogDatas.map(({path}) => (
|
||||
<div key={path}>
|
||||
<Link to={path}>{path}</Link>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</BrowserRouter>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue