diff --git a/src/templates/GhostPost.vue b/src/templates/GhostPost.vue index 88e0a12..edce938 100644 --- a/src/templates/GhostPost.vue +++ b/src/templates/GhostPost.vue @@ -86,8 +86,46 @@ export default { } else { bodyAttrs = "page-template" } + + let baseUrl = this.$static.metadata.siteUrl||this.$static.metadata.ghost.url + + let meta = [ + { property: 'og:site_name', content: 'Snipette' }, + { property: 'og:type', content: 'article' }, + { property: 'og:title', content: this.thisPost.title }, + { property: 'og:description', content: this.thisPost.description }, + { property: 'og:url', content: baseUrl + this.thisPost.path }, + { property: 'og:image', content: changeUrls(this.thisPost.image) }, + { property: 'article:published_time', content: this.thisPost.date }, + ] + + for (var i=0; i{return t.title}).join(',') }, + ]) + + if (Admin.social_media && Admin.social_media.twitter) { + meta.push({ property: 'twitter:site', content: '@' + Admin.social_media.twitter }) + } + return { title: this.$page.post ? this.$page.post.title : this.$page.page.title, + meta: meta, bodyAttrs: { class: bodyAttrs } @@ -184,6 +222,7 @@ export default { query Metadata { metadata { + siteUrl ghost { title url