aboutsummaryrefslogtreecommitdiff
path: root/themes/hugo-theme-stack/layouts/partials/comments/provider/utterances.html
diff options
context:
space:
mode:
authorAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-11-16 19:32:18 +0300
committerAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-11-17 01:28:57 +0300
commit239d68f94c6250276850fbe95eaa6cdd5c38fb26 (patch)
treec576da169afc442f51eae6213ad0ff749ed86589 /themes/hugo-theme-stack/layouts/partials/comments/provider/utterances.html
parent8e79098193fd0a8b65305dd8054cf7c424c60bc5 (diff)
Своя тема, полностью всё переделал
Diffstat (limited to 'themes/hugo-theme-stack/layouts/partials/comments/provider/utterances.html')
-rw-r--r--themes/hugo-theme-stack/layouts/partials/comments/provider/utterances.html46
1 files changed, 0 insertions, 46 deletions
diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/utterances.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/utterances.html
deleted file mode 100644
index b1e370b..0000000
--- a/themes/hugo-theme-stack/layouts/partials/comments/provider/utterances.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<script src="https://utteranc.es/client.js"
- repo="{{ .Site.Params.comments.utterances.repo }}"
- issue-term="{{ .Site.Params.comments.utterances.issueTerm }}"
- {{ with .Site.Params.comments.utterances.label }}
- label="{{ . }}"
- {{ end }}
- crossorigin="anonymous"
- async
- >
-</script>
-
-<style>
- .utterances {
- max-width: unset;
- }
-</style>
-
-<script>
- let utterancesLoaded = false;
-
- function setUtterancesTheme(theme) {
- let utterances = document.querySelector('.utterances iframe');
- if (utterances) {
- utterances.contentWindow.postMessage(
- {
- type: 'set-theme',
- theme: `github-${theme}`
- },
- 'https://utteranc.es'
- );
- }
- }
-
- addEventListener('message', event => {
- if (event.origin !== 'https://utteranc.es') return;
-
- /// Called when Utterances is ready
- utterancesLoaded = true;
- setUtterancesTheme(document.documentElement.dataset.scheme)
- });
-
- window.addEventListener('onColorSchemeChange', (e) => {
- if (!utterancesLoaded) return;
- setUtterancesTheme(e.detail)
- })
-</script>