upstream #1
@ -24,7 +24,7 @@ export const PageSeo = ({ title, description }) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const BlogSeo = ({ title, summary, date, lastmod, url, images = [] }) => {
|
export const BlogSeo = ({ authors = [], 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,6 +42,14 @@ export const BlogSeo = ({ title, summary, date, lastmod, url, images = [] }) =>
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let authorsArr = authors.length === 0 ? [siteMetadata.author] : authors
|
||||||
|
const authorList = authorsArr.map((author) => {
|
||||||
|
return {
|
||||||
|
'@type': 'Person',
|
||||||
|
name: author,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const structuredData = {
|
const structuredData = {
|
||||||
'@context': 'https://schema.org',
|
'@context': 'https://schema.org',
|
||||||
'@type': 'Article',
|
'@type': 'Article',
|
||||||
@ -53,10 +61,7 @@ export const BlogSeo = ({ title, summary, date, lastmod, url, images = [] }) =>
|
|||||||
image: featuredImages,
|
image: featuredImages,
|
||||||
datePublished: publishedAt,
|
datePublished: publishedAt,
|
||||||
dateModified: modifiedAt,
|
dateModified: modifiedAt,
|
||||||
author: {
|
author: authorList,
|
||||||
'@type': 'Person',
|
|
||||||
name: siteMetadata.author,
|
|
||||||
},
|
|
||||||
publisher: {
|
publisher: {
|
||||||
'@type': 'Organization',
|
'@type': 'Organization',
|
||||||
name: siteMetadata.author,
|
name: siteMetadata.author,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user