diff options
| author | Eltrac <hi@guhub.cn> | 2025-03-31 15:48:06 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-03-31 15:48:06 +0800 |
| commit | e2acf0e10c83acd322853aac9fab341c8d91b7f3 (patch) | |
| tree | fdbc8d8ce72618c05c9b36a2d347e16dafeb2729 /layouts/partials/components/comment.html | |
| parent | ed628a0a4983dd0b21030b365558b514d7ac6d1f (diff) | |
refactor: encapsulate giscus and heatmap component
- move giscus script to comment.html
- move heatmap dependency to its component file to avoid loading it when not needed
- delete headscript partial
Diffstat (limited to 'layouts/partials/components/comment.html')
| -rw-r--r-- | layouts/partials/components/comment.html | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/layouts/partials/components/comment.html b/layouts/partials/components/comment.html index f5ec95d3..b0b4ed47 100644 --- a/layouts/partials/components/comment.html +++ b/layouts/partials/components/comment.html @@ -28,5 +28,20 @@ {{ if eq .Site.Language.Lang "zh" }} <p style="text-align:center">你也可以加入本站的 <a href="https://t.me/teaparty418" target="_blank">Telegram 群组</a>参与讨论</p> {{ end }} - <script>loadGiscus()</script> + <!-- giscus script --> + <script src="https://giscus.app/client.js" + data-repo="{{ .Site.Params.giscus.repo }}" + data-repo-id="{{ .Site.Params.giscus.repoId }}" + data-category="{{ .Site.Params.giscus.category }}" + data-category-id="{{ .Site.Params.giscus.categoryId }}" + data-mapping="{{ .Site.Params.giscus.mapping }}" + data-strict="{{ .Site.Params.giscus.strict }}" + data-reactions-enabled="{{ .Site.Params.giscus.reactionsEnabled }}" + data-emit-metadata="{{ .Site.Params.giscus.emitMetadata }}" + data-input-position="{{ .Site.Params.giscus.inputPosition }}" + data-theme="{{ .Site.Params.giscus.theme }}" + data-lang="{{ T "lang" }}" + crossorigin="anonymous" + async> + </script> </div> |
