Skip to content

Commit

Permalink
Update site to build with newer hugo (#411)
Browse files Browse the repository at this point in the history
* Update site to build with newer hugo
  • Loading branch information
perrito666 authored Mar 17, 2022
1 parent 361a81d commit d4f6f0b
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 21 deletions.
2 changes: 2 additions & 0 deletions site/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
+++
+++
6 changes: 3 additions & 3 deletions site/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
{{ .Hugo.Generator }}
{{ hugo.Generator }}
{{ partial "meta.html" . }}
{{ partial "favicon.html" . }}
<title>{{ .Title }} :: {{ .Site.Title }}</title>
Expand Down Expand Up @@ -90,9 +90,9 @@ <h1 {{if eq .Title "Mage"}}class="site_title"{{end}}>{{.Title}}</h1>
{{define "breadcrumb"}}
{{$parent := .page.Parent }}
{{ if $parent }}
{{ $value := (printf "<a href='%s'>%s</a> > %s" $parent.URL $parent.Title .value) }}
{{ $value := (printf "<a href='%s'>%s</a> > %s" $parent.RelPermalink $parent.Title .value) }}
{{ template "breadcrumb" dict "page" $parent "value" $value }}
{{else}}
{{.value|safeHTML}}
{{end}}
{{end}}
{{end}}
8 changes: 4 additions & 4 deletions site/themes/learn/layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -40,10 +40,10 @@


{{with ($.Scratch.Get "prevPage")}}
<a class="nav nav-prev" href="{{.URL}}" title="{{.Title}}"> <i class="fa fa-chevron-left"></i></a>
<a class="nav nav-prev" href="{{.RelPermalink}}" title="{{.Title}}"> <i class="fa fa-chevron-left"></i></a>
{{end}}
{{with ($.Scratch.Get "nextPage")}}
<a class="nav nav-next" href="{{.URL}}" title="{{.Title}}" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
<a class="nav nav-next" href="{{.RelPermalink}}" title="{{.Title}}" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
{{end}}
</div>

Expand Down
6 changes: 3 additions & 3 deletions site/themes/learn/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
{{ .Hugo.Generator }}
{{ hugo.Generator }}
{{ partial "meta.html" . }}
{{ partial "favicon.html" . }}
<title>{{ .Title }} :: {{ .Site.Title }}</title>
Expand Down Expand Up @@ -87,9 +87,9 @@ <h1>{{.Title}}</h1>
{{define "breadcrumb"}}
{{$parent := .page.Parent }}
{{ if $parent }}
{{ $value := (printf "<a href='%s'>%s</a> > %s" $parent.URL $parent.Title .value) }}
{{ $value := (printf "<a href='%s'>%s</a> > %s" $parent.RelPermalink $parent.Title .value) }}
{{ template "breadcrumb" dict "page" $parent "value" $value }}
{{else}}
{{.value|safeHTML}}
{{end}}
{{end}}
{{end}}
10 changes: 5 additions & 5 deletions site/themes/learn/layouts/partials/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
{{ if eq $translation.Lang .Lang }}
{{ $selected := false }}
{{ if eq $pageLang .Lang}}
<option id="{{ $translation.Language }}" value="{{ $translation.URL }}" selected>{{ .LanguageName }}</option>
<option id="{{ $translation.Language }}" value="{{ $translation.RelPermalink }}" selected>{{ .LanguageName }}</option>
{{ else }}
<option id="{{ $translation.Language }}" value="{{ $translation.URL }}">{{ .LanguageName }}</option>
<option id="{{ $translation.Language }}" value="{{ $translation.RelPermalink }}">{{ .LanguageName }}</option>
{{ end }}
{{ end }}
{{ end }}
Expand Down Expand Up @@ -97,9 +97,9 @@ <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
{{with .sect}}
{{if .IsSection}}
{{safeHTML .Params.head}}
<li data-nav-id="{{.URL}}" title="{{.Title}}" class="dd-item
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item
{{if .IsAncestor $currentNode }}parent{{end}}
{{if eq .UniqueID $currentNode.UniqueID}}active{{end}}
{{if eq .File.UniqueID $currentNode.File.UniqueID}}active{{end}}
{{if .Params.alwaysopen}}parent{{end}}
">
<a href="{{.RelPermalink}}">
Expand Down Expand Up @@ -137,7 +137,7 @@ <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
</li>
{{else}}
{{ if not .Params.Hidden }}
<li data-nav-id="{{.URL}}" title="{{.Title}}" class="dd-item {{if eq .UniqueID $currentNode.UniqueID}}active{{end}}">
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item {{if eq .File.UniqueID $currentNode.File.UniqueID}}active{{end}}">
<a href="{{ .RelPermalink}}">
{{safeHTML .Params.Pre}}{{.Title}}{{safeHTML .Params.Post}}
{{ if $showvisitedlinks}}<i class="fa fa-check read-icon"></i>{{end}}
Expand Down
6 changes: 3 additions & 3 deletions site/themes/learn/layouts/shortcodes/children.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
{{$numn := add $num $.count }}

{{(printf "<h%d>" $numn)|safeHTML}}
<a href="{{.URL}}" >{{ .Title }}</a>
<a href="{{.RelPermalink}}" >{{ .Title }}</a>
{{(printf "</h%d>" $numn)|safeHTML}}

{{else}}
{{(printf "<%s>" $.style)|safeHTML}}
<a href="{{.URL}}" >{{ .Title }}</a>
<a href="{{.RelPermalink}}" >{{ .Title }}</a>
{{(printf "</%s>" $.style)|safeHTML}}
{{end}}

Expand Down Expand Up @@ -93,4 +93,4 @@

{{end}}
{{end}}
{{end}}
{{end}}
6 changes: 3 additions & 3 deletions site/themes/learn/layouts/shortcodes/relref.html
Original file line number Diff line number Diff line change
@@ -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 -}}
{{- end -}}

0 comments on commit d4f6f0b

Please sign in to comment.