Add metadata

This commit is contained in:
samaradel
2021-04-19 14:03:09 +02:00
parent 2430ceb0a4
commit 70050dbcac
11 changed files with 352 additions and 15 deletions

View File

@@ -65,6 +65,10 @@ query($page: Int){
}
}
}
markdownPage(id: "home") {
id
metaImg
}
topics: allNewsTag(filter: { title: {in: ["blockchain", "experience", "technology", "farming", "community", "infrastructure", "impact"]}}) {
edges{
@@ -115,8 +119,48 @@ export default {
};
},
metaInfo: {
title: "Newsroom",
metaInfo() {
return {
title: "",
titleTemplate: "ThreeFold | News",
meta: [
{
key: "description",
name: "description",
content: "Updates and announcements from the ThreeFold Foundation.",
},
{
key: "og:title",
property: "og:title",
content: "ThreeFold | News",
},
{
key: "og:description",
property: "og:description",
content: "Updates and announcements from the ThreeFold Foundation.",
},
{
key: "og:image",
property: "og:image",
content: this.getImg,
},
{
key: "twitter:description",
name: "twitter:description",
content: "Updates and announcements from the ThreeFold Foundation.",
},
{
key: "twitter:image",
property: "twitter:image",
content: this.getImg,
},
{
key: "twitter:title",
property: "twitter:title",
content: "ThreeFold | News",
},
],
};
},
components: {
PostListItem,
@@ -255,6 +299,13 @@ export default {
return window.innerHeight - 570;
}
},
getImg() {
let img = "";
if (process.isClient) {
img = `${window.location.origin}${this.$page.markdownPage.metaImg.src}`;
}
return img;
},
},
};
</script>