Update twitter metadata
This commit is contained in:
@@ -236,6 +236,11 @@ export default {
|
|||||||
linkCopied(val) {
|
linkCopied(val) {
|
||||||
this.showAlert = val;
|
this.showAlert = val;
|
||||||
},
|
},
|
||||||
|
img(image) {
|
||||||
|
if (!image) return "";
|
||||||
|
if (image.src) return image.src;
|
||||||
|
return image;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
metaInfo() {
|
metaInfo() {
|
||||||
return {
|
return {
|
||||||
@@ -260,7 +265,7 @@ export default {
|
|||||||
{
|
{
|
||||||
key: "og:image",
|
key: "og:image",
|
||||||
property: "og:image",
|
property: "og:image",
|
||||||
content: this.$page.blog.image.src,
|
content: this.img(this.$page.blog.image),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "twitter:description",
|
key: "twitter:description",
|
||||||
@@ -270,7 +275,7 @@ export default {
|
|||||||
{
|
{
|
||||||
key: "twitter:image",
|
key: "twitter:image",
|
||||||
property: "twitter:image",
|
property: "twitter:image",
|
||||||
content: this.$page.blog.image.src,
|
content: this.img(this.$page.blog.image),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "twitter:title",
|
key: "twitter:title",
|
||||||
@@ -280,7 +285,7 @@ export default {
|
|||||||
{
|
{
|
||||||
key: "twitter:card",
|
key: "twitter:card",
|
||||||
name: "twitter:card",
|
name: "twitter:card",
|
||||||
content: this.$page.blog.image.src,
|
content: this.$page.blog.excerpt,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -222,6 +222,13 @@ export default {
|
|||||||
return pluralize("post", this.$page.project.belongsTo.totalCount);
|
return pluralize("post", this.$page.project.belongsTo.totalCount);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
img(image) {
|
||||||
|
if (!image) return "";
|
||||||
|
if (image.src) return image.src;
|
||||||
|
return image;
|
||||||
|
},
|
||||||
|
},
|
||||||
metaInfo() {
|
metaInfo() {
|
||||||
return {
|
return {
|
||||||
title: "",
|
title: "",
|
||||||
@@ -245,7 +252,7 @@ export default {
|
|||||||
{
|
{
|
||||||
key: "og:image",
|
key: "og:image",
|
||||||
property: "og:image",
|
property: "og:image",
|
||||||
content: this.$page.project.image.src,
|
content: this.img(this.$page.project.image),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "twitter:description",
|
key: "twitter:description",
|
||||||
@@ -255,13 +262,18 @@ export default {
|
|||||||
{
|
{
|
||||||
key: "twitter:image",
|
key: "twitter:image",
|
||||||
property: "twitter:image",
|
property: "twitter:image",
|
||||||
content: this.$page.project.image.src,
|
content: this.img(this.$page.project.image),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "twitter:title",
|
key: "twitter:title",
|
||||||
property: "twitter:title",
|
property: "twitter:title",
|
||||||
content: this.$page.project.title,
|
content: this.$page.project.title,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: "twitter:card",
|
||||||
|
name: "twitter:card",
|
||||||
|
content: this.$page.project.excerpt,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user