diff options
author | Dillon <dillonzq@outlook.com> | 2022-05-24 16:46:35 +0300 |
---|---|---|
committer | Dillon <dillonzq@outlook.com> | 2022-05-24 16:46:35 +0300 |
commit | 96d2523bcc108bbd3c68dbf240355cbaf23557e9 (patch) | |
tree | ee4e90257a04a381d796a6483511faa9a623e73d /layouts | |
parent | f0e0661c1c018fbdf7b59af389e16e300bd31420 (diff) |
feat: use partial plugin/script.html for comments script
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/comment.html | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html index 23cedee9..f849740d 100644 --- a/layouts/partials/comment.html +++ b/layouts/partials/comment.html @@ -78,27 +78,27 @@ {{- $telegram := $comment.telegram | default dict -}} {{- if $telegram.enable -}} <div id="telegram-comments" class="comment"> - {{- $attr := printf `data-comments-app-website="%v"` $telegram.siteID -}} - {{- $attr = printf `%v data-limit="%v"` $attr ($telegram.limit | default 5) -}} - {{- with $telegram.height -}} - {{- $attr = printf `%v data-height="%v"` $attr . -}} - {{- end -}} - {{- with $telegram.color -}} - {{- $attr = printf `%v data-color="%v"` $attr . -}} - {{- end -}} - {{- if $telegram.colorful -}} - {{- $attr = printf `%v data-colorful="1"` $attr -}} - {{- end -}} - {{- if $telegram.dislikes -}} - {{- $attr = printf `%v data-dislikes="1"` $attr -}} - {{- end -}} - {{- if $telegram.outlined -}} - {{- $attr = printf `%v data-outlined="1"` $attr -}} - {{- end -}} - <script type="text/javascript" src="https://comments.app/js/widget.js?3" {{ with $attr }} {{ . | safeHTMLAttr }}{{ end }}></script> - <noscript> - Please enable JavaScript to view the comments powered by <a href="https://comments.app/">Telegram Comments</a>. - </noscript> + {{- $attr := printf `data-comments-app-website="%v"` $telegram.siteID -}} + {{- $attr = printf `%v data-limit="%v"` $attr ($telegram.limit | default 5) -}} + {{- with $telegram.height -}} + {{- $attr = printf `%v data-height="%v"` $attr . -}} + {{- end -}} + {{- with $telegram.color -}} + {{- $attr = printf `%v data-color="%v"` $attr . -}} + {{- end -}} + {{- if $telegram.colorful -}} + {{- $attr = printf `%v data-colorful="1"` $attr -}} + {{- end -}} + {{- if $telegram.dislikes -}} + {{- $attr = printf `%v data-dislikes="1"` $attr -}} + {{- end -}} + {{- if $telegram.outlined -}} + {{- $attr = printf `%v data-outlined="1"` $attr -}} + {{- end -}} + {{- dict "Source" "https://comments.app/js/widget.js?3" "Defer" true "Attr" $attr | partial "plugin/script.html" -}} + <noscript> + Please enable JavaScript to view the comments powered by <a href="https://comments.app/">Telegram Comments</a>. + </noscript> </div> {{- end -}} |