about summary refs log tree commit diff
path: root/pages/kronika/_year/_month
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-01-25 19:59:54 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-01-25 19:59:54 +0100
commit0df2c534d8615fd55994e9d27d9c2b81d4e87c20 (patch)
tree2ccad4ba35b27a09661ec489b8ad4db7eda7ab8f /pages/kronika/_year/_month
parent1aa3a88b21539aa06572d86324673baeddfbe46f (diff)
downloadpuszcza-0df2c534d8615fd55994e9d27d9c2b81d4e87c20.tar.gz
puszcza-0df2c534d8615fd55994e9d27d9c2b81d4e87c20.zip
Add image to open graph
Diffstat (limited to 'pages/kronika/_year/_month')
-rw-r--r--pages/kronika/_year/_month/_day/_title/index.vue26
1 files changed, 18 insertions, 8 deletions
diff --git a/pages/kronika/_year/_month/_day/_title/index.vue b/pages/kronika/_year/_month/_day/_title/index.vue
index 9fab1d0..ed9eab7 100644
--- a/pages/kronika/_year/_month/_day/_title/index.vue
+++ b/pages/kronika/_year/_month/_day/_title/index.vue
@@ -5,6 +5,11 @@
       <p>Nie znaleziono wpisu</p>
     </div>
     <section v-else class="article">
+      <img
+        :src="attributes.image"
+        :alt="attributes.title"
+        :title="attributes.title"
+      />
       <article class="content" v-html="content"></article>
     </section>
   </div>
@@ -22,19 +27,24 @@ export default {
         {
           hid: 'og:title',
           property: 'og:title',
-          content: this.attributes.title
+          content: this.attributes.title,
         },
         {
           hid: 'og:type',
           property: 'og:type',
-          content: 'article'
+          content: 'article',
         },
         {
           hid: 'og:article:author',
           property: 'og:article:author',
-          content: this.attributes.author
-        }
-      ]
+          content: this.attributes.author,
+        },
+        {
+          hid: 'og:image',
+          property: 'og:image',
+          content: this.attributes.image,
+        },
+      ],
     }
   },
   async asyncData({ params }) {
@@ -46,14 +56,14 @@ export default {
     return {
       params,
       attributes: post.content.meta,
-      content: post.content.html
+      content: post.content.html,
     }
   },
   data() {
     return {
-      notFound: false
+      notFound: false,
     }
-  }
+  },
 }
 </script>