summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorReorx <novoreorx@gmail.com>2022-06-01 16:55:45 +0800
committerReorx <novoreorx@gmail.com>2022-06-01 16:55:45 +0800
commit0aa7a35ee0535a0ba5bdde7ed1a6c4fa12b3008d (patch)
treeeed2a48d020fc216f3bbcb9554a4397ae47de018 /layouts
parent66447d9a38d354f80f5dda2cd37a2701bb62d9b1 (diff)
add .comment-box class, comment system use id; remove unused comments_script.html
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/comments_script.html5
-rw-r--r--layouts/partials/disqus.html2
-rw-r--r--layouts/partials/page_footer.html4
-rw-r--r--layouts/partials/static_comments.html0
-rw-r--r--layouts/partials/telegram_widget.html10
5 files changed, 6 insertions, 15 deletions
diff --git a/layouts/partials/comments_script.html b/layouts/partials/comments_script.html
deleted file mode 100644
index 8663497..0000000
--- a/layouts/partials/comments_script.html
+++ /dev/null
@@ -1,5 +0,0 @@
-{{- /* You can add your own layouts/comments_script.html to override this file */ -}}
-
-{{- with site.Params.commentSystem.disqus -}}
- {{ partial "disqus_script.html" . }}
-{{- end -}}
diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html
index e6b9b33..d1e80f8 100644
--- a/layouts/partials/disqus.html
+++ b/layouts/partials/disqus.html
@@ -1,4 +1,4 @@
-<div class="disqus-container">
+<div class="comments-box">
<div id="disqus_thread"></div>
</div>
diff --git a/layouts/partials/page_footer.html b/layouts/partials/page_footer.html
index 1ad0e41..3c55704 100644
--- a/layouts/partials/page_footer.html
+++ b/layouts/partials/page_footer.html
@@ -128,7 +128,3 @@
mediumZoom('.post-content img:not([no-zoom])');
</script>
{{- end }}
-
-{{- if not (.Param "noComments") }}
- {{- partial "comments_script.html" . }}
-{{ end }}
diff --git a/layouts/partials/static_comments.html b/layouts/partials/static_comments.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/layouts/partials/static_comments.html
diff --git a/layouts/partials/telegram_widget.html b/layouts/partials/telegram_widget.html
index 1f614c7..786f19a 100644
--- a/layouts/partials/telegram_widget.html
+++ b/layouts/partials/telegram_widget.html
@@ -1,4 +1,6 @@
-<div class="telegram-widget-container"></div>
+<div class="comments-box">
+ <div id="telegram-widget-container"></div>
+</div>
<script>
(function() {
@@ -22,8 +24,9 @@
s.setAttribute(key, attrs[key]);
}
- const container = document.querySelector('.telegram-widget-container')
+ const container = document.querySelector('#telegram-widget-container')
container.innerHTML = '';
+ // telegram widget script must be added to the position where you want it to be displayed
container.appendChild(s);
})();
</script>
@@ -33,9 +36,6 @@
if (!toggleThemeCallbacks) {
return;
}
- if (document.getElementsByClassName('telegram-widget-container').length === 0) {
- return;
- }
toggleThemeCallbacks.push((isDark) => {
// console.log('window toggle-theme for telegram widget')