import React from 'react'
import Helmet from 'react-helmet'
import { graphql } from 'gatsby'
import Layout from '../components/Layout'
import PostImage from '../components/Post/PostImage'
import PostTitle from '../components/Post/PostTitle'
import PostLead from '../components/Post/PostLead'
import PostContent from '../components/Post/PostContent'
import PostActions from '../components/Post/PostActions'
import PostLinkActions from '../components/Post/PostLinkActions'
import SEO from '../components/atoms/SEO'
import PostMeta from '../components/Post/PostMeta'
import Exif from '../components/atoms/Exif'
import RelatedPosts from '../components/molecules/RelatedPosts'
import styles from './Post.module.scss'
export default function Post({
data,
location
}: {
data: any
location: Location
}) {
const { markdownRemark: post } = data
const { title, image, type, linkurl, style, tags } = post.frontmatter
const { slug, githubLink } = post.fields
return (
<>
{style && }
{type === 'post' && }
{type === 'photo' && }
{image && (
)}
{image && image.fields && }
{type !== 'photo' && }
{type === 'link' && }
{type === 'post' && }
>
)
}
export const pageQuery = graphql`
query BlogPostBySlug($slug: String!) {
markdownRemark(fields: { slug: { eq: $slug } }) {
html
excerpt
frontmatter {
type
title
image {
childImageSharp {
...ImageFluid
}
fields {
exif {
iso
model
fstop
shutterspeed
focalLength
exposure
gps {
latitude
longitude
}
}
}
}
author
updated
tags
linkurl
style {
publicURL
}
changelog
}
fields {
slug
date
githubLink
}
rawMarkdownBody
}
}
`