From 01de8bace70ec67580b8bbcef81448665dee739a Mon Sep 17 00:00:00 2001 From: Matt Esch Date: Wed, 24 Jun 2020 11:49:51 +0100 Subject: [PATCH 1/2] inline telegram script --- layouts/partials/comment.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html index 0382ae113..48ac24e7f 100644 --- a/layouts/partials/comment.html +++ b/layouts/partials/comment.html @@ -77,7 +77,7 @@ {{- /* Telegram Comments System */ -}} {{- $telegram := $comment.telegram | default dict -}} {{- if $telegram.enable -}} -
+
{{- $attr := printf `data-comments-app-website="%v"` $telegram.siteID -}} {{- $attr = printf `%v data-limit="%v"` $attr ($telegram.limit | default 5) -}} {{- with $telegram.height -}} @@ -95,10 +95,11 @@ {{- if $telegram.outlined -}} {{- $attr = printf `%v data-outlined="1"` $attr -}} {{- end -}} - {{- dict "Source" "https://comments.app/js/widget.js?2" "Defer" true "Attr" $attr | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} + +
{{- end -}} {{- /* Commento Comment System */ -}} From 96d2523bcc108bbd3c68dbf240355cbaf23557e9 Mon Sep 17 00:00:00 2001 From: Dillon Date: Tue, 24 May 2022 21:46:35 +0800 Subject: [PATCH 2/2] feat: use partial plugin/script.html for comments script --- layouts/partials/comment.html | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html index 23cedee9b..f849740dd 100644 --- a/layouts/partials/comment.html +++ b/layouts/partials/comment.html @@ -78,27 +78,27 @@ {{- $telegram := $comment.telegram | default dict -}} {{- if $telegram.enable -}}
- {{- $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 -}} - - + {{- $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" -}} +
{{- end -}}