Creating latest posts pages and not pages dynamically for now

This commit is contained in:
Moris Zen
2018-06-27 10:35:17 +02:00
parent 7a67da8bb6
commit 8dc66673d0
2 changed files with 10 additions and 12 deletions

28
src/pages/post-default.js Normal file
View File

@@ -0,0 +1,28 @@
import React, { Component } from 'react';
class PostDefault extends Component {
render() {
const { data } = this.props
return (
<div>
<h1>Specific Post - {data.wordpressPost.title}</h1>
<div dangerouslySetInnerHTML={{
__html: data.wordpressPost.content
}}
/>
</div>
);
}
}
export const query = graphql`
query PostDefaultQuery($slug: String!) {
wordpressPost(slug: {eq: $slug}) {
title
slug
content
}
}
`
export default PostDefault;