fix: show comments on netlify domain

This commit is contained in:
Ricardo
2021-01-14 17:55:11 +00:00
parent a75c45b1b2
commit 9a6c469b2a
@@ -1,14 +1,17 @@
<template>
<div>
<h2 class="type-h2">Comments</h2>
<iframe
<div id="discourse-comments" class="mt-4 mb-24"></div>
<!-- <iframe
id="discourse-embed-frame"
ref="frame"
class="mt-4 mb-24"
:src="embedSrc"
width="100%"
scrolling="no"
:height="frameHeight"
referrerpolicy="no-referrer-when-downgrade"
/>
/> -->
</div>
</template>
@@ -16,11 +19,21 @@
export default {
name: 'Comments',
components: {},
data: () => ({}),
computed: {
embedSrc() {
return `https://discuss.ipfs.io/embed/comments?embed_url=https://blog.ipfs.io${this.$frontmatter.url}`
},
},
mounted() {
window.DiscourseEmbed = {
discourseUrl: 'https://discuss.ipfs.io/',
discourseEmbedUrl: `https://blog.ipfs.io${this.$frontmatter.url}`,
}
const d = document.createElement('script')
d.type = 'text/javascript'
d.async = true
d.src = 'https://discuss.ipfs.io/javascripts/embed.js'
document.getElementsByTagName('body')[0].appendChild(d)
},
}
</script>