7
1
mirror of https://gitlab.com/ansol/web-ansol.org.git synced 2024-11-27 00:07:43 +00:00
web-ansol.org/themes/academic/layouts/partials/comments/disqus.html

23 lines
1.1 KiB
HTML
Raw Normal View History

2020-06-11 11:46:16 +00:00
{{ if site.Params.comments.disqus.shortname }}
<div id="disqus_thread"></div>
<script>
let disqus_config = function () {
{{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}}
};
(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;
s.src = 'https://' + {{site.Params.comments.disqus.shortname}} + '.disqus.com/embed.js';
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>
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
{{end}}