summaryrefslogtreecommitdiff
path: root/layouts/partials/scripts.html
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-03-07 17:26:06 +0800
committerEltrac <hi@guhub.cn>2025-03-07 17:26:06 +0800
commita2f531b7311d485c284121a05ff917be843e54f9 (patch)
tree0c3cb1f97f0bc7f5947065504b4e3cd528c89fcf /layouts/partials/scripts.html
parentcdf84fff166027231c9e49c4d83e1d8c4ab11de0 (diff)
refactor: load giscus only with function
Diffstat (limited to 'layouts/partials/scripts.html')
-rw-r--r--layouts/partials/scripts.html24
1 files changed, 0 insertions, 24 deletions
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index 956e88f5..7757e0c0 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -25,30 +25,6 @@ loadToc();
/* === littlefoot === */
littlefoot.littlefoot(littlefootOptions)
-/* === giscus === */
-function loadGiscus() {
- const giscusContainer = document.querySelector('.giscus'); // Make sure this matches your Giscus container class
- if (giscusContainer) {
- const script = document.createElement('script');
- script.src = 'https://giscus.app/client.js';
- script.setAttribute('data-repo', '{{ .Site.Params.giscus.repo }}');
- script.setAttribute('data-repo-id', '{{ .Site.Params.giscus.repoId }}');
- script.setAttribute('data-category', '{{ .Site.Params.giscus.category }}');
- script.setAttribute('data-category-id', '{{ .Site.Params.giscus.categoryId }}');
- script.setAttribute('data-mapping', '{{ .Site.Params.giscus.mapping }}');
- script.setAttribute('data-strict', '{{ .Site.Params.giscus.strict }}');
- script.setAttribute('data-reactions-enabled', '{{ .Site.Params.giscus.reactionsEnabled }}');
- script.setAttribute('data-emit-metadata', '{{ .Site.Params.giscus.emitMetadata }}');
- script.setAttribute('data-input-position', '{{ .Site.Params.giscus.inputPosition }}');
- script.setAttribute('data-theme', '{{ .Site.Params.giscus.theme }}');
- script.setAttribute('data-lang', '{{ T "lang" }}');
- script.crossOrigin = 'anonymous';
- script.async = true;
-
- giscusContainer.appendChild(script);
- }
-}
-
/* === swup === */
const swup = new Swup({
linkSelector: 'a[href]:not(.no-swup)'