From d4f6f0bca83cfb00d89e91962faaabc4efda2ccd Mon Sep 17 00:00:00 2001 From: Horacio Duran Date: Thu, 17 Mar 2022 21:05:13 +0100 Subject: [PATCH] Update site to build with newer hugo (#411) * Update site to build with newer hugo --- site/content/_index.md | 2 ++ site/layouts/partials/header.html | 6 +++--- site/themes/learn/layouts/partials/footer.html | 8 ++++---- site/themes/learn/layouts/partials/header.html | 6 +++--- site/themes/learn/layouts/partials/menu.html | 10 +++++----- site/themes/learn/layouts/shortcodes/children.html | 6 +++--- site/themes/learn/layouts/shortcodes/relref.html | 6 +++--- 7 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 site/content/_index.md diff --git a/site/content/_index.md b/site/content/_index.md new file mode 100644 index 0000000..ac36e06 --- /dev/null +++ b/site/content/_index.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/site/layouts/partials/header.html b/site/layouts/partials/header.html index a2f9e39..d7ae183 100644 --- a/site/layouts/partials/header.html +++ b/site/layouts/partials/header.html @@ -3,7 +3,7 @@ - {{ .Hugo.Generator }} + {{ hugo.Generator }} {{ partial "meta.html" . }} {{ partial "favicon.html" . }} {{ .Title }} :: {{ .Site.Title }} @@ -90,9 +90,9 @@ {{define "breadcrumb"}} {{$parent := .page.Parent }} {{ if $parent }} - {{ $value := (printf "%s > %s" $parent.URL $parent.Title .value) }} + {{ $value := (printf "%s > %s" $parent.RelPermalink $parent.Title .value) }} {{ template "breadcrumb" dict "page" $parent "value" $value }} {{else}} {{.value|safeHTML}} {{end}} - {{end}} \ No newline at end of file + {{end}} diff --git a/site/themes/learn/layouts/partials/footer.html b/site/themes/learn/layouts/partials/footer.html index fe5c834..79008ae 100644 --- a/site/themes/learn/layouts/partials/footer.html +++ b/site/themes/learn/layouts/partials/footer.html @@ -12,8 +12,8 @@ {{ define "menu-nextprev" }} {{$currentNode := .currentnode }} - {{ if ne .menu.Params.hidden true}} - {{if hasPrefix $currentNode.URL .menu.URL }} + {{ if ne .menu.Params.hidden true }} + {{if hasPrefix $currentNode.RelPermalink .menu.RelPermalink }} {{ $currentNode.Scratch.Set "NextPageOK" "OK" }} {{ $currentNode.Scratch.Set "prevPage" ($currentNode.Scratch.Get "prevPageTmp") }} {{else}} @@ -40,10 +40,10 @@ {{with ($.Scratch.Get "prevPage")}} - + {{end}} {{with ($.Scratch.Get "nextPage")}} - + {{end}} diff --git a/site/themes/learn/layouts/partials/header.html b/site/themes/learn/layouts/partials/header.html index 451b21b..2f1c569 100644 --- a/site/themes/learn/layouts/partials/header.html +++ b/site/themes/learn/layouts/partials/header.html @@ -3,7 +3,7 @@ - {{ .Hugo.Generator }} + {{ hugo.Generator }} {{ partial "meta.html" . }} {{ partial "favicon.html" . }} {{ .Title }} :: {{ .Site.Title }} @@ -87,9 +87,9 @@ {{define "breadcrumb"}} {{$parent := .page.Parent }} {{ if $parent }} - {{ $value := (printf "%s > %s" $parent.URL $parent.Title .value) }} + {{ $value := (printf "%s > %s" $parent.RelPermalink $parent.Title .value) }} {{ template "breadcrumb" dict "page" $parent "value" $value }} {{else}} {{.value|safeHTML}} {{end}} - {{end}} \ No newline at end of file + {{end}} diff --git a/site/themes/learn/layouts/partials/menu.html b/site/themes/learn/layouts/partials/menu.html index 9780b83..4674373 100644 --- a/site/themes/learn/layouts/partials/menu.html +++ b/site/themes/learn/layouts/partials/menu.html @@ -57,9 +57,9 @@ {{ if eq $translation.Lang .Lang }} {{ $selected := false }} {{ if eq $pageLang .Lang}} - + {{ else }} - + {{ end }} {{ end }} {{ end }} @@ -97,9 +97,9 @@ {{with .sect}} {{if .IsSection}} {{safeHTML .Params.head}} -
  • @@ -137,7 +137,7 @@
  • {{else}} {{ if not .Params.Hidden }} -
  • +
  • {{safeHTML .Params.Pre}}{{.Title}}{{safeHTML .Params.Post}} {{ if $showvisitedlinks}}{{end}} diff --git a/site/themes/learn/layouts/shortcodes/children.html b/site/themes/learn/layouts/shortcodes/children.html index fe20839..86a03d9 100644 --- a/site/themes/learn/layouts/shortcodes/children.html +++ b/site/themes/learn/layouts/shortcodes/children.html @@ -40,12 +40,12 @@ {{$numn := add $num $.count }} {{(printf "" $numn)|safeHTML}} -{{ .Title }} +{{ .Title }} {{(printf "" $numn)|safeHTML}} {{else}} {{(printf "<%s>" $.style)|safeHTML}} -{{ .Title }} +{{ .Title }} {{(printf "" $.style)|safeHTML}} {{end}} @@ -93,4 +93,4 @@ {{end}} {{end}} -{{end}} \ No newline at end of file +{{end}} diff --git a/site/themes/learn/layouts/shortcodes/relref.html b/site/themes/learn/layouts/shortcodes/relref.html index 5cb8116..02eae96 100644 --- a/site/themes/learn/layouts/shortcodes/relref.html +++ b/site/themes/learn/layouts/shortcodes/relref.html @@ -1,12 +1,12 @@ {{- if in (.Get 0) "/_index.md" -}} {{- $path := (trim (.Get 0) "_index.md") -}} {{- with .Site.GetPage "section" (trim $path "/") -}} - {{- .URL -}} + {{- .RelPermalink -}} {{- end -}} {{- else -}} {{- with .Site.GetPage "section" (.Get 0) }} - {{- .URL -}} + {{- .RelPermalink -}} {{- else -}} {{- .Get 0 | relref .Page -}} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}}