diff options
author | Barry Clark <barry@barryclark.co> | 2014-05-27 20:40:03 -0400 |
---|---|---|
committer | Barry Clark <barry@barryclark.co> | 2014-05-27 20:40:03 -0400 |
commit | f521f8a9ec81c6b42f05c1fff11a61d234f40bb8 (patch) | |
tree | 5700a1a79ff5640395671faf58e46a2f794ae12e | |
parent | a31c079738bf4f12531573245e72cb210708d7e1 (diff) | |
download | kompetenzbolzen.github.io-f521f8a9ec81c6b42f05c1fff11a61d234f40bb8.tar.gz |
Only include Disqus markup if an account has been entered
-rw-r--r-- | _includes/disqus.html | 27 | ||||
-rw-r--r-- | _layouts/post.html | 4 |
2 files changed, 16 insertions, 15 deletions
diff --git a/_includes/disqus.html b/_includes/disqus.html index 9baf91f..453eef5 100644 --- a/_includes/disqus.html +++ b/_includes/disqus.html @@ -1,14 +1,17 @@ -<div id="disqus_thread"></div> -<script type="text/javascript"> - {% if site.disqus %} +{% if site.disqus %} +<div class="comments"> + <div id="disqus_thread"></div> + <script type="text/javascript"> + + var disqus_shortname = '{{ site.disqus }}'; - var disqus_shortname = '{{ site.disqus }}'; + (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); + })(); - (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); - })(); - {% endif %} -</script> -<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
\ No newline at end of file + </script> + <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> +</div> +{% endif %}
\ No newline at end of file diff --git a/_layouts/post.html b/_layouts/post.html index d8cc8be..f45cd6b 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -14,7 +14,5 @@ layout: default Written on {{ page.date | date: "%B %e, %Y" }} </div> - <div class="comments"> - {% include disqus.html disqus_identifier=page.disqus_identifier %} - </div> + {% include disqus.html disqus_identifier=page.disqus_identifier %} </article> |