import React, { Component } from 'react' import PropTypes from 'prop-types' import { graphql } from 'gatsby' import Layout from '../components/Layout' import Sidebar from '../components/Sidebar' export default class DocTemplate extends Component { static propTypes = { data: PropTypes.object.isRequired, location: PropTypes.object.isRequired } render() { const { location } = this.props const post = this.props.data.markdownRemark const { section } = post.fields return (

{post.frontmatter.title}

) } } export const pageQuery = graphql` query DocBySlug($slug: String!) { site { siteMetadata { title } } markdownRemark(fields: { slug: { eq: $slug } }) { id excerpt html frontmatter { title } fields { section } } } `