if theme.duoshuo
    .ds-thread(data-thread-key=page.path, data-title=page.title, data-url=page.permalink, data-author-key='1')
    script.
        var duoshuoQuery = {short_name:"#{theme.duoshuo}"};
        (function() {
            var ds = document.createElement('script');
            ds.type = 'text/javascript';ds.async = true;
            ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
            ds.charset = 'UTF-8';
            (document.getElementsByTagName('head')[0] 
             || document.getElementsByTagName('body')[0]).appendChild(ds);
        })();


if theme.disqus
    #disqus_thread
    script.
        var disqus_shortname = '#{theme.disqus}';
        var disqus_identifier = '#{page.path}';
        var disqus_title = '#{page.title}';
        var disqus_url = '#{config.url}/#{page.path}';
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    script(id='dsq-count-scr' src='//#{theme.disqus}.disqus.com/count.js' async)
if theme.duoshuo
    .ds-thread(data-thread-key=page.path, data-title=page.title, data-url=page.permalink, data-author-key='1')
    script.
        var duoshuoQuery = {short_name:"#{theme.duoshuo}"};
        (function() {
            var ds = document.createElement('script');
            ds.type = 'text/javascript';ds.async = true;
            ds.src = '#{theme.duoshuo_embed_url ? theme.duoshuo_embed_url : "//static.duoshuo.com/embed.js"}';
            ds.charset = 'UTF-8';
            (document.getElementsByTagName('head')[0] 
             || document.getElementsByTagName('body')[0]).appendChild(ds);
        })();


if theme.disqus
    #disqus_thread
    script.
        var disqus_shortname = '#{theme.disqus}';
        var disqus_identifier = '#{page.path}';
        var disqus_title = '#{page.title}';
        var disqus_url = '#{config.url}/#{page.path}';
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    script(id='dsq-count-scr' src='//#{theme.disqus}.disqus.com/count.js' async)

Add support for custom duoshuo embed.js
Add support for custom duoshuo embed.js
