Skip to content

Commit

Permalink
Min version is now v0.124.0. Using site.Config.Services.GoogleAnalyti…
Browse files Browse the repository at this point in the history
…cs.ID, hugo.IsMultilingual and hugo.yaml etc.
  • Loading branch information
frjo committed Aug 14, 2024
1 parent ea9f101 commit 2ae8ee8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion config.yaml → hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module:
hugoVersion:
extended: true
min: "0.93.0"
min: "0.124.0"
2 changes: 1 addition & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1 class="header__site-name{{ if not ($.Param "sitename" | default true) }} vis
<a href="{{ site.Home.RelPermalink }}" title="Home" class="header__site-link" rel="home"><span>{{ site.Title }}</span></a>
</h1>
<div class="region header__region">
{{ if site.IsMultiLingual }}{{ partial "language-selector.html" . }}{{ end -}}
{{ if hugo.IsMultilingual }}{{ partial "language-selector.html" . }}{{ end -}}
{{ if $.Param "menuinheader" }}{{ partial "menu.html" . }}{{ end -}}
</div>
</header>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/mobilemenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
5 changes: 2 additions & 3 deletions layouts/partials/tracking.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{{ $gaid := (or site.Config.Services.GoogleAnalytics.ID site.GoogleAnalytics) -}}
{{ $opts := dict
"minify" true
"params" (dict
"cookieConsent" site.Params.cookieConsent
"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 -}}
Expand All @@ -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" . }}
Expand Down
6 changes: 3 additions & 3 deletions scripts/set_up_new_site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ copy_files=("themes/zen/assets/sass/_colors.scss:assets/sass/_colors.scss"
"themes/zen/assets/sass/_custom.scss:assets/sass/_custom.scss"
"themes/zen/assets/sass/_zen.scss:assets/sass/_zen.scss"
"themes/zen/layouts/index.html:layouts/index.html"
"themes/zen/exampleSite/config.yaml:config.yaml"
"themes/zen/exampleSite/hugo.yaml:hugo.yaml"
"themes/zen/.editorconfig:.editorconfig")

for files in "${copy_files[@]}" ; do
Expand All @@ -34,6 +34,6 @@ for files in "${copy_files[@]}" ; do
fi
done

if [[ -f "config.toml" && -f "config.yaml" ]]; then
mv config.toml config.toml.old
if [[ -f "hugo.toml" && -f "hugo.yaml" ]]; then
mv hugo.toml hugo.toml.old
fi
2 changes: 1 addition & 1 deletion theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "GPLv2"
licenselink = "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html"
tags = ["accessible", "multilingual", "responsive", "blog", "search", "math", "podcast"]
features = ["accessible", "multilingual", "responsive", "grid", "sass", "search", "matomo", "jsonfeed", "math", "podcast"]
min_version = "0.93.0"
min_version = "0.124.0"

[author]
name = "Fredrik Jonsson"
Expand Down

0 comments on commit 2ae8ee8

Please sign in to comment.