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/head.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/head.html')
| -rw-r--r-- | layouts/partials/head.html | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 8ae6c46f..a3e49dc5 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -10,7 +10,18 @@ {{ partial "head/siteinfo" . }} {{ partial "head/css" . }} - {{ partial "head/headscript" . }} + + <!-- Umami Tracking --> + <script> + if (window.location.hostname !== 'localhost') { + // track traffic + const script = document.createElement('script'); + script.defer = true; + script.src = 'https://cloud.umami.is/script.js'; + script.dataset.websiteId = 'ae8c2619-56eb-4577-ac31-9dc6ea44bda7'; + document.head.appendChild(script); + } + </script> <!-- Extra head --> {{ .Site.Params.extraHead | safeHTML }} |
