apvarun / blist-hugo-theme

Blist is a clean and fast blog theme for your Hugo site.
https://blist.vercel.app/
MIT License
332 stars 163 forks source link

Comments with disqus enabled? #59

Open sebfischer83 opened 2 years ago

sebfischer83 commented 2 years ago

Hi,

is disqus possible with this theme? I configured it but nothing shows up.

cr105ph1nx commented 2 years ago

Yes it is possible. You just go to this URL and follow the instructions: https://disqus.com/admin/create/ They'll give you a script that you need to paste on any of the pages you want the disqus section to appear. I chose to put it in layouts/_default/single.html. I also recommend that you uncomment and edit the config settings like they suggest.

Here's a demo of how it looks like if you're interested.

is disqus possible with this theme? I configured it but nothing shows up.

You said you configured it but nothing shows up, do you mind giving more information on what do you think is causing this problem so that we can help you?

chris-gillatt commented 2 years ago

As @cr105ph1nx said, edit layouts/_default/single.html and add:

  <div id="disqus_thread"></div>
  <script>
      var disqus_config = function () {
      this.page.url = "{{ .Site.BaseURL }}";  
      this.page.identifier = "{{ .Title }}"; 
      };
      (function() { // DON'T EDIT BELOW THIS LINE
      var d = document, s = d.createElement('script');
      s.src = 'https://yourDisqusShortname .disqus.com/embed.js';
      s.setAttribute('data-timestamp', +new Date());
      (d.head || d.body).appendChild(s);
      })();
  </script>
  <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>

Don't forget to update yourDisqusShortname.

You probably want to paste it below {{- partial "social.html" . -}} in the existing code.