Merge pull request #478 from mlevit/master

frontmatter images can now be external
This commit is contained in:
Timothy 2022-06-13 13:46:19 +08:00 committed by GitHub
commit 315d667c47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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>