feat: bootstrap resource header

This commit is contained in:
Jean-Philippe Sirois
2019-07-30 08:44:02 -04:00
parent 49ea33049f
commit 75a53a4919
5 changed files with 144 additions and 17 deletions
+12 -2
View File
@@ -3,14 +3,22 @@ import { graphql } from "gatsby"
import { Markdown } from "../components/Markdown"
import { SEO } from "../components/SEO"
import { ResourcesLayout } from "../components/ResourcesLayout"
import { ResourceHeader } from "../components/ResourceHeader"
// @todo maybe find alternative type for data
function LanguagePost({ data }: any) {
const { html, frontmatter } = data.file.post
const { html, fields, frontmatter, timeToRead } = data.file.post
console.log(data)
return (
<ResourcesLayout>
<SEO title={frontmatter.title} />
<ResourceHeader
title={frontmatter.title}
authors={fields.authors}
createdAt={frontmatter.created_at}
timeToRead={timeToRead}
recommendedReading={frontmatter.recommended_reading}
/>
<Markdown content={html} />
</ResourcesLayout>
)
@@ -31,9 +39,11 @@ export const query = graphql`
}
}
frontmatter {
date
created_at
title
recommended_reading
}
timeToRead
}
}
}