2018-07-09 17:41:34 +00:00
|
|
|
{{ if and .IsPage (ne .Params.comment false) -}}
|
2017-08-27 14:38:42 +00:00
|
|
|
<!-- Disqus -->
|
|
|
|
{{- if .Site.DisqusShortname -}}
|
|
|
|
<div id="disqus_thread"></div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
(function() {
|
2017-12-20 13:33:05 +00:00
|
|
|
// Don't ever inject Disqus on localhost--it creates unwanted
|
|
|
|
// discussions from 'localhost:1313' on your Disqus account...
|
|
|
|
if (window.location.hostname === 'localhost') return;
|
2017-08-27 14:38:42 +00:00
|
|
|
|
2017-12-20 13:33:05 +00:00
|
|
|
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
|
|
|
var disqus_shortname = '{{ .Site.DisqusShortname }}';
|
|
|
|
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
|
|
|
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
2017-08-27 14:38:42 +00:00
|
|
|
})();
|
|
|
|
</script>
|
|
|
|
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
2018-03-11 06:47:13 +00:00
|
|
|
{{- end -}}
|
2017-08-27 14:38:42 +00:00
|
|
|
|
|
|
|
<!-- changyan -->
|
|
|
|
{{- if and .Site.Params.changyanAppid .Site.Params.changyanAppkey -}}
|
2019-09-08 14:42:48 +00:00
|
|
|
<div id="SOHUCS" sid="{{ .RelPermalink }}"></div>
|
2017-12-20 13:33:05 +00:00
|
|
|
<script type="text/javascript">
|
2017-08-27 14:38:42 +00:00
|
|
|
(function(){
|
|
|
|
if (window.location.hostname === 'localhost') return;
|
|
|
|
|
|
|
|
var appid = '{{ .Site.Params.changyanAppid }}';
|
|
|
|
var conf = '{{ .Site.Params.changyanAppkey }}';
|
2019-09-08 14:42:48 +00:00
|
|
|
var width = window.innerWidth || document.documentElement.clientWidth;
|
2017-09-10 14:24:26 +00:00
|
|
|
if (width < 960) {window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>'); } else { var loadJs=function(d,a){var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","UTF-8");b.setAttribute("src",d);if(typeof a==="function"){if(window.attachEvent){b.onreadystatechange=function(){var e=b.readyState;if(e==="loaded"||e==="complete"){b.onreadystatechange=null;a()}}}else{b.onload=a}}c.appendChild(b)};loadJs("https://changyan.sohu.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})}); }
|
2017-08-27 14:38:42 +00:00
|
|
|
})();
|
|
|
|
</script>
|
2018-03-11 06:47:13 +00:00
|
|
|
{{- end -}}
|
2017-12-20 13:33:05 +00:00
|
|
|
|
|
|
|
<!-- LiveRe -->
|
|
|
|
{{- if .Site.Params.livereUID -}}
|
2018-07-09 17:41:34 +00:00
|
|
|
<div id="lv-container" data-id="city" data-uid="{{ .Site.Params.livereUID }}">
|
|
|
|
<script type="text/javascript">
|
|
|
|
(function(d, s) {
|
|
|
|
var j, e = d.getElementsByTagName(s)[0];
|
2017-12-20 13:33:05 +00:00
|
|
|
|
2018-07-09 17:41:34 +00:00
|
|
|
if (typeof LivereTower === 'function') { return; }
|
2017-12-20 13:33:05 +00:00
|
|
|
|
2018-07-09 17:41:34 +00:00
|
|
|
j = d.createElement(s);
|
|
|
|
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
|
|
|
|
j.async = true;
|
2017-12-20 13:33:05 +00:00
|
|
|
|
2018-07-09 17:41:34 +00:00
|
|
|
e.parentNode.insertBefore(j, e);
|
|
|
|
})(document, 'script');
|
|
|
|
</script>
|
|
|
|
<noscript>Please enable JavaScript to view the comments powered by <a href="https://livere.com/">LiveRe.</a></noscript>
|
|
|
|
</div>
|
2018-03-11 06:47:13 +00:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
<!-- gitment -->
|
|
|
|
{{- if .Site.Params.gitment.owner -}}
|
2018-07-09 17:41:34 +00:00
|
|
|
<div id="comments-gitment"></div>
|
2019-05-25 14:56:19 +00:00
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/default.min.css" crossorigin="anonymous">
|
|
|
|
<script src="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/gitment.browser.min.js" crossorigin="anonymous"></script>
|
2018-07-09 17:41:34 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
var gitment = new Gitment({
|
|
|
|
id: '{{ .Date }}',
|
|
|
|
title: '{{ .Title }}',
|
|
|
|
link: decodeURI(location.href),
|
|
|
|
desc: '{{ .Summary }}',
|
|
|
|
owner: '{{ .Site.Params.gitment.owner }}',
|
|
|
|
repo: '{{ .Site.Params.gitment.repo }}',
|
|
|
|
oauth: {
|
|
|
|
client_id: '{{ .Site.Params.gitment.clientId }}',
|
|
|
|
client_secret: '{{ .Site.Params.gitment.clientSecret }}'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
gitment.render('comments-gitment');
|
|
|
|
</script>
|
|
|
|
<noscript>Please enable JavaScript to view the <a href="https://github.com/imsun/gitment">comments powered by gitment.</a></noscript>
|
|
|
|
{{- end -}}
|
2018-03-11 06:47:13 +00:00
|
|
|
|
2018-04-05 13:44:09 +00:00
|
|
|
<!-- gitalk -->
|
|
|
|
{{- if .Site.Params.gitalk.owner -}}
|
2018-07-09 17:41:34 +00:00
|
|
|
<div id="gitalk-container"></div>
|
2018-11-05 13:19:43 +00:00
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css" crossorigin="anonymous">
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js" crossorigin="anonymous"></script>
|
2018-07-09 17:41:34 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
var gitalk = new Gitalk({
|
|
|
|
id: '{{ .Date }}',
|
|
|
|
title: '{{ .Title }}',
|
|
|
|
clientID: '{{ .Site.Params.gitalk.clientId }}',
|
|
|
|
clientSecret: '{{ .Site.Params.gitalk.clientSecret }}',
|
|
|
|
repo: '{{ .Site.Params.gitalk.repo }}',
|
|
|
|
owner: '{{ .Site.Params.gitalk.owner }}',
|
|
|
|
admin: ['{{ .Site.Params.gitalk.owner }}'],
|
|
|
|
body: decodeURI(location.href)
|
|
|
|
});
|
|
|
|
gitalk.render('gitalk-container');
|
|
|
|
</script>
|
|
|
|
<noscript>Please enable JavaScript to view the <a href="https://github.com/gitalk/gitalk">comments powered by gitalk.</a></noscript>
|
2018-04-05 13:44:09 +00:00
|
|
|
{{- end }}
|
2019-09-08 14:42:48 +00:00
|
|
|
|
2019-05-25 10:50:03 +00:00
|
|
|
<!-- valine -->
|
|
|
|
{{- if .Site.Params.valine.enable -}}
|
|
|
|
<!-- id 将作为查询条件 -->
|
|
|
|
{{- if .Site.Params.valine.visitor -}}
|
2019-09-08 14:42:48 +00:00
|
|
|
<span id="{{ .RelPermalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
|
2019-05-25 10:50:03 +00:00
|
|
|
<span class="post-meta-item-text">文章阅读量 </span>
|
|
|
|
<span class="leancloud-visitors-count">0</span>
|
|
|
|
<p></p>
|
|
|
|
</span>
|
|
|
|
{{- end }}
|
|
|
|
<div id="vcomments"></div>
|
|
|
|
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
|
|
|
|
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
new Valine({
|
|
|
|
el: '#vcomments' ,
|
|
|
|
appId: '{{ .Site.Params.valine.appId }}',
|
|
|
|
appKey: '{{ .Site.Params.valine.appKey }}',
|
2019-09-08 14:42:48 +00:00
|
|
|
notify: {{ .Site.Params.valine.notify }},
|
|
|
|
verify: {{ .Site.Params.valine.verify }},
|
|
|
|
avatar:'{{ .Site.Params.valine.avatar }}',
|
2019-05-25 10:50:03 +00:00
|
|
|
placeholder: '{{ .Site.Params.valine.placeholder }}',
|
|
|
|
visitor: {{ .Site.Params.valine.visitor }}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{{- end }}
|
2018-04-05 13:44:09 +00:00
|
|
|
|
2019-05-25 14:31:59 +00:00
|
|
|
<!-- utterances -->
|
|
|
|
{{- if .Site.Params.utterances.owner}}
|
|
|
|
<script src="https://utteranc.es/client.js"
|
|
|
|
repo="{{ .Site.Params.utterances.owner }}/{{ .Site.Params.utterances.repo }}"
|
|
|
|
issue-term="pathname"
|
|
|
|
theme="github-light"
|
|
|
|
crossorigin="anonymous"
|
|
|
|
async>
|
|
|
|
</script>
|
|
|
|
<noscript>Please enable JavaScript to view the <a href="https://github.com/utterance">comments powered by utterances.</a></noscript>
|
|
|
|
{{- end }}
|
|
|
|
|
2018-04-05 13:44:09 +00:00
|
|
|
{{- end }}
|