From 57ab2bf2f1097ec4d4f135aecaae2754067976cf Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Mon, 21 Oct 2019 20:47:41 +0200 Subject: Add opengraph meta tags --- pages/kronika/_year/_month/_day/_title/index.vue | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'pages/kronika/_year/_month/_day') diff --git a/pages/kronika/_year/_month/_day/_title/index.vue b/pages/kronika/_year/_month/_day/_title/index.vue index a64b113..27006fc 100644 --- a/pages/kronika/_year/_month/_day/_title/index.vue +++ b/pages/kronika/_year/_month/_day/_title/index.vue @@ -16,6 +16,27 @@ import frontmatter from 'front-matter' import k from '~/api' export default { + head() { + return { + meta: [ + { + hid: 'og:title', + name: 'og:title', + content: this.attributes.title + }, + { + hid: 'og:type', + name: 'og:type', + content: 'article' + }, + { + hid: 'og:article:author', + name: 'og:article:author', + content: this.attributes.author + } + ] + } + }, async asyncData({ params }) { const { year, month, day, title } = params const post = k.getPost(year, month, day, title) -- cgit 1.4.1