Fix .Site.IsServer error in Hugo >= 0.132.0 (#96)

The `.Site.IsServer` no longer works since Hugo v0.132.0. Use `hugo.IsServer` since Hugo v0.120.0

Fixes #94
This commit is contained in:
Vimux 2024-08-15 14:29:44 -04:00 committed by GitHub
parent e4bab35fd1
commit 8b4c646cb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,7 +35,13 @@
{{- with ((.Site.GetPage "home").OutputFormats.Get "manifest") }}
<link rel="manifest" href="{{ "manifest.json" | relURL }}">
{{- end }}
{{- if not .Site.IsServer }}
{{- $server := "" }}
{{- if ge (int (index (split hugo.Version ".") 1)) "120" }}
{{- $server = hugo.IsServer }}
{{- else }}
{{- $server = .Site.IsServer }}
{{- end }}
{{- if not $server -}}
{{ template "_internal/google_analytics.html" . }}
{{- end }}
</head>