mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-18 07:23:09 +00:00
Adapt IsServer check revised in hugo v0.120.0
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
|
{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
|
||||||
{{- if (and (not .Site.IsServer) (not $pc.Disable)) -}}
|
{{- if (and (not hugo.IsServer) (not $pc.Disable)) -}}
|
||||||
{{ with .Site.Config.Services.GoogleAnalytics.ID -}}
|
{{ with .Site.Config.Services.GoogleAnalytics.ID -}}
|
||||||
{{ if hasPrefix . "G-"}}
|
{{ if hasPrefix . "G-"}}
|
||||||
{{ template "__ga_js_set_doNotTrack" $ }}
|
{{ template "__ga_js_set_doNotTrack" $ }}
|
||||||
|
@@ -68,7 +68,7 @@
|
|||||||
{{- range $index, $item := $list -}}
|
{{- range $index, $item := $list -}}
|
||||||
{{- $active := eq $item.label $version -}}
|
{{- $active := eq $item.label $version -}}
|
||||||
{{- $disabled := false -}}
|
{{- $disabled := false -}}
|
||||||
{{- if site.IsServer }}
|
{{- if hugo.IsServer }}
|
||||||
{{- $disabled = and $item.redirect (gt (len $item.redirect) 0) -}}
|
{{- $disabled = and $item.redirect (gt (len $item.redirect) 0) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{ if $item.url }}
|
{{ if $item.url }}
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
{{- $js = $bundle | resources.ExecuteAsTemplate $filename $page -}}
|
{{- $js = $bundle | resources.ExecuteAsTemplate $filename $page -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if and (not site.IsServer) $header -}}
|
{{- if and (not hugo.IsServer) $header -}}
|
||||||
{{- $pc := site.Config.Privacy.GoogleAnalytics -}}
|
{{- $pc := site.Config.Privacy.GoogleAnalytics -}}
|
||||||
{{- if and (not $pc.Disable) (hasPrefix site.Config.Services.GoogleAnalytics.ID "G-") }}
|
{{- if and (not $pc.Disable) (hasPrefix site.Config.Services.GoogleAnalytics.ID "G-") }}
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.Config.Services.GoogleAnalytics.ID }}"></script>
|
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.Config.Services.GoogleAnalytics.ID }}"></script>
|
||||||
|
Reference in New Issue
Block a user