1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-10 18:02:51 +00:00

fixed html in preview

This commit is contained in:
2016-09-02 18:19:28 +00:00
parent 00d50fea7a
commit 6bf367f9be
4 changed files with 5 additions and 7 deletions

View File

@@ -13,8 +13,7 @@ export default class Preview extends React.Component {
<div class="date">
{posts[i].date}
</div>
<h1 class="intro" >{posts[i].title.toString()}</h1>
<p>{posts[i].intro.toString()}</p>
<div dangerouslySetInnerHTML={{__html : posts[i].title.toString() + posts[i].intro.toString()}} />
<p>
<Link class="link" to={`/post/${posts[i].category}/${posts[i].filename}`}>
continue reading <i class="fa fa-caret-right" aria-hidden="true"></i>

View File

@@ -23,7 +23,6 @@ export default class Index extends React.Component {
this.page === 'post' ? this.props.actions.fetchPost(this.props.params.category, this.props.params.post) : "";
}
componentWillReceiveProps(nextProps) {
if (this.props.params !== nextProps.params) {
const params = nextProps.params;
@@ -58,6 +57,6 @@ export default class Index extends React.Component {
}
}
const loadingElement = <div class="Loading">
const loadingElement = <div class="Loading">
<img src={loading} alt="loading..."/>
</div>;

View File

@@ -40,8 +40,8 @@ function parse_dir(dir, folder_name){
filename: post.slice(0, post.length - 3),
category: folder_name,
date: post.slice(0, 10),
title: tokens[0].text,
intro: tokens[1].text
title: `<h1>${tokens[0].text}</h1>`,
intro: marked(tokens[1].text)
}
json.posts.push(temp);
}

View File

@@ -9,7 +9,7 @@
"check_gzip_size": "gzip -9 -c ./public/client.min.js | wc -c | numfmt --to=iec-i --suffix=B --padding=10",
"deploy" : "npm run get_dependencies && npm run prod && ./mywebsite",
"dev": "webpack-dev-server --content-base public --inline --hot --history-api-fallback",
"get_dependencies": "npm install & go get ./server",
"get_dependencies": "go get ./server && npm install",
"prod": "export NODE_ENV=production && webpack -p && babel-node metadata.js && go build ./server/mywebsite.go",
"prod-win": "set NODE_ENV=production && webpack -p && babel-node metadata.js && go build ./server/mywebsite.go"
},