use title from menu data file for page nav links

uci-hugo-doc
Robert Kaussow 2020-01-15 23:31:05 +01:00
parent c4e574f7f3
commit 85e6de755b
3 changed files with 5 additions and 4 deletions

View File

@ -1,2 +1,3 @@
- BUGFIX - BUGFIX
- fix wrong class name for page navigation button - fix wrong class name for page navigation button
- use title from menu data file for page nav links

Binary file not shown.

View File

@ -23,7 +23,7 @@
{{ $current := $current.Scratch.Get "current" }} {{ $current := $current.Scratch.Get "current" }}
{{ if $current.Scratch.Get "getNext" }} {{ if $current.Scratch.Get "getNext" }}
{{ $current.Scratch.Set "nextPage" $this }} {{ $current.Scratch.Set "nextPage" (dict "name" .name "this" $this) }}
{{ $current.Scratch.Set "getNext" false }} {{ $current.Scratch.Set "getNext" false }}
{{ end }} {{ end }}
@ -32,7 +32,7 @@
{{ $current.Scratch.Set "getNext" true }} {{ $current.Scratch.Set "getNext" true }}
{{ end }} {{ end }}
{{ $current.Scratch.Set "prev" $this }} {{ $current.Scratch.Set "prev" (dict "name" .name "this" $this) }}
{{ end }} {{ end }}
{{ $sub := default false .sub }} {{ $sub := default false .sub }}
@ -48,12 +48,12 @@
{{ if $showPrevNext }} {{ if $showPrevNext }}
<span> <span>
{{ with ($current.Scratch.Get "prevPage") }} {{ with ($current.Scratch.Get "prevPage") }}
<a class="gdoc-page__nav--prev" href="{{.RelPermalink}}" title="{{.Title}}"> {{ .Name }}</a> <a class="gdoc-page__nav--prev" href="{{.this.RelPermalink}}" title="{{ .name }}"> {{ .name }}</a>
{{ end }} {{ end }}
</span> </span>
<span> <span>
{{ with ($current.Scratch.Get "nextPage") }} {{ with ($current.Scratch.Get "nextPage") }}
<a class="gdoc-page__nav--next" href="{{.RelPermalink}}" title="{{.Title}}">{{ .Name }} </a> <a class="gdoc-page__nav--next" href="{{.this.RelPermalink}}" title="{{ .name }}">{{ .name }} </a>
{{ end }} {{ end }}
</span> </span>
{{ end }} {{ end }}