diff --git a/src/templates/archive.tsx b/src/templates/archive.tsx index 02e061d..6c40ddf 100644 --- a/src/templates/archive.tsx +++ b/src/templates/archive.tsx @@ -8,8 +8,8 @@ import { PageContent } from "../components/PageContent" // @todo maybe find alternative type for data const Archive: FC = ({ data }) => { - const { relativePath, ctime } = data.file - const { body, excerpt, fields, timeToRead } = data.file.post + const { relativePath } = data.file + const { body, excerpt, fields, timeToRead, frontmatter } = data.file.post const title = humanize(relativePath) @@ -21,7 +21,7 @@ const Archive: FC = ({ data }) => { basePath="/archives" title={title} authors={fields.authors} - createdAt={ctime} + createdAt={frontmatter.created_at} timeToRead={timeToRead} shifted={false} /> @@ -36,7 +36,6 @@ export const query = graphql` query Archive($file: String!) { file(relativePath: { eq: $file }) { relativePath - ctime post: childMdx { body excerpt @@ -47,6 +46,9 @@ export const query = graphql` avatar } } + frontmatter { + created_at + } timeToRead } }