Add about page
This commit is contained in:
parent
9ab288daee
commit
65a5822926
3 changed files with 28 additions and 7 deletions
|
@ -1,11 +1,26 @@
|
||||||
import React from 'react'
|
import React from 'react';
|
||||||
|
import ReactMarkdown from 'react-markdown';
|
||||||
|
import AboutMarkdown from '../static/about.md';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
const About () => {
|
class About extends React.Component {
|
||||||
return (
|
constructor () {
|
||||||
<div className="container">
|
super();
|
||||||
<h4 className="center">About</h4>
|
this.state = { about: '' };
|
||||||
</div>
|
}
|
||||||
)
|
|
||||||
|
componentWillMount() {
|
||||||
|
fetch(AboutMarkdown).then(res => res.text()).then(text => this.setState({ markdown: text }));
|
||||||
|
}
|
||||||
|
|
||||||
|
render () {
|
||||||
|
const { markdown } = this.state;
|
||||||
|
return (
|
||||||
|
<div className="content">
|
||||||
|
<ReactMarkdown source={markdown }/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default About;
|
export default About;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import NavBar from './NavBar';
|
||||||
import PostList from './PostList';
|
import PostList from './PostList';
|
||||||
import Post from './Post';
|
import Post from './Post';
|
||||||
import User from './User';
|
import User from './User';
|
||||||
|
import About from './About'
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
|
@ -12,6 +13,7 @@ function App() {
|
||||||
<NavBar/>
|
<NavBar/>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route exact path="/" component={PostList}/>
|
<Route exact path="/" component={PostList}/>
|
||||||
|
<Route exact path="/about/" component={About}/>
|
||||||
<Route exact path="/posts/" component={PostList}/>
|
<Route exact path="/posts/" component={PostList}/>
|
||||||
<Route path="/posts/:slug" component={Post}/>
|
<Route path="/posts/:slug" component={Post}/>
|
||||||
<Route path="/users/:user" component={User}/>
|
<Route path="/users/:user" component={User}/>
|
||||||
|
|
4
src/static/about.md
Normal file
4
src/static/about.md
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Welcome to SudoScientist!
|
||||||
|
This is Asara, and this is my personal blog.
|
||||||
|
|
||||||
|
It will primarily post about technology, personal projects, and other sudo-scientific and sudo-philosophical ramblings.
|
Reference in a new issue