import React from 'react'; import Helmet from 'react-helmet'; import { graphql } from 'gatsby'; import Layout from '../components/layout'; export const BlogPostTemplate = ({ title, author, date, body, html }) => (

{title}

by {author} on {date}

{body ? body :
}
); const BlogPost = ({ data }) => { const { html, frontmatter } = data.markdownRemark; const { author, title, date, description, meta_description } = frontmatter; const desc = meta_description || description; return ( {title} {desc && } ); }; export default BlogPost; export const pageQuery = graphql` query blogPost($slug: String!) { markdownRemark(fields: { slug: { eq: $slug } }) { frontmatter { title description # meta_description date(formatString: "MMMM D, YYYY") author } html } } `;