update images meta
This commit is contained in:
parent
2de139030f
commit
18fd946172
@ -97,7 +97,7 @@ tags (required, can be empty array)
|
||||
lastmod (optional)
|
||||
draft (optional)
|
||||
summary (optional)
|
||||
images (optional, adds to socialBanner in siteMetadata config)
|
||||
images (optional, if none provided defaults to socialBanner in siteMetadata config)
|
||||
```
|
||||
|
||||
Here's an example of a post's frontmatter:
|
||||
|
@ -51,9 +51,11 @@ export const BlogSeo = ({ title, summary, date, lastmod, url, tags, images = []
|
||||
const publishedAt = new Date(date).toISOString()
|
||||
const modifiedAt = new Date(lastmod || date).toISOString()
|
||||
let imagesArr =
|
||||
typeof images === 'string'
|
||||
? [images, siteMetadata.socialBanner]
|
||||
: [...images, siteMetadata.socialBanner]
|
||||
images.length === 0
|
||||
? [siteMetadata.socialBanner]
|
||||
: typeof images === 'string'
|
||||
? images
|
||||
: [images]
|
||||
|
||||
const featuredImages = imagesArr.map((img) => {
|
||||
return {
|
||||
|
@ -105,7 +105,7 @@ tags (required, can be empty array)
|
||||
lastmod (optional)
|
||||
draft (optional)
|
||||
summary (optional)
|
||||
images (optional, adds to socialBanner in siteMetadata config)
|
||||
images (optional, if none provided defaults to socialBanner in siteMetadata config)
|
||||
```
|
||||
|
||||
Here's an example of a post's frontmatter:
|
||||
|
Loading…
x
Reference in New Issue
Block a user