Min version is now v0.124.0. Using site.Config.Services.GoogleAnalytics.ID, hugo.IsMultilingual and hugo.yaml etc.
This commit is contained in:
parent
ea9f10193a
commit
2ae8ee84ee
2 changed files with 9 additions and 10 deletions
|
|
@ -9,7 +9,7 @@
|
|||
</svg>
|
||||
</button>
|
||||
<div class="mobile-nav__sheet link-inverted link-nav" id="sheet" aria-hidden="true">
|
||||
<div class="mobile-nav__region">{{ if site.IsMultiLingual }}{{ partial "language-selector.html" . }}{{ end }}</div>
|
||||
<div class="mobile-nav__region">{{ if hugo.IsMultilingual }}{{ partial "language-selector.html" . }}{{ end }}</div>
|
||||
<nav class="mobile-nav__main-menu" aria-label="{{ i18n "menu_title" }}">
|
||||
<ul class="mobile-nav__navbar">
|
||||
{{ if site.Menus.main -}}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
{{ $gaid := (or site.Config.Services.GoogleAnalytics.ID site.GoogleAnalytics) -}}
|
||||
{{ $opts := dict
|
||||
"minify" true
|
||||
"params" (dict
|
||||
|
|
@ -6,7 +5,7 @@
|
|||
"piwikTrackerUrl" site.Params.piwikTrackerUrl
|
||||
"piwikSiteID" site.Params.piwikSiteID
|
||||
"plausibleSiteID" site.Params.plausibleSiteID
|
||||
"GoogleAnalytics" $gaid) -}}
|
||||
"GoogleAnalytics" site.Config.Services.GoogleAnalytics.ID) -}}
|
||||
{{ if eq hugo.Environment "development" -}}
|
||||
{{ $opts = merge $opts (dict "minify" false) -}}
|
||||
{{ end -}}
|
||||
|
|
@ -20,7 +19,7 @@
|
|||
<script async defer data-domain="{{ site.Params.plausibleSiteID }}" src="{{ site.Params.plausibleTrackerURL | default "https://plausible.io/js/plausible.js" }}"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if $gaid -}}
|
||||
{{ if site.Config.Services.GoogleAnalytics.ID -}}
|
||||
{{ $script := resources.Get "js/tracking.js" | js.Build $opts | fingerprint -}}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue