<div id="disqus_thread"></div>

<script id="js-disqusjs" src="https://cdn.isteed.cc/file/disqus.js" async></script>
<script>
document.getElementById('js-disqusjs').addEventListener('load', function () {
    function loadDisqusJS() {
        new DisqusJS({
            shortname: '<%= theme.comment.disqusjs.shortname %>',
            <% if (theme.comment.disqusjs.siteName) { %>
            siteName: '<%= theme.comment.disqusjs.siteName %>',
            <% } %>
            identifier: '<%= page.permalink %>',
            url: '<%= page.permalink %>',
            api: '<%= theme.comment.disqusjs.api %>',
            apikey: '<%= theme.comment.disqusjs.apikey %>',
            <% if (theme.comment.disqusjs.admin) { %>
            admin: '<%= theme.comment.disqusjs.admin %>',
            <% } %>
            <% if (theme.comment.disqusjs.adminLabel) { %>
            adminLabel: '<%= theme.comment.disqusjs.adminLabel %>'
            <% } %>
        })
    }
    if (document.readyState === 'complete') {
        loadDisqusJS();
    } else {
        window.addEventListener('load', loadDisqusJS);
    }
});
</script>
