{"size": 982, "ext": "js", "max_stars_repo_path": "src/templates/blog-post.js", "max_stars_repo_name": "vUnAmp/vietapp.de", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/templates/blog-post.js", "max_issues_repo_name": "vUnAmp/vietapp.de", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/templates/blog-post.js", "max_forks_repo_name": "vUnAmp/vietapp.de", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.347826087, "max_line_length": 77, "alphanum_fraction": 0.5814663951}
import { graphql, Link } from "gatsby"
import React from "react"
import Layout from "../components/layout"

const BlogPost = ({ location, pageContext, data }) => {
  console.log(location)
  const { nextPostSlug, previousPostSlug } = pageContext
  console.log(data)
  return (
    <Layout className="wrap-post">
      <section
        dangerouslySetInnerHTML={{ __html: data.markdownRemark.html }}
        itemProp="articleBody"
      />
      {nextPostSlug && (
        <Link to={nextPostSlug}>
          <h1>Next post</h1>{" "}
        </Link>
      )}
      {previousPostSlug && <Link to={previousPostSlug}>Previous post </Link>}
    </Layout>
  )
}

export default BlogPost

export const pageQuery = graphql`
  query BlogPost($id: String!) {
    site {
      siteMetadata {
        title
      }
    }
    markdownRemark(id: { eq: $id }) {
      id
      excerpt(pruneLength: 160)
      html
      frontmatter {
        title
        date
        description
      }
    }
  }
`
