aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/comments.html
diff options
context:
space:
mode:
authorolOwOlo <26087907+olOwOlo@users.noreply.github.com>2017-08-27 22:38:42 +0800
committerolOwOlo <26087907+olOwOlo@users.noreply.github.com>2017-08-27 22:38:42 +0800
commit3c6cb7f29631dfcdd954e7cbd5d2370efe7eb827 (patch)
treed374e090981dda28452dbd13400e377b9cc06277 /layouts/partials/comments.html
🎉 first commit
Diffstat (limited to 'layouts/partials/comments.html')
-rw-r--r--layouts/partials/comments.html35
1 files changed, 35 insertions, 0 deletions
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html
new file mode 100644
index 0000000..fea1a33
--- /dev/null
+++ b/layouts/partials/comments.html
@@ -0,0 +1,35 @@
+{{ if and .IsPage (ne .Params.comment false) }}
+ <!-- Disqus -->
+ {{- if .Site.DisqusShortname -}}
+ <div id="disqus_thread"></div>
+ <script type="text/javascript">
+ (function() {
+ // Don't ever inject Disqus on localhost--it creates unwanted
+ // discussions from 'localhost:1313' on your Disqus account...
+ if (window.location.hostname === 'localhost') return;
+
+ 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);
+ })();
+ </script>
+ <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+ <a href="http://disqus.com/" class="dsq-brlink" target="_blank">comments powered by <span class="logo-disqus">Disqus</span></a>
+ {{- end }}
+
+ <!-- changyan -->
+ {{- if and .Site.Params.changyanAppid .Site.Params.changyanAppkey -}}
+ <div id="SOHUCS"></div>
+ <script type="text/javascript">
+ (function(){
+ if (window.location.hostname === 'localhost') return;
+
+ var appid = '{{ .Site.Params.changyanAppid }}';
+ var conf = '{{ .Site.Params.changyanAppkey }}';
+ var width = window.innerWidth || document.documentElement.clientWidth;
+ if (width < 960) {window.document.write('<script async id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="http://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.async = true;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("http://changyan.sohu.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})}); }
+ })();
+ </script>
+ {{- end }}
+{{- end }} \ No newline at end of file