github.com/fighterlyt/hugo@v0.47.1/tpl/tplimpl/embedded/templates/disqus.html (about) 1 {{- $pc := .Page.Site.Config.Privacy.Disqus -}} 2 {{- if not $pc.Disable -}} 3 {{ if .Site.DisqusShortname }}<div id="disqus_thread"></div> 4 <script type="application/javascript"> 5 var disqus_config = function () { 6 {{with .GetParam "disqus_identifier" }}this.page.identifier = '{{ . }}';{{end}} 7 {{with .GetParam "disqus_title" }}this.page.title = '{{ . }}';{{end}} 8 {{with .GetParam "disqus_url" }}this.page.url = '{{ . | html }}';{{end}} 9 }; 10 (function() { 11 if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) { 12 document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.'; 13 return; 14 } 15 var d = document, s = d.createElement('script'); s.async = true; 16 s.src = '//' + {{ .Site.DisqusShortname }} + '.disqus.com/embed.js'; 17 s.setAttribute('data-timestamp', +new Date()); 18 (d.head || d.body).appendChild(s); 19 })(); 20 </script> 21 <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> 22 <a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>{{end}} 23 {{- end -}}