text: import React from 'react'
  
  const PostPage = props => {
    const { data } = props
    if (!data) return null
    return (
      <div>
        <span>{data.markdownRemark.frontmatter.date}</span>
        <h1>{data.markdownRemark.frontmatter.title}</h1>
        <div dangerouslySetInnerHTML={{ __html: data.markdownRemark.html }} />
      </div>
    )
  }
  
  export default PostPage
  
  export const query = graphql`
    query BlogPostQuery($slug: String!) {
      markdownRemark(fields: { slug: { eq: $slug } }) {
        excerpt
        html
        frontmatter {
          title
          date(formatString: "DD MMMM YYYY")
        }
      }
    }
  `
  