summaryrefslogtreecommitdiff
path: root/layouts/partials/telegram_widget.html
diff options
context:
space:
mode:
authorReorx <novoreorx@gmail.com>2022-05-31 22:41:10 +0800
committerReorx <novoreorx@gmail.com>2022-05-31 22:41:10 +0800
commit5c47607d23d31bda44f2f660df372a924daa2381 (patch)
tree314fb7db71f0a7b57d342ace9efdb20035d93e12 /layouts/partials/telegram_widget.html
parent81f885a7b99ac845348ba750a9419f50632fa985 (diff)
support specifying comment system in both config and front matter
in config: site.Params.defaultCommentSystems in front matter: pageCommentSystems
Diffstat (limited to 'layouts/partials/telegram_widget.html')
-rw-r--r--layouts/partials/telegram_widget.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/layouts/partials/telegram_widget.html b/layouts/partials/telegram_widget.html
index 430c72e..1f614c7 100644
--- a/layouts/partials/telegram_widget.html
+++ b/layouts/partials/telegram_widget.html
@@ -1,4 +1,3 @@
-{{- with site.Params.commentSystem.telegramWidget }}
<div class="telegram-widget-container"></div>
<script>
@@ -34,6 +33,9 @@
if (!toggleThemeCallbacks) {
return;
}
+ if (document.getElementsByClassName('telegram-widget-container').length === 0) {
+ return;
+ }
toggleThemeCallbacks.push((isDark) => {
// console.log('window toggle-theme for telegram widget')
@@ -48,4 +50,3 @@
});
})();
</script>
-{{- end }}