Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
graphcomment + ghost

Paste the comment code into post.hbs

Next, in your Ghost theme, locate the template file where you want to insert comments on your site. Usually post.hbs - right after the content. In Casper, Ghost’s default theme, you’ll see a line of code specifically reserved for inserting comments. This is where you’ll want to paste the Graphcomment code:

https://ghost.org/images/integrations/theme-comments-code.png

Make sure you remove the comments on line 65 and 69 Make sure you remove the comments on line 65 and 69

replace "<your_public_key>" by your own public key from the admin GraphComment.

<div id="graphcomment"></div>
<script type="text/javascript">
/* - - - CONFIGURATION VARIABLES - - - */
var __semio__params = {
graphcommentId: "<your_public_key>", // make sure the id is yours
behaviour: {
// HIGHLY RECOMMENDED
// uid: "...", // uniq identifer for the comments thread on your page (ex: your page id)
uid: "ghost-{{comment_id}}",
url: "{{url absolute="true"}}"
},
// configure your variables here
}
/* - - - DON'T EDIT BELOW THIS LINE - - - */
function __semio__onload() {
__semio__gc_graphlogin(__semio__params)
}
(function() {
var gc = document.createElement('script'); gc.type = 'text/javascript'; gc.async = true;
gc.onload = __semio__onload; gc.defer = true; gc.src = 'https://integration.graphcomment.com/gc_graphlogin.js?' + Date.now();
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(gc);
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment