<% if (theme.DisqusJS.enable) { %>
    <div id="disqus_thread" style="max-width: 80%;margin: auto;"></div>
    <script id="dsqjs-script" async="" src="https://cdn.jsdelivr.net/npm/disqusjs@1.3.0/dist/disqus.js"></script>
    <script>
        document.getElementById('dsqjs-script').addEventListener('load', function() {
            var dsqjs = new DisqusJS({
                shortname: "<%=theme.DisqusJS.shortname %>",
                siteName: "<%=theme.DisqusJS.siteName %>",
                identifier: "<%=theme.DisqusJS.identifier %>",
                url: "<%=theme.DisqusJS.url %>",
                api: "<%=theme.DisqusJS.api %>",
                apikey: '<%=theme.DisqusJS.apikey %>',
                admin: '<%=theme.DisqusJS.admin %>',
                adminLabel: '<%=theme.DisqusJS.adminLabel %>'
            });
        });
    </script>
<% } %>
<% if (theme.Valine.enable) { %>
    <div id="vcomments" style="max-width: 80%;margin: auto;"></div>
    <script id="valine-script" async="" src="https://unpkg.com/valine/dist/Valine.min.js"></script>
    <script>
        document.getElementById('valine-script').addEventListener('load', function() {
            new Valine({
                el: '#vcomments',
                appId: '<%= theme.Valine.appId %>',
                appKey: '<%= theme.Valine.appKey %>'
            })
        });
    </script>
<% } %>
<% if (theme.Disqus.enable) {%>
    <div id="disqus_thread" style="width: 80%;margin: auto;"></div>
    <script>
        (function() { 
        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);
        })();
    </script>
    <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> 
<% } %> 