krata/_includes/disqus.html

34 lines
943 B
HTML
Raw Normal View History

2019-09-30 14:38:41 +02:00
<!--
The Disqus lazy loading.
-->
<div id="disqus_thread" class="pt-2 pb-2">
<p class="text-center text-muted small mb-5">
2021-02-25 17:50:42 +01:00
Comments powered by <a href="https://disqus.com/">Disqus</a>.
2020-07-29 22:58:05 +02:00
</p>
2019-09-30 14:38:41 +02:00
</div>
<script type="text/javascript">
var disqus_config = function () {
this.page.url = '{{ page.url | absolute_url }}';
this.page.identifier = '{{ page.url }}';
};
/* Lazy loading */
2019-09-30 14:38:41 +02:00
var disqus_observer = new IntersectionObserver(function (entries) {
if(entries[0].isIntersecting) {
(function () {
var d = document, s = d.createElement('script');
s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
disqus_observer.disconnect();
2019-09-30 14:38:41 +02:00
}
}, { threshold: [0] });
2019-09-30 14:38:41 +02:00
disqus_observer.observe(document.querySelector("#disqus_thread"));
2021-01-18 16:27:43 +01:00
</script>