LoveIt/layouts/partials/comment.html

102 lines
4.4 KiB
HTML
Raw Normal View History

2020-01-31 15:53:04 +01:00
{{- if eq (getenv "HUGO_ENV") "production" | and .IsPage | and (ne .Params.comment false) -}}
{{- /* Disqus Comment System */ -}}
{{- with .Site.Params.disqus.shortname -}}
2019-08-05 15:15:01 +02:00
<div id="disqus_thread"></div>
<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
{{- /* 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 -}}
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 -}}
<script>
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>
<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
{{- /* Valine Comment System */ -}}
2019-08-02 10:16:59 +02:00
{{- if .Site.Params.valine.enable -}}
<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" -}}
<script src="{{ $res.RelPermalink }}"></script>
2020-01-31 15:53:04 +01:00
{{- end -}}
<script>
new Valine({
el: '#valine_container',
appId: '{{ .Site.Params.valine.appId }}',
appKey: '{{ .Site.Params.valine.appKey }}',
{{- with .Site.Params.valine.placeholder -}}
placeholder: '{{ . }}',
{{- end -}}
{{- if .Site.Params.valine.notify -}}
notify: true,
{{- end -}}
{{- if .Site.Params.valine.verify -}}
verify: true,
{{- end -}}
{{- with .Site.Params.valine.avatar -}}
avatar: '{{ . }}',
{{- end -}}
{{- with .Site.Params.valine.meta -}}
meta: {{ . | safeJS }},
{{- end -}}
{{- with .Site.Params.valine.pageSize -}}
pageSize: {{ . | safeJS }},
{{- end -}}
lang: '{{ T "valineLang" }}',
{{- 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>
<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
{{- /* 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>
<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>
<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 -}}