2020-01-31 15:53:04 +01:00
{{- if eq (getenv "HUGO_ENV") "production" | and .IsPage | and (ne .Params.comment false) -}}
2020-02-03 11:38:10 +01:00
{{- /* Disqus Comment System */ -}}
2020-01-31 11:46:28 +01:00
{{- if .Site.Params.disqus.shortname -}}
2019-08-05 15:15:01 +02:00
< div id = "disqus_thread" > < / div >
< script type = "text/javascript" >
(function() {
// Don't ever inject Disqus on localhost--it creates unwanted
2020-02-03 11:38:10 +01:00
// discussions from "localhost" on your Disqus account...
2019-08-05 15:15:01 +02:00
if (window.location.hostname == "localhost")
return;
2019-08-16 21:40:34 +02:00
var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true;
2020-01-31 11:46:28 +01:00
var disqus_shortname = "{{ .Site.Params.disqus.shortname }}";
2019-08-16 21:40:34 +02:00
dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
(document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq);
2019-08-05 15:15:01 +02:00
})();
< / script >
< noscript > Please enable JavaScript to view the < a href = "https://disqus.com/?ref_noscript" > comments powered by Disqus.< / a > < / noscript >
2019-08-02 10:16:59 +02:00
{{- end -}}
2019-03-15 10:15:32 +01:00
2020-02-03 11:38:10 +01:00
{{- /* Gitalk Comment System */ -}}
2019-08-02 10:16:59 +02:00
{{- if .Site.Params.gitalk.owner -}}
< div id = "gitalk-container" > < / div >
2020-01-31 15:53:04 +01:00
{{- if .Site.Params.cdn.gitalk_css -}}
{{- .Site.Params.cdn.gitalk_css | safeHTML -}}
{{- else -}}
2019-08-22 20:54:26 +02:00
{{- $res := resources.Get "css/lib/gitalk/gitalk.css" | resources.Minify -}}
< link rel = "stylesheet" href = "{{ $res.RelPermalink }}" >
2020-01-31 15:53:04 +01:00
{{- end -}}
{{- if .Site.Params.cdn.gitalk_js -}}
{{ .Site.Params.cdn.gitalk_js | safeHTML -}}
{{- else -}}
2019-08-22 20:54:26 +02:00
{{- $res := resources.Get "js/lib/gitalk/gitalk.min.js" | resources.Minify -}}
< script src = "{{ $res.RelPermalink }}" > < / script >
2020-01-31 15:53:04 +01:00
{{- end -}}
2019-08-02 10:16:59 +02:00
< script type = "text/javascript" >
2020-02-03 11:38:10 +01:00
(function () {
// Don't ever inject Gitalk on localhost--it creates unwanted
// discussions from "localhost" on your Gitalk account...
if (window.location.hostname == "localhost")
return;
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");
})();
2019-08-02 10:16:59 +02:00
< / script >
2020-02-03 11:38:10 +01:00
< noscript > Please enable JavaScript to view the < a href = "https://github.com/gitalk/gitalk" > comments powered by Gitalk.< / a > < / noscript >
2019-08-05 15:15:01 +02:00
{{- end -}}
2019-03-15 10:15:32 +01:00
2020-02-03 11:38:10 +01:00
{{- /* Valine Comment System */ -}}
2019-08-02 10:16:59 +02:00
{{- if .Site.Params.valine.enable -}}
< div id = "vcomments" > < / div >
2020-01-31 15:53:04 +01:00
{{- if .Site.Params.cdn.valine_js -}}
{{- .Site.Params.cdn.valine_js | safeHTML -}}
{{- else -}}
2019-08-22 20:54:26 +02:00
{{- $res := resources.Get "js/lib/valine/Valine.min.js" | resources.Minify -}}
2019-11-23 06:42:26 +01:00
< script src = "{{ $res.RelPermalink }}" > < / script >
2020-01-31 15:53:04 +01:00
{{- end -}}
2019-08-02 10:16:59 +02:00
< script type = "text/javascript" >
2020-02-03 11:38:10 +01:00
(function () {
// Don't ever inject Valine on localhost--it creates unwanted
// discussions from "localhost" on your Valine account...
if (window.location.hostname == "localhost")
return;
new Valine({
el: "#vcomments",
appId: "{{ .Site.Params.valine.appId }}",
appKey: "{{ .Site.Params.valine.appKey }}",
meta: ["nick", "mail"],
notify: "{{ .Site.Params.valine.notify }}",
verify: "{{ .Site.Params.valine.verify }}",
avatar: "{{ .Site.Params.valine.avatar }}",
placeholder: "{{ .Site.Params.valine.placeholder }}",
visitor: "{{ .Site.Params.valine.visitor }}",
recordIP: "{{ .Site.Params.valine.recordIP }}",
lang: "{{ T `valineLang` }}",
});
})();
2019-08-02 10:16:59 +02:00
< / script >
2020-02-03 11:38:10 +01:00
< noscript > Please enable JavaScript to view the < a href = "https://valine.js.org/" > comments powered by Valine.< / a > < / noscript >
2019-08-02 10:16:59 +02:00
{{- end -}}
2020-01-04 03:25:34 +01:00
2020-02-03 11:38:10 +01:00
{{- /* Facebook Comment System */ -}}
2020-01-04 03:25:34 +01:00
{{- if .Site.Params.facebook.enable -}}
< div id = "fb-root" > < / div >
2020-01-30 06:17:42 +01:00
< script
async
defer
crossorigin="anonymous"
2020-01-04 03:50:58 +01:00
src="https://connect.facebook.net/{{ .Site.Params.facebook.languageCode }}/sdk.js#xfbml=1& version=v5.0& appId={{ .Site.Params.facebook.appId }}& autoLogAppEvents=1"
2020-01-04 03:25:34 +01:00
>< / script >
2020-01-30 06:17:42 +01:00
< div
class="fb-comments"
2020-01-04 03:25:34 +01:00
data-href="{{ .Site.Params.baseURL }}{{ .Permalink | absURL }}"
2020-01-30 06:17:42 +01:00
data-width="{{ .Site.Params.facebook.width }}"
2020-01-04 03:25:34 +01:00
data-numposts="{{ .Site.Params.facebook.numPosts }}"
>< / div >
2020-02-03 11:38:10 +01:00
< noscript > Please enable JavaScript to view the < a href = "https://developers.facebook.com/docs/plugins/comments/" > comments powered by Facebook.< / a > < / noscript >
2020-01-04 03:25:34 +01:00
{{- end -}}
2020-01-31 15:53:04 +01:00
{{- end -}}