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-02-11 14:10:09 +01:00
{{- with .Site.Params.disqus.shortname -}}
2019-08-05 15:15:01 +02:00
< div id = "disqus_thread" > < / div >
2020-02-11 14:10:09 +01:00
< script src = "https://{{ . }}.disqus.com/embed.js" > < / script >
2019-08-05 15:15:01 +02:00
< 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 -}}
2020-02-11 14:10:09 +01:00
< 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 -}}
2020-02-13 18:30:33 +01:00
{{- $res := resources.Get "css/lib/gitalk/gitalk.css" | minify -}}
2019-08-22 20:54:26 +02:00
< 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 -}}
2020-02-13 18:30:33 +01:00
{{- $res := resources.Get "js/lib/gitalk/gitalk.min.js" -}}
2019-08-22 20:54:26 +02:00
< script src = "{{ $res.RelPermalink }}" > < / script >
2020-01-31 15:53:04 +01:00
{{- end -}}
2020-02-11 14:10:09 +01:00
< script >
var gitalk = new Gitalk({
2020-02-11 14:40:58 +01:00
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),
2020-02-11 14:10:09 +01:00
});
2020-02-11 14:40:58 +01:00
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 -}}
2020-02-11 14:10:09 +01:00
< div id = "valine_container" > < / div >
2020-01-31 15:53:04 +01:00
{{- if .Site.Params.cdn.valine_js -}}
{{- .Site.Params.cdn.valine_js | safeHTML -}}
{{- else -}}
2020-02-13 18:30:33 +01:00
{{- $res := resources.Get "js/lib/valine/Valine.min.js" -}}
2019-11-23 06:42:26 +01:00
< script src = "{{ $res.RelPermalink }}" > < / script >
2020-01-31 15:53:04 +01:00
{{- end -}}
2020-02-11 14:10:09 +01:00
< script >
new Valine({
2020-02-11 14:40:58 +01:00
el: '#valine_container',
appId: '{{ .Site.Params.valine.appId }}',
appKey: '{{ .Site.Params.valine.appKey }}',
2020-02-11 14:10:09 +01:00
{{- with .Site.Params.valine.placeholder -}}
2020-02-11 14:40:58 +01:00
placeholder: '{{ . }}',
2020-02-11 14:10:09 +01:00
{{- end -}}
{{- if .Site.Params.valine.notify -}}
notify: true,
{{- end -}}
{{- if .Site.Params.valine.verify -}}
verify: true,
{{- end -}}
{{- with .Site.Params.valine.avatar -}}
2020-02-11 14:40:58 +01:00
avatar: '{{ . }}',
2020-02-11 14:10:09 +01:00
{{- end -}}
{{- with .Site.Params.valine.meta -}}
meta: {{ . | safeJS }},
{{- end -}}
{{- with .Site.Params.valine.pageSize -}}
pageSize: {{ . | safeJS }},
{{- end -}}
2020-02-11 14:40:58 +01:00
lang: '{{ T "valineLang" }}',
2020-02-11 14:10:09 +01:00
{{- if .Site.Params.valine.visitor -}}
visitor: true,
{{- end -}}
{{- if .Site.Params.valine.recordIP -}}
recordIP: true,
{{- end -}}
});
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
< 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-11 14:10:09 +01:00
< script
async
defer
crossorigin="anonymous"
src="https://connect.facebook.net/{{ .Site.Params.facebook.languageCode }}/sdk.js#xfbml=1& version=v5.0& appId={{ .Site.Params.facebook.appId }}& autoLogAppEvents=1"
>< / script >
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-02-06 17:10:00 +01:00
{{- end -}}