diff options
| author | Eltrac <hi@guhub.cn> | 2025-03-07 17:26:06 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-03-07 17:26:06 +0800 |
| commit | e2c3e465ce689f3b21cf27bc256834d77f7440a3 (patch) | |
| tree | 7511a71ed06a6d8317cff41004ff3b642b9301ba /layouts/partials/scripts.html | |
| parent | 28127d287f59e1b63ca0e1d87856f34afaa58ac3 (diff) | |
refactor: load giscus only with function
Former-commit-id: a2f531b7311d485c284121a05ff917be843e54f9
Diffstat (limited to 'layouts/partials/scripts.html')
| -rw-r--r-- | layouts/partials/scripts.html | 24 |
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)' |
