2019-01-02 06:33:26 -05:00
|
|
|
{{- $pc := .Site.Config.Privacy.Disqus -}}
|
2018-05-20 14:00:29 -04:00
|
|
|
{{- if not $pc.Disable -}}
|
2023-10-16 13:56:37 -04:00
|
|
|
{{ if .Site.Config.Services.Disqus.Shortname }}<div id="disqus_thread"></div>
|
2023-11-25 15:43:52 -05:00
|
|
|
<script>
|
2022-02-22 23:42:40 -05:00
|
|
|
window.disqus_config = function () {
|
2019-04-09 10:39:12 -04:00
|
|
|
{{with .Params.disqus_identifier }}this.page.identifier = '{{ . }}';{{end}}
|
|
|
|
{{with .Params.disqus_title }}this.page.title = '{{ . }}';{{end}}
|
|
|
|
{{with .Params.disqus_url }}this.page.url = '{{ . | html }}';{{end}}
|
2018-05-04 11:53:56 -04:00
|
|
|
};
|
|
|
|
(function() {
|
|
|
|
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
|
|
|
|
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
var d = document, s = d.createElement('script'); s.async = true;
|
2023-10-16 13:56:37 -04:00
|
|
|
s.src = '//' + {{ .Site.Config.Services.Disqus.Shortname }} + '.disqus.com/embed.js';
|
2018-05-04 11:53:56 -04:00
|
|
|
s.setAttribute('data-timestamp', +new Date());
|
|
|
|
(d.head || d.body).appendChild(s);
|
|
|
|
})();
|
|
|
|
</script>
|
|
|
|
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
2018-05-20 14:00:29 -04:00
|
|
|
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>{{end}}
|
2023-10-16 13:56:37 -04:00
|
|
|
{{- end -}}
|