aboutsummaryrefslogtreecommitdiff
path: root/themes/hugo-theme-stack/layouts/partials/comments/provider/giscus.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/giscus.html
parent8e79098193fd0a8b65305dd8054cf7c424c60bc5 (diff)
Своя тема, полностью всё переделал
Diffstat (limited to 'themes/hugo-theme-stack/layouts/partials/comments/provider/giscus.html')
-rw-r--r--themes/hugo-theme-stack/layouts/partials/comments/provider/giscus.html52
1 files changed, 0 insertions, 52 deletions
diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/giscus.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/giscus.html
deleted file mode 100644
index 97fbb77..0000000
--- a/themes/hugo-theme-stack/layouts/partials/comments/provider/giscus.html
+++ /dev/null
@@ -1,52 +0,0 @@
-{{- with .Site.Params.comments.giscus -}}
-<script
- src="https://giscus.app/client.js"
- data-repo="{{- .repo -}}"
- data-repo-id="{{- .repoID -}}"
- data-category="{{- .category -}}"
- data-category-id="{{- .categoryID -}}"
- data-mapping="{{- default `title` .mapping -}}"
- data-strict="{{- default 0 .strict -}}"
- data-reactions-enabled="{{- default 1 .reactionsEnabled -}}"
- data-emit-metadata="{{- default 0 .emitMetadata -}}"
- data-input-position="{{- default `top` .inputPosition -}}"
- data-theme="{{- default `light` .lightTheme -}}"
- data-lang="{{- default (default `en` $.Language.LanguageCode) .lang -}}"
- data-loading="{{- .loading -}}"
- crossorigin="anonymous"
- async
-></script>
-<script>
- function setGiscusTheme(theme) {
- let giscus = document.querySelector("iframe.giscus-frame");
- if (giscus) {
- giscus.contentWindow.postMessage(
- {
- giscus: {
- setConfig: {
- theme: theme,
- },
- },
- },
- "https://giscus.app"
- );
- }
- }
-
- (function () {
- addEventListener("message", (e) => {
- if (event.origin !== "https://giscus.app") return;
- handler();
- });
- window.addEventListener("onColorSchemeChange", handler);
-
- function handler() {
- if (document.documentElement.dataset.scheme === "light") {
- setGiscusTheme('{{- default "light" .lightTheme -}}');
- } else {
- setGiscusTheme('{{- default "dark_dimmed" .darkTheme -}}');
- }
- }
- })();
-</script>
-{{- end -}}