Skip to content

Commit

Permalink
Fix .Site.IsServer error in Hugo >= 0.132.0 (#96)
Browse files Browse the repository at this point in the history
The `.Site.IsServer` no longer works since Hugo v0.132.0. Use `hugo.IsServer` since Hugo v0.120.0

Fixes #94
  • Loading branch information
Vimux authored Aug 15, 2024
1 parent e4bab35 commit 8b4c646
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 8b4c646

Please sign in to comment.