yous / whiteglass

Minimal, responsive Jekyll theme for hackers

Home Page:https://yous.github.io/whiteglass/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Release version with comments enabled

leonardehrenfried opened this issue · comments

I would like to use your theme but the last release is from February and the comments code was merged in June 2017.

Any change you could throw up a release on Rubygems?

Thanks for a great theme!

Oh right! Thanks for the notice. I’ll release a new version soon.

Sorry for the delay, I've just released v1.4.0!

Is there any resource that I can refer to integrate my disqus with whiteglass?

Hi, @hussaintamboli. First, take a look at Comments section in README.

You should get your own Disqus shortname to configure. Go to disqus.com and follow steps for "Get Started". Then you'll face "Universal Code install instructions", and there is something like s.src = 'https://SHORTNAME.disqus.com/embed.js';, then that SHORTNAME in the URL is your shortname.

After getting your shortname, overwrite _includes/custom_comments_provider.html with following content:

<div id="disqus_thread"></div>
<script>
  var disqus_config = function () {
    this.page.url = '{{ page.url | replace:'index.html','' | absolute_url }}';
    this.page.identifier = '{{ page.url | relative_url }}';
  };

  (function() {
    var d = document, s = d.createElement('script');
    s.src = 'https://SHORTNAME.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>

This sets canonical URL to this.page.url, and relative URL to this.page.identifier. You may want to set this.page.identifier to something other, but it should be unique for each page. You should replace SHORTNAME with your own shortname.

Then add comments: true to your _config.yml to enable comments. I think you should also proceed on Disqus to finish configuration.

Works perfectly. Thanks a lot.