added authors to archive (tech spotlight) templates (#424)

Co-authored-by: Xetera <[email protected]>
This commit is contained in:
Joel Lau
2021-10-03 01:12:23 +03:00
committed by GitHub
co-authored by Xetera
parent 2bbccddf08
commit c08406a708
+9 -1
View File
@@ -9,7 +9,7 @@ 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, ctime } = data.file
const { body, excerpt, timeToRead } = data.file.post const { body, excerpt, fields, timeToRead } = data.file.post
const title = humanize(relativePath) const title = humanize(relativePath)
@@ -20,6 +20,7 @@ const Archive: FC<any> = ({ data }) => {
relativePath={relativePath} relativePath={relativePath}
basePath="/archives" basePath="/archives"
title={title} title={title}
authors={fields.authors}
createdAt={ctime} createdAt={ctime}
timeToRead={timeToRead} timeToRead={timeToRead}
shifted={false} shifted={false}
@@ -39,6 +40,13 @@ export const query = graphql`
post: childMdx { post: childMdx {
body body
excerpt excerpt
fields {
authors {
name
hash
avatar
}
}
timeToRead timeToRead
} }
} }