Programster's Blog

Tutorials focusing on Linux, programming, and open source

Add Comments To Your Ghost Blog

What use is a blog unless the public can comment to thank the author or tell them that they're an idiot? Currently, Ghost does not have a native comment system, but is apparently in the pipleine. For now, you have to make do with using a third party, such as Facebook, Disqus or Google+.

To add Google plus to your site: * navigate to your theme's directory. * If you installed Ghost with my previous tutorial, this will be at $HOME/ghost_volume/content/themes/$theme_name. * Edit the post.hbs file and add the snippet below, just before {{/post}} or </article>

<script src="https://apis.google.com/js/plusone.js">
</script>
<div class="g-comments"
    data-href="{{@blog.url}}{{url}}"
    data-width="600"
    data-first_party_property="BLOGGER"
    data-view_type="FILTERED_POSTMOD">
</div>  

Vapor Theme

This site uses a customized version of the Vapor theme which already has comment systems ready to be implemented by just deleting one character in the code! Just open the post.hbs file as before and find this section:

...
{{/post}}

{{!> comments-disqus}}
{{!> comments-facebook}}
{{!> comments-google-plus}}
...

Remove just the ! character from the line which has the comment system you would like to implement.

Ghostery and Ghost

All three commenting systems mentioned are blocked by Ghostery. If you use Ghostery, you will need to whitelist the site, or allow the specific tracker to the commenting system. Hopefully, Ghost will have native comment support soon so we dont have to worry about this in future.