fix: closes #428 (#431)

This commit is contained in:
Sagnik Pradhan
2021-10-17 07:07:57 +03:00
committed by GitHub
parent 291f30fdb4
commit 52f5390a8f
+6 -4
View File
@@ -8,8 +8,8 @@ import { PageContent } from "../components/PageContent"
// @todo maybe find alternative type for data // @todo maybe find alternative type for data
const Archive: FC<any> = ({ data }) => { const Archive: FC<any> = ({ data }) => {
const { relativePath, ctime } = data.file const { relativePath } = data.file
const { body, excerpt, fields, timeToRead } = data.file.post const { body, excerpt, fields, timeToRead, frontmatter } = data.file.post
const title = humanize(relativePath) const title = humanize(relativePath)
@@ -21,7 +21,7 @@ const Archive: FC<any> = ({ data }) => {
basePath="/archives" basePath="/archives"
title={title} title={title}
authors={fields.authors} authors={fields.authors}
createdAt={ctime} createdAt={frontmatter.created_at}
timeToRead={timeToRead} timeToRead={timeToRead}
shifted={false} shifted={false}
/> />
@@ -36,7 +36,6 @@ export const query = graphql`
query Archive($file: String!) { query Archive($file: String!) {
file(relativePath: { eq: $file }) { file(relativePath: { eq: $file }) {
relativePath relativePath
ctime
post: childMdx { post: childMdx {
body body
excerpt excerpt
@@ -47,6 +46,9 @@ export const query = graphql`
avatar avatar
} }
} }
frontmatter {
created_at
}
timeToRead timeToRead
} }
} }