Browse Source

Added disqus to posts

master
digitalcraftsman 10 years ago
parent
commit
5ad47a9329
  1. 4
      layouts/_default/single.html
  2. 14
      layouts/partials/disqus.html

4
layouts/_default/single.html

@ -29,6 +29,10 @@
</section>
</footer>
{{ if gt (len .Site.Params.disqusShortname) 0 }}
{{ partial "disqus.html" . }}
{{ end }}
<ul id="post-list" class="archive readmore">
<h3>Read more</h3>
{{ range first 10 .Site.Pages }}

14
layouts/partials/disqus.html

@ -0,0 +1,14 @@
<section class="disqus">
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '{{ .Site.Params.disqusShortname }}';
var disqus_developer = 0; // developer mode is on
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + 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>
<a href="//disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</section>
Loading…
Cancel
Save