<%- css_npm_cdn('disqusjs', 'dist/disqusjs.css') %>
<div id="disqus_thread" class="post-comments lazy-load<% if (theme.posts.comments?.enableBGImage) { %> bg-image<% } %>"></div>
<script>
    var load_comm = () => {
        const init = () => {
            window.DISQUS = null;
            new DisqusJS({
                shortname: '<%- theme.disqusjs.shortname %>',
                siteName: '<%- theme.disqusjs.sitename %>',
                identifier: '<%- page.path %>',
                url: '<%- page.permalink %>',
                api: '<%- theme.disqusjs.api %>',
                apikey: '<%- theme.disqusjs.apikey %>',
                admin: '<%- theme.disqusjs.admin %>',
                adminLabel: '<%- theme.disqusjs.adminlabel %>'
            });
        }
        if (typeof DisqusJS === 'undefined') {
            const src = '<%- url_npm_cdn("disqusjs", "dist/disqus.js") %>';
            $.getScript(src, init);
        } else {
            init();
        }
    };
</script>
<noscript>Please enable JavaScript to view the <a href="https://github.com/SukkaW/DisqusJS">comments powered by DisqusJS.</a></noscript>