<% if (theme.gentie_productKey){ %>
	<!-- 网易云跟帖 start -->
	<div id="cloud-tie-wrapper" class="cloud-tie-wrapper"></div>
	<script>
	  var cloudTieConfig = {
	    url: document.location.href, 
	    sourceId: "",
	    productKey: "<%- theme.gentie_productKey %>",
	    target: "cloud-tie-wrapper"
	  };
	</script>
	<script src="https://img1.cache.netease.com/f2e/tie/yun/sdk/loader.js"></script>
	<!-- 网易云跟帖 end -->
	
<% } else if (theme.duoshuo_shortname) {%>
	<div id="comment">
	
	<!-- 多说评论框 start -->
	 <div class="ds-thread" data-thread-key="<%- config.root %><%- post.path %>" data-title="<%- post.title %>" data-url="<%- post.permalink %>"></div>
	<!-- 多说评论框 end -->
	<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
	<script type="text/javascript">
	var duoshuoQuery = {short_name:"<%- theme.duoshuo_shortname %>"};
	  (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);
	  })();
	  </script>
	<!-- 多说公共JS代码 end -->
	
	</div>
	<%- css('css/comment-ds.css') %>
<% } else if (theme.disqus_shortname) {%>
	<section id="comments" class="comment">
	  <div id="disqus_thread">
	  <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
	  </div>
	</section>

	<script type="text/javascript">
	var disqus_shortname = '<%= theme.disqus_shortname %>';
	(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);
	}());
	(function(){
	  var dsq = document.createElement('script');
	  dsq.type = 'text/javascript';
	  dsq.async = true;
	  dsq.src = '//' + disqus_shortname + '.disqus.com/count.js';
	  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
	}());
	</script>
<% } else if (theme.uyan_uid) {%>
	<section id="comments" class="comment">
		<!-- UY BEGIN -->
		<div id="uyan_frame"></div>
		<script type="text/javascript">
			(function(){
			  var dsq = document.createElement('script');
			  dsq.type = 'text/javascript';
			  dsq.async = true;
			  dsq.src = "http://v2.uyan.cc/code/uyan.js?uid=<%- theme.uyan_uid %>";
			  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
			}());
		</script>
		<!-- UY END -->
	</section>
<% } else if (theme.wumii) {%>
	<div id="comment">
		<script type="text/javascript" id="wumiiComments">
		    var wumiiPermaLink = "<%- post.permalink %>"; //请用代码生成文章永久的链接
		    var wumiiTitle = "<%- post.title %>"; //请用代码生成文章标题
		    var wumiiSitePrefix = "<%- theme.url %>"; //安装无觅评论插件的网站的域名，如果是放在子域名上，请提供子域名，如"http://blog.wumii.com"。如果这里填写的域名不对，请自行改正。
		    var wumiiCommentParams = "&pf=JAVASCRIPT";
	   	</script>
		<script type="text/javascript" src="http://widget.wumii.cn/ext/cw/widget"></script>
	</div>
<% } else if (theme.livere_shortname) {%>
	<div id="comment">
		<!-- 来必力City版安装代码 -->
		<div id="lv-container" data-id="city" data-uid="<%- theme.livere_shortname %>">
		<script type="text/javascript">
		   (function(d, s) {
		       var j, e = d.getElementsByTagName(s)[0];

		       if (typeof LivereTower === 'function') { return; }

		       j = d.createElement(s);
		       j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
		       j.async = true;

		       e.parentNode.insertBefore(j, e);
		   })(document, 'script');
		</script>
		<noscript>为正常使用来必力评论功能请激活JavaScript</noscript>
		</div>
		<!-- City版安装代码已完成 -->
	</div>
<% } else if (theme.gitment.client_secret) {%>
  <!-- Gitment START! Deploy by Z4HD -->
	<div id="comments"></div>
	<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
	<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
	<script>
	var gitment = new Gitment({
		id: '<%- post.permalink %>',
		owner: '<%- theme.gitment.owner %>',
		repo: '<%- theme.gitment.repo %>',
		oauth: {
			client_id: '<%- theme.gitment.client_id %>',
			client_secret: '<%- theme.gitment.client_secret %>',
		},
	})
	gitment.render('comments')
	</script>
	<!-- Gitment 自定义样式表 -->
	<%- css('css/comment-gitment.css') %>
	<!-- Gitment END! -->
<% } else if (theme.valine.app_id && theme.valine.app_key) {%>
	<script src="//cdn.jsdelivr.net/npm/leancloud-storage@latest/dist/av-min.js"></script>
    <script src='//cdn.jsdelivr.net/npm/valine@latest/dist/Valine.min.js'></script>
	<div id="vcomments"></div>
	<script>
		var notify = <%= theme.valine.notify %> == true ? true : false;
		var verify = <%= theme.valine.verify %> == true ? true : false;
		var visitor = <%= theme.valine.visitor %> == true ? true : false;
        new Valine({
            el: '#vcomments',
			notify: notify,
			verify: verify,
            appId: '<%= theme.valine.appid %>',
            appKey: '<%= theme.valine.appkey %>',
			placeholder: '<%= theme.valine.placeholder %>',
			avatar: '<%= theme.valine.avatar %>',
			pageSize: <%= theme.valine.pageSize %>,
			visitor: visitor
        });
    </script>
<% } %>
