Browse Source

Don't generate disqus comment threads for drafts.

master
Ben Kurtovic 9 years ago
parent
commit
21bea2fd6a
2 changed files with 17 additions and 15 deletions
  1. +16
    -14
      _layouts/post.html
  2. +1
    -1
      index.html

+ 16
- 14
_layouts/post.html View File

@@ -15,18 +15,20 @@ layout: base
<div id="post">
{{ content }}
</div>
<div id="disqus_thread"></div>
<script>
var disqus_shortname = 'earwig';
var disqus_identifier = '{{ page.id }}';
var disqus_title = '{{ page.title }}';
var disqus_url = '{{ site.url }}{{ page.url }}';
var disqus_developer = 1;
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{% unless page.draft %}
<div id="disqus_thread"></div>
<script>
var disqus_shortname = 'earwig';
var disqus_identifier = '{{ page.id }}';
var disqus_title = '{{ page.title }}';
var disqus_url = '{{ site.url }}{{ page.url }}';
var disqus_developer = 1;
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{% endunless %}
</div>

+ 1
- 1
index.html View File

@@ -116,7 +116,7 @@ title: Home
</div>
<ul id="post-list" class="work-list">
{% for post in site.posts %}
<li data-tags="{{ post.tags | join: "|" }}">{{ post.date | date: "%b %-d, %Y" }}: <a class="underlined" href="{{ post.url }}">{{ post.title }}</a><br /><span class="subtitle">{{ post.description }}<br />{{ post.tags | join: ", " }} &middot; <a href="{{ post.url }}#disqus_thread" data-disqus-identifier="{{ post.id }}"></a></span></li>
<li data-tags="{{ post.tags | join: "|" }}">{{ post.date | date: "%b %-d, %Y" }}: <a class="underlined" href="{{ post.url }}">{{ post.title }}</a><br /><span class="subtitle">{{ post.description }}<br />{{ post.tags | join: ", " }} {% unless post.draft %} &middot; <a href="{{ post.url }}#disqus_thread" data-disqus-identifier="{{ post.id }}"></a>{% endunless %}</span></li>
{% endfor %}
<li id="null-post" data-tags="" style="display: none;"><i>No posts with these tags</i></li>
</ul>


Loading…
Cancel
Save