Skip to content

Instantly share code, notes, and snippets.

@ddtraceweb
Last active July 21, 2021 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddtraceweb/15ff171ee00d9db8ba6c695873a7d938 to your computer and use it in GitHub Desktop.
Save ddtraceweb/15ff171ee00d9db8ba6c695873a7d938 to your computer and use it in GitHub Desktop.
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