Browse Source

Replace Disqus snippet with internal tmpl

master
digitalcraftsman 9 years ago
parent
commit
9ebf05f5b0
  1. 4
      exampleSite/config.toml
  2. 4
      layouts/_default/single.html
  3. 14
      layouts/partials/disqus.html

4
exampleSite/config.toml

@ -5,6 +5,8 @@ title = "Hugo Cactus Theme"
theme = "hugo-cactus-theme" theme = "hugo-cactus-theme"
# Enter your tracking code to enable Google Analytics # Enter your tracking code to enable Google Analytics
googleAnalytics = "" googleAnalytics = ""
# Disable comments by leaving disqusShortname empty
disqusShortname = "spf13"
[params] [params]
name = "Mr. Hugo" name = "Mr. Hugo"
@ -12,8 +14,6 @@ googleAnalytics = ""
bio = "Blogger - Programmer - Gopher" bio = "Blogger - Programmer - Gopher"
# Enter optionally your twitter account # Enter optionally your twitter account
twitter = "Your Twitter account" twitter = "Your Twitter account"
# Disable comments by leaving disqusShortname empty
disqusShortname = "spf13"
enableRSS = true enableRSS = true
# The variables below are optionally too and can be used to # The variables below are optionally too and can be used to

4
layouts/_default/single.html

@ -25,9 +25,7 @@
</section> </section>
</footer> </footer>
{{ if isset .Site.Params "disqusShortname" }}
{{ partial "disqus.html" . }}
{{ end }}
{{ template "_internal/disqus.html" . }}
{{ partial "latest-posts.html" . }} {{ partial "latest-posts.html" . }}
{{ partial "footer.html" . }} {{ partial "footer.html" . }}

14
layouts/partials/disqus.html

@ -1,14 +0,0 @@
<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