<div id="disqus_thread" class="post-comments lazy-load<% if (theme.posts.comments?.enableBGImage) { %> bg-image<% } %>"></div>

<script>
    var disqus_config = function () {
        this.page.url = '<%- page.permalink %>';  // Replace PAGE_URL with your page's canonical URL variable
        this.page.identifier = '<%- page.path %>'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
    };
    var load_comm = () => {
        if (typeof DISQUS === 'undefined') {
            var d = document, s = d.createElement('script');
            s.src = 'https://<%- theme.disqus.shortname %>.disqus.com/embed.js';
            s.setAttribute('data-timestamp', +new Date());
            (d.head || d.body).appendChild(s);
        } else {
            DISQUS.reset({
                reload: true,
                config: function () {  
                    this.page.url = '<%- page.permalink %>';  // Replace PAGE_URL with your page's canonical URL variable
                    this.page.identifier = '<%- page.path %>'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
                }
            });
        }
    };
    
</script>
<script async id="dsq-count-scr" src="//<%- theme.disqus.shortname %>.disqus.com/count.js"></script>

<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>