frontmatter images can now be external

This commit is contained in:
Marat Levit 2022-06-10 00:50:23 +00:00 committed by GitHub
parent d19f8eed7b
commit 26a7cbbedc
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ export const BlogSEO = ({
const featuredImages = imagesArr.map((img) => {
return {
'@type': 'ImageObject',
url: `${siteMetadata.siteUrl}${img}`,
url: img.includes('http') ? img : siteMetadata.siteUrl + img,
}
})

View File

@ -17,7 +17,7 @@ const discussUrl = (slug) =>
const postDateTemplate = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }
export default function PostLayout({ frontMatter, authorDetails, next, prev, children }) {
const { slug, fileName, date, title, tags } = frontMatter
const { slug, fileName, date, title, images, tags } = frontMatter
return (
<SectionContainer>