Upgrade to 1.0-alpha16

This commit is contained in:
Kyle Mathews 2017-05-26 10:46:52 +01:00
parent 11e1d019cb
commit 4f47229cb6
4 changed files with 38 additions and 36 deletions

View file

@ -0,0 +1,59 @@
import React from "react"
import Helmet from "react-helmet"
import Link from "gatsby-link"
import get from "lodash/get"
import Bio from "../components/Bio"
import { rhythm, scale } from "../utils/typography"
class BlogPostTemplate extends React.Component {
render() {
const post = this.props.data.markdownRemark
const siteTitle = get(this.props, "data.site.siteMetadata.title")
return (
<div>
<Helmet title={`${post.frontmatter.title} | ${siteTitle}`} />
<h1>{post.frontmatter.title}</h1>
<p
style={{
...scale(-1 / 5),
display: "block",
marginBottom: rhythm(1),
marginTop: rhythm(-1),
}}
>
{post.frontmatter.date}
</p>
<div dangerouslySetInnerHTML={{ __html: post.html }} />
<hr
style={{
marginBottom: rhythm(1),
}}
/>
<Bio />
</div>
)
}
}
export default BlogPostTemplate
export const pageQuery = graphql`
query BlogPostByPath($slug: String!) {
site {
siteMetadata {
title
author
}
}
markdownRemark(fields: { slug: { eq: $slug }}) {
id
html
frontmatter {
title
date(formatString: "MMMM DD, YYYY")
}
}
}
`