Update twitter metadata

This commit is contained in:
samaradel
2021-08-05 11:27:37 +02:00
parent 0d8163aa38
commit 41c37e21b4
2 changed files with 22 additions and 5 deletions

View File

@@ -236,6 +236,11 @@ export default {
linkCopied(val) {
this.showAlert = val;
},
img(image) {
if (!image) return "";
if (image.src) return image.src;
return image;
},
},
metaInfo() {
return {
@@ -260,7 +265,7 @@ export default {
{
key: "og:image",
property: "og:image",
content: this.$page.blog.image.src,
content: this.img(this.$page.blog.image),
},
{
key: "twitter:description",
@@ -270,7 +275,7 @@ export default {
{
key: "twitter:image",
property: "twitter:image",
content: this.$page.blog.image.src,
content: this.img(this.$page.blog.image),
},
{
key: "twitter:title",
@@ -280,7 +285,7 @@ export default {
{
key: "twitter:card",
name: "twitter:card",
content: this.$page.blog.image.src,
content: this.$page.blog.excerpt,
},
],
};