Fix twitter metadata
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
siteName: 'ThreeFold',
|
siteName: 'ThreeFold',
|
||||||
|
siteUrl: 'https://threefold.io',
|
||||||
pathPrefix: "threefold",
|
pathPrefix: "threefold",
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|
||||||
|
|||||||
@@ -207,6 +207,9 @@
|
|||||||
path
|
path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
metadata {
|
||||||
|
siteUrl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</page-query>
|
</page-query>
|
||||||
|
|
||||||
@@ -242,6 +245,19 @@ export default {
|
|||||||
return image;
|
return image;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
getCoverImage() {
|
||||||
|
let coverImage = "";
|
||||||
|
const cover = this.$page.blog.image;
|
||||||
|
if (cover != null) {
|
||||||
|
coverImage = `${this.getBaseUrl}${this.$page.blog.image.src}`;
|
||||||
|
}
|
||||||
|
return coverImage;
|
||||||
|
},
|
||||||
|
getBaseUrl() {
|
||||||
|
return this.$page.metadata.siteUrl;
|
||||||
|
},
|
||||||
|
},
|
||||||
metaInfo() {
|
metaInfo() {
|
||||||
return {
|
return {
|
||||||
title: "",
|
title: "",
|
||||||
@@ -265,7 +281,7 @@ export default {
|
|||||||
{
|
{
|
||||||
key: "og:image",
|
key: "og:image",
|
||||||
property: "og:image",
|
property: "og:image",
|
||||||
content: this.img(this.$page.blog.image),
|
content: this.getCoverImage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "twitter:description",
|
name: "twitter:description",
|
||||||
@@ -275,7 +291,7 @@ export default {
|
|||||||
{
|
{
|
||||||
name: "twitter:image",
|
name: "twitter:image",
|
||||||
property: "twitter:image",
|
property: "twitter:image",
|
||||||
content: this.img(this.$page.blog.image),
|
content: this.getCoverImage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "twitter:title",
|
name: "twitter:title",
|
||||||
@@ -288,7 +304,6 @@ export default {
|
|||||||
content: "summary_large_image",
|
content: "summary_large_image",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
script: [{ src: "https://platform.twitter.com/widgets.js", async: true }],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -202,9 +202,10 @@
|
|||||||
path
|
path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
metadata {
|
||||||
|
siteUrl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</page-query>
|
</page-query>
|
||||||
|
|
||||||
@@ -246,7 +247,7 @@ export default {
|
|||||||
{
|
{
|
||||||
key: "og:image",
|
key: "og:image",
|
||||||
property: "og:image",
|
property: "og:image",
|
||||||
content: this.$page.news.image.src,
|
content: this.getCoverImage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "twitter:description",
|
key: "twitter:description",
|
||||||
@@ -256,7 +257,7 @@ export default {
|
|||||||
{
|
{
|
||||||
key: "twitter:image",
|
key: "twitter:image",
|
||||||
property: "twitter:image",
|
property: "twitter:image",
|
||||||
content: this.$page.news.image.src,
|
content: this.getCoverImage,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "twitter:title",
|
key: "twitter:title",
|
||||||
@@ -280,5 +281,18 @@ export default {
|
|||||||
this.showAlert = val;
|
this.showAlert = val;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
getCoverImage() {
|
||||||
|
let coverImage = "";
|
||||||
|
const cover = this.$page.news.image;
|
||||||
|
if (cover != null) {
|
||||||
|
coverImage = `${this.getBaseUrl}${this.$page.news.image.src}`;
|
||||||
|
}
|
||||||
|
return coverImage;
|
||||||
|
},
|
||||||
|
getBaseUrl() {
|
||||||
|
return this.$page.metadata.siteUrl;
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user