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
7 changed files with 9 additions and 10 deletions
42
exampleSite/hugo.yaml
Normal file
42
exampleSite/hugo.yaml
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
---
|
||||||
|
title: "Hugo Zen theme"
|
||||||
|
baseURL: "https://example.org/"
|
||||||
|
theme: "zen"
|
||||||
|
languageCode: "en-GB"
|
||||||
|
defaultContentLanguage: "en"
|
||||||
|
pluralizelisttitles: false
|
||||||
|
removePathAccents: true
|
||||||
|
paginate: 10
|
||||||
|
paginatePath: "page"
|
||||||
|
rssLimit: 20
|
||||||
|
|
||||||
|
outputFormats:
|
||||||
|
SearchIndex:
|
||||||
|
mediaType: "application/json"
|
||||||
|
baseName: "searchindex"
|
||||||
|
isPlainText: true
|
||||||
|
notAlternative: true
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
home: ["HTML","RSS", "JSON", "SearchIndex"]
|
||||||
|
section: ["HTML","RSS", "JSON"]
|
||||||
|
|
||||||
|
params:
|
||||||
|
contact: "info@example.org"
|
||||||
|
description: "The zen theme for Hugo example site."
|
||||||
|
dateformat: "2 January, 2006"
|
||||||
|
favicon: "apple-touch-icon.png"
|
||||||
|
feedlinks: true
|
||||||
|
icon: "apple-touch-icon.png"
|
||||||
|
image: "apple-touch-icon.png"
|
||||||
|
imageMaxWidth: 400
|
||||||
|
logoWidth: 64
|
||||||
|
mobileMenu: true
|
||||||
|
poweredby: true
|
||||||
|
realfavicongenerator: true
|
||||||
|
sidebar: true
|
||||||
|
submitted: true
|
||||||
|
author:
|
||||||
|
name: "Your Name"
|
||||||
|
url: "https://example.org/somepage"
|
||||||
|
avatar: "path/to/some-image.jpg"
|
||||||
4
hugo.yaml
Normal file
4
hugo.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
module:
|
||||||
|
hugoVersion:
|
||||||
|
extended: true
|
||||||
|
min: "0.124.0"
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
<a href="{{ site.Home.RelPermalink }}" title="Home" class="header__site-link" rel="home"><span>{{ site.Title }}</span></a>
|
<a href="{{ site.Home.RelPermalink }}" title="Home" class="header__site-link" rel="home"><span>{{ site.Title }}</span></a>
|
||||||
</h1>
|
</h1>
|
||||||
<div class="region header__region">
|
<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 -}}
|
{{ if $.Param "menuinheader" }}{{ partial "menu.html" . }}{{ end -}}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<div class="mobile-nav__sheet link-inverted link-nav" id="sheet" aria-hidden="true">
|
<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" }}">
|
<nav class="mobile-nav__main-menu" aria-label="{{ i18n "menu_title" }}">
|
||||||
<ul class="mobile-nav__navbar">
|
<ul class="mobile-nav__navbar">
|
||||||
{{ if site.Menus.main -}}
|
{{ if site.Menus.main -}}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
{{ $gaid := (or site.Config.Services.GoogleAnalytics.ID site.GoogleAnalytics) -}}
|
|
||||||
{{ $opts := dict
|
{{ $opts := dict
|
||||||
"minify" true
|
"minify" true
|
||||||
"params" (dict
|
"params" (dict
|
||||||
|
|
@ -6,7 +5,7 @@
|
||||||
"piwikTrackerUrl" site.Params.piwikTrackerUrl
|
"piwikTrackerUrl" site.Params.piwikTrackerUrl
|
||||||
"piwikSiteID" site.Params.piwikSiteID
|
"piwikSiteID" site.Params.piwikSiteID
|
||||||
"plausibleSiteID" site.Params.plausibleSiteID
|
"plausibleSiteID" site.Params.plausibleSiteID
|
||||||
"GoogleAnalytics" $gaid) -}}
|
"GoogleAnalytics" site.Config.Services.GoogleAnalytics.ID) -}}
|
||||||
{{ if eq hugo.Environment "development" -}}
|
{{ if eq hugo.Environment "development" -}}
|
||||||
{{ $opts = merge $opts (dict "minify" false) -}}
|
{{ $opts = merge $opts (dict "minify" false) -}}
|
||||||
{{ end -}}
|
{{ 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>
|
<script async defer data-domain="{{ site.Params.plausibleSiteID }}" src="{{ site.Params.plausibleTrackerURL | default "https://plausible.io/js/plausible.js" }}"></script>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
||||||
{{ if $gaid -}}
|
{{ if site.Config.Services.GoogleAnalytics.ID -}}
|
||||||
{{ $script := resources.Get "js/tracking.js" | js.Build $opts | fingerprint -}}
|
{{ $script := resources.Get "js/tracking.js" | js.Build $opts | fingerprint -}}
|
||||||
<script src="{{ $script.RelPermalink }}"></script>
|
<script src="{{ $script.RelPermalink }}"></script>
|
||||||
{{ template "_internal/google_analytics.html" . }}
|
{{ template "_internal/google_analytics.html" . }}
|
||||||
|
|
|
||||||
|
|
@ -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/_custom.scss:assets/sass/_custom.scss"
|
||||||
"themes/zen/assets/sass/_zen.scss:assets/sass/_zen.scss"
|
"themes/zen/assets/sass/_zen.scss:assets/sass/_zen.scss"
|
||||||
"themes/zen/layouts/index.html:layouts/index.html"
|
"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")
|
"themes/zen/.editorconfig:.editorconfig")
|
||||||
|
|
||||||
for files in "${copy_files[@]}" ; do
|
for files in "${copy_files[@]}" ; do
|
||||||
|
|
@ -34,6 +34,6 @@ for files in "${copy_files[@]}" ; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ -f "config.toml" && -f "config.yaml" ]]; then
|
if [[ -f "hugo.toml" && -f "hugo.yaml" ]]; then
|
||||||
mv config.toml config.toml.old
|
mv hugo.toml hugo.toml.old
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ license = "GPLv2"
|
||||||
licenselink = "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html"
|
licenselink = "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html"
|
||||||
tags = ["accessible", "multilingual", "responsive", "blog", "search", "math", "podcast"]
|
tags = ["accessible", "multilingual", "responsive", "blog", "search", "math", "podcast"]
|
||||||
features = ["accessible", "multilingual", "responsive", "grid", "sass", "search", "matomo", "jsonfeed", "math", "podcast"]
|
features = ["accessible", "multilingual", "responsive", "grid", "sass", "search", "matomo", "jsonfeed", "math", "podcast"]
|
||||||
min_version = "0.93.0"
|
min_version = "0.124.0"
|
||||||
|
|
||||||
[author]
|
[author]
|
||||||
name = "Fredrik Jonsson"
|
name = "Fredrik Jonsson"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue