Skip to content

Commit

Permalink
Merge pull request #245 from mmmnmnm/#243-og-image-fix
Browse files Browse the repository at this point in the history
#243 og-image connect
  • Loading branch information
baxgas authored Feb 25, 2022
2 parents 3f8da2b + 0e0ba69 commit 1bd768b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/pages/news/_slug.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default {
{
hid: 'og:image',
property: 'og:image',
content: this.metaImage
content: this.metaOgImage
}
]
}
Expand All @@ -67,6 +67,13 @@ export default {
}
const shortenMeta = this.stripHTMLTags(this.selectedNews?.excerpt?.rendered)
return this.truncate(shortenMeta, 150)
},
metaOgImage () {
if (!this.selectedNews) {
return this.metaImage
}
const metaImageACF = this.selectedNews?.acf?.ogimage
return metaImageACF || this.metaImage
}
},
methods: {
Expand Down

0 comments on commit 1bd768b

Please sign in to comment.