upstream #1
@ -24,7 +24,7 @@ export const PageSeo = ({ title, description }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const BlogSeo = ({ authors = [], title, summary, date, lastmod, url, images = [] }) => {
|
export const BlogSeo = ({ authorDetails, title, summary, date, lastmod, url, images = [] }) => {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const publishedAt = new Date(date).toISOString()
|
const publishedAt = new Date(date).toISOString()
|
||||||
const modifiedAt = new Date(lastmod || date).toISOString()
|
const modifiedAt = new Date(lastmod || date).toISOString()
|
||||||
@ -42,11 +42,10 @@ export const BlogSeo = ({ authors = [], title, summary, date, lastmod, url, imag
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
let authorsArr = authors.length === 0 ? [siteMetadata.author] : authors
|
const authorList = authorDetails.map((author) => {
|
||||||
const authorList = authorsArr.map((author) => {
|
|
||||||
return {
|
return {
|
||||||
'@type': 'Person',
|
'@type': 'Person',
|
||||||
name: author,
|
name: author.name,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -19,7 +19,11 @@ export default function PostLayout({ frontMatter, authorDetails, next, prev, chi
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<SectionContainer>
|
<SectionContainer>
|
||||||
<BlogSeo url={`${siteMetadata.siteUrl}/blog/${slug}`} {...frontMatter} />
|
<BlogSeo
|
||||||
|
url={`${siteMetadata.siteUrl}/blog/${slug}`}
|
||||||
|
authorDetails={authorDetails}
|
||||||
|
{...frontMatter}
|
||||||
|
/>
|
||||||
<article>
|
<article>
|
||||||
<div className="xl:divide-y xl:divide-gray-200 xl:dark:divide-gray-700">
|
<div className="xl:divide-y xl:divide-gray-200 xl:dark:divide-gray-700">
|
||||||
<header className="pt-6 xl:pb-6">
|
<header className="pt-6 xl:pb-6">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user