2020-01-12 06:33:02 -08:00
|
|
|
{{ $current := . }}
|
|
|
|
{{ $site := .Site }}
|
|
|
|
{{ $current.Scratch.Set "prev" false }}
|
|
|
|
{{ $current.Scratch.Set "getNext" false }}
|
|
|
|
|
|
|
|
{{ $current.Scratch.Set "nextPage" false }}
|
|
|
|
{{ $current.Scratch.Set "prevPage" false }}
|
|
|
|
|
|
|
|
{{ template "menu_nextprev" dict "sect" $.Site.Data.menu.main.main "current" $current "site" $site }}
|
|
|
|
|
|
|
|
{{ define "menu_nextprev" }}
|
|
|
|
{{ $current := .current }}
|
|
|
|
{{ $site := .site }}
|
|
|
|
|
2020-02-05 07:46:29 -08:00
|
|
|
{{ range sort (default (seq 0) .sect) "weight" }}
|
2020-01-12 06:33:02 -08:00
|
|
|
{{ $current.Scratch.Set "current" $current }}
|
|
|
|
{{ $current.Scratch.Set "site" $site }}
|
|
|
|
|
|
|
|
{{ $ref := default false .ref }}
|
|
|
|
{{ if $ref}}
|
|
|
|
{{ $site := $current.Scratch.Get "site" }}
|
|
|
|
{{ $this := $site.GetPage .ref }}
|
|
|
|
{{ $current := $current.Scratch.Get "current" }}
|
|
|
|
|
|
|
|
{{ if $current.Scratch.Get "getNext" }}
|
2020-01-15 14:31:05 -08:00
|
|
|
{{ $current.Scratch.Set "nextPage" (dict "name" .name "this" $this) }}
|
2020-01-12 06:33:02 -08:00
|
|
|
{{ $current.Scratch.Set "getNext" false }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ if eq $current $this }}
|
|
|
|
{{ $current.Scratch.Set "prevPage" ($current.Scratch.Get "prev") }}
|
|
|
|
{{ $current.Scratch.Set "getNext" true }}
|
|
|
|
{{ end }}
|
|
|
|
|
2020-01-15 14:31:05 -08:00
|
|
|
{{ $current.Scratch.Set "prev" (dict "name" .name "this" $this) }}
|
2020-01-12 06:33:02 -08:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ $sub := default false .sub }}
|
|
|
|
{{ if $sub }}
|
|
|
|
{{ template "menu_nextprev" dict "sect" $sub "current" ($current.Scratch.Get "current") "site" ($current.Scratch.Get "site") }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
2020-02-04 16:15:51 -08:00
|
|
|
<div class="gdoc-page__footer flex flex-wrap justify-between">
|
2020-02-05 00:40:05 -08:00
|
|
|
{{ $showPrevNext := (and (default true .Site.Params.GeekdocNextPrev) .Site.Params.GeekdocMenuBundle) }}
|
2020-01-12 06:33:02 -08:00
|
|
|
{{ if $showPrevNext }}
|
|
|
|
<span>
|
|
|
|
{{ with ($current.Scratch.Get "prevPage") }}
|
2020-01-15 14:31:05 -08:00
|
|
|
<a class="gdoc-page__nav--prev" href="{{.this.RelPermalink}}" title="{{ .name }}"> {{ .name }}</a>
|
2020-01-12 06:33:02 -08:00
|
|
|
{{ end }}
|
|
|
|
</span>
|
|
|
|
<span>
|
|
|
|
{{ with ($current.Scratch.Get "nextPage") }}
|
2020-01-15 14:31:05 -08:00
|
|
|
<a class="gdoc-page__nav--next" href="{{.this.RelPermalink}}" title="{{ .name }}">{{ .name }} </a>
|
2020-01-12 06:33:02 -08:00
|
|
|
{{ end }}
|
|
|
|
</span>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|