mirror of
https://github.com/imfing/hextra.git
synced 2025-07-08 03:07:23 -04:00
Compare commits
2 Commits
v0.8.2
...
df0b8d5f52
Author | SHA1 | Date | |
---|---|---|---|
df0b8d5f52 | |||
430a25fbf9 |
@ -1,4 +1,10 @@
|
||||
{{- with site.Config.Services.GoogleAnalytics.ID }}
|
||||
{{/* site.GoogleAnalytics is deprecated in Hugo v0.120.0 */}}
|
||||
{{/* it will be removed in a future version */}}
|
||||
{{- $gtagID := "" -}}
|
||||
{{- with site.GoogleAnalytics -}}{{ $gtagID = . }}{{- end -}}
|
||||
{{- with site.Config.Services.GoogleAnalytics.ID -}}{{ $gtagID = . }}{{- end -}}
|
||||
|
||||
{{- with $gtagID }}
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
|
||||
<script>
|
||||
|
@ -31,11 +31,17 @@
|
||||
|
||||
|
||||
<!-- Google Analytics -->
|
||||
{{- if and (eq hugo.Environment "production") .Site.Config.Services.GoogleAnalytics.ID }}
|
||||
{{- if and (eq hugo.Environment "production") (or .Site.GoogleAnalytics .Site.Config.Services.GoogleAnalytics.ID) }}
|
||||
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin />
|
||||
{{ partial "google-analytics.html" . }}
|
||||
{{- end }}
|
||||
|
||||
<!-- Umami -->
|
||||
{{- if and hugo.IsProduction .Site.Params.umami.serverURL .Site.Params.umami.id }}
|
||||
{{ partial "umami.html" . }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
<script>
|
||||
/* Initialize light/dark mode */
|
||||
const defaultTheme = '{{ site.Params.theme.default | default `system`}}';
|
||||
|
1
layouts/partials/umami.html
Normal file
1
layouts/partials/umami.html
Normal file
@ -0,0 +1 @@
|
||||
<script async defer src="https://{{ .Site.Params.umami.serverURL }}/{{ .Site.Params.umami.trackerScriptName | default "umami.js" }}" data-website-id="{{ .Site.Params.umami.id }}" ></script>
|
@ -7,6 +7,6 @@ command = "cd exampleSite && hugo --gc --minify --themesDir ../.. -b ${DEPLOY_PR
|
||||
ignore = "false"
|
||||
|
||||
[build.environment]
|
||||
HUGO_VERSION = "0.132.2"
|
||||
HUGO_VERSION = "0.126.1"
|
||||
GO_VERSION = "1.22.3"
|
||||
NODE_VERSION = "22.2.0"
|
||||
|
Reference in New Issue
Block a user