import * as React from 'react'
import { graphql, PageProps } from 'gatsby'
import Layout from '../components/layout'
import Seo from '../components/seo'
import { Section } from '../components/shared'
import Post from './post'
import { SideBar } from './sidebar'
import type { PostNode, PageContext } from '../types'
const BlogPostTemplate: React.FC<
PageProps<{ post: PostNode }, PageContext>
> = ({ data, location, pageContext }) => {
const { post } = data
return (
)
}
export default BlogPostTemplate
export const Head: React.FC<{ data: { post: PostNode } }> = ({ data }) => {
const { post } = data
const { previewImg } = post.frontmatter
return (
)
}
export const pageQuery = graphql`
query PostByPath($id: String!) {
post: markdownRemark(id: { eq: $id }) {
id
html
fields {
slug
}
frontmatter {
title
description
date(formatString: "MMMM DD, YYYY")
author
authorLink
previewImg {
childImageSharp {
gatsbyImageData(layout: CONSTRAINED)
}
}
tags
}
}
}
`