From 65a963496bc57360c32d0c6b1d0fde1fe15bbe8d Mon Sep 17 00:00:00 2001 From: Eltrac Date: Mon, 31 Mar 2025 15:48:06 +0800 Subject: 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 Former-commit-id: e2acf0e10c83acd322853aac9fab341c8d91b7f3 --- layouts/partials/components/comment.html | 17 +++++++++++++- layouts/partials/components/heatmap.html | 3 +++ layouts/partials/head.html | 13 ++++++++++- layouts/partials/head/headscript.html | 39 -------------------------------- 4 files changed, 31 insertions(+), 41 deletions(-) delete mode 100644 layouts/partials/head/headscript.html 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" }}

你也可以加入本站的 Telegram 群组参与讨论

{{ end }} - + + diff --git a/layouts/partials/components/heatmap.html b/layouts/partials/components/heatmap.html index 0152c982..ab45615e 100644 --- a/layouts/partials/components/heatmap.html +++ b/layouts/partials/components/heatmap.html @@ -2,6 +2,9 @@
+ + + {{ .Site.Params.extraHead | safeHTML }} diff --git a/layouts/partials/head/headscript.html b/layouts/partials/head/headscript.html deleted file mode 100644 index ed68e4c8..00000000 --- a/layouts/partials/head/headscript.html +++ /dev/null @@ -1,39 +0,0 @@ - - - -- cgit v1.2.3