{% if page.comments and jekyll.environment == "production" %}
  <div id="disqus_thread"></div>
  <script>
    var disqus_config = function () {
      this.page.url = '{{ site.url }}{{ page.url }}';
      this.page.identifier = '{{ site.url }}{{ page.url }}';
    };

    (function() {
      var d = document, s = d.createElement('script');

      s.src = 'https://{{ site.disqus.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" rel="nofollow">comments powered by Disqus.</a></noscript>
{% endif %}

{% if page.comments and jekyll.environment == "production" %}
  {% if site.url %}
    {% assign disqus_url = page.url | prepend: site.url %}
  {% elsif site.github.url %}
    {% assign disqus_url = page.url | prepend: site.github.url %}
  {% endif %}

  <div id="disqus_thread"></div>
  <script>
    var disqus_config = function () {
      this.page.url = '{{ disqus_url }}';
      this.page.identifier = '{{ disqus_url }}';
    };

    (function() {
      var d = document, s = d.createElement('script');

      s.src = 'https://{{ site.disqus.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" rel="nofollow">comments powered by Disqus.</a></noscript>
{% endif %}

Use either `site.url` or `site.github.url` for Disqus
Use either `site.url` or `site.github.url` for Disqus
