In this tutorial we will show you how to integrate Disqus comments with your Ghost blog. By default, Ghost does support post comments and you can easily integrate the third party service Disqus comments.

  1. Configure Disqus
    Create a free Disqus account and follow the steps to install Disqus on a website.
  2. Find the post.hbs file located in your current theme’s directory, e.g. content/themes/your-theme/post.hbs

edit it

$ vi content/themes/casper/post.hbs

search disqus_thread

            {{!--

            If you use Disqus comments, just uncomment this block.
            The only thing you need to change is "test-apkdzgmqhj" - which
            should be replaced with your own Disqus site-id.
            --}}

            <section class="post-full-comments">
                <div id="disqus_thread"></div>
                <script>
                    var disqus_config = function () {
                        this.page.url = '{{url absolute="true"}}';
                        this.page.identifier = 'ghost-{{comment_id}}';
                    };
                    (function() {
                        var d = document, s = d.createElement('script');
                        s.src = 'https://test-apkdzgmqhj.disqus.com/embed.js';
                        s.setAttribute('data-timestamp', +new Date());
                        (d.head || d.body).appendChild(s);
                    })();
                </script>
            </section>

replaced test-apkdzgmqhj with your own Disqus site-id

then uncomment section.

  1. Save your changes and re-start your ghost.

References

Disqus – Ghost
https://help.ghost.org/hc/en-us/articles/115000440851-Disqus

How to Integrate Disqus with Ghost – Ghost Tutorial – FastComet
https://www.fastcomet.com/tutorials/ghost/disqus-comments-integration

Admin – Disqus
https://disqus.com/admin/create/

打赏

Leave a Reply

Your email address will not be published. Required fields are marked *