feat: Implement mdx

This commit is contained in:
dfireBird
2020-08-08 16:47:43 +05:30
parent 7e3565e78a
commit abf609d09f
14 changed files with 1735 additions and 1448 deletions
+4 -4
View File
@@ -9,7 +9,7 @@ import { PageContent } from "../components/PageContent"
// @todo maybe find alternative type for data
const Archive: FC<any> = ({ data }) => {
const { relativePath, ctime } = data.file
const { html, excerpt, timeToRead } = data.file.post
const { body, excerpt, timeToRead } = data.file.post
const title = humanize(relativePath)
@@ -24,7 +24,7 @@ const Archive: FC<any> = ({ data }) => {
timeToRead={timeToRead}
shifted={false}
/>
<PageContent content={<Markdown content={html} />} />
<PageContent content={<Markdown content={body} />} />
</Fragment>
)
}
@@ -36,8 +36,8 @@ export const query = graphql`
file(relativePath: { eq: $file }) {
relativePath
ctime
post: childMarkdownRemark {
html
post: childMdx {
body
excerpt
timeToRead
}