Files
old-v2-frontend/src/templates/post-default.js

51 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-08-27 15:24:23 +02:00
import React, { Component } from 'react'
import Helmet from 'react-helmet'
import Prism from 'prismjs'
require('prismjs/themes/prism-solarizedlight.css')
class PostDefault extends Component {
componentDidMount() {
Prism.highlightAll()
}
2018-06-25 15:28:50 +02:00
render() {
const { data } = this.props
return (
<div>
<Helmet
title={`${data.wordpressPost.title} - Saburly.com`}
meta={[
{ name: 'description', content: 'We code & design great software' },
2018-08-27 15:24:23 +02:00
{
name: 'keywords',
content:
'software, design, coding, programming, code, consulting',
},
]}
/>
2018-08-27 15:24:23 +02:00
<main className="container mx-auto p-4 sm:p-10">
<h1>Specific Post - {data.wordpressPost.title}</h1>
<h1>Slug - {data.wordpressPost.slug}</h1>
<div
dangerouslySetInnerHTML={{
__html: data.wordpressPost.content,
}}
/>
</main>
2018-06-25 15:28:50 +02:00
</div>
2018-08-27 15:24:23 +02:00
)
2018-06-25 15:28:50 +02:00
}
}
export const query = graphql`
query PostDefaultQuery($slug: String!) {
2018-08-27 15:24:23 +02:00
wordpressPost(slug: { eq: $slug }) {
2018-06-25 15:28:50 +02:00
title
slug
content
}
}
`
2018-08-27 15:24:23 +02:00
export default PostDefault