script. function loadDisqusjs () { function addDisqusjsCSS () { const ele = document.createElement('link') ele.rel = 'stylesheet' ele.href= '!{url_for(theme.CDN.disqusjs_css)}' document.getElementsByTagName('head')[0].appendChild(ele) } function initDiqusjs () { window.DISQUS = null new DisqusJS({ shortname: '!{theme.disqusjs.shortname}', siteName: '!{theme.disqusjs.siteName}', identifier: '!{ page.path }', url: '!{ page.permalink }', title: '!{ page.title }', api: '!{theme.disqusjs.api}', apikey: '!{theme.disqusjs.apikey}', nocomment: '!{theme.disqusjs.nocomment}', admin: '!{theme.disqusjs.admin}', adminLabel: '!{theme.disqusjs.adminLabel}' }); } if (window.disqusjsload) initDiqusjs() else { addDisqusjsCSS() $.getScript('!{url_for(theme.CDN.disqusjs)}', initDiqusjs) window.disqusjsload = true } } if ('!{defaultComment}' === 'Disqusjs' || !{theme.comments.load_begin}) { loadDisqusjs() } else { function loadOtherComment () { loadDisqusjs() } } if is_post() && theme.comments.count && defaultComment === 'Disqusjs' script. function getDisqusCount() { var d = document, s = d.createElement('script'); s.src = 'https://!{theme.disqusjs.shortname}.disqus.com/count.js'; s.id = 'dsq-count-scr'; (d.head || d.body).appendChild(s); } getDisqusCount()