diff options
author | Dillon <dillonzq@outlook.com> | 2020-05-04 15:28:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 15:28:27 +0300 |
commit | 7dfa964d3fd54b6490316c234e0694e7db74a004 (patch) | |
tree | 162d42e1923ffc658fa71b4d5a2462761aa328db /layouts/partials/comment.html | |
parent | 44955320ba182ac92bc7d6412c9254e833e7c2f8 (diff) |
feat(comment): add Utterances comment system (#317)
Diffstat (limited to 'layouts/partials/comment.html')
-rw-r--r-- | layouts/partials/comment.html | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html index 29b5a4a..fac888e 100644 --- a/layouts/partials/comment.html +++ b/layouts/partials/comment.html @@ -1,6 +1,6 @@ {{- $cdn := .Scratch.Get "cdn" | default dict -}} {{- $fingerprint := .Scratch.Get "fingerprint" -}} -{{- $comment := .Scratch.Get "comment" | default (dict "disqus" dict "gitalk" dict "valine" dict "facebook" dict "telegram" dict "commento" dict) -}} +{{- $comment := .Scratch.Get "comment" | default (dict "disqus" dict "gitalk" dict "valine" dict "facebook" dict "telegram" dict "commento" dict "utterances" dict) -}} {{- $commentConfig := dict -}} {{- if $comment.enable -}} @@ -107,6 +107,20 @@ Please enable JavaScript to view the comments powered by <a href="https://commento.io/">Commento</a>. </noscript> {{- end -}} + + {{- /* Utterances Comment System */ -}} + {{- if $comment.utterances.enable -}} + <div id="utterances"></div> + {{- $utterances := $comment.utterances -}} + {{- $commentConfig = dict "repo" $utterances.repo | dict "utterances" | merge $commentConfig -}} + {{- $commentConfig = $utterances.issueTerm | default "pathname" | dict "issueTerm" | dict "utterances" | merge $commentConfig -}} + {{- $commentConfig = dict "label" $utterances.label | dict "utterances" | merge $commentConfig -}} + {{- $commentConfig = $utterances.lightTheme | default "github-light" | dict "lightTheme" | dict "utterances" | merge $commentConfig -}} + {{- $commentConfig = $utterances.darkTheme | default "github-dark" | dict "darkTheme" | dict "utterances" | merge $commentConfig -}} + <noscript> + Please enable JavaScript to view the comments powered by <a href="https://utteranc.es/">Utterances</a>. + </noscript> + {{- end -}} </div> {{- end -}} |