2023-09-18 18:24:49 +00:00
|
|
|
{{- $onwidths := cond (isset . "onwidths") .onwidths "show" }}
|
|
|
|
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
|
|
|
|
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
|
|
|
|
{{- with .page }}
|
|
|
|
{{- $showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev)) }}
|
2024-04-07 19:41:06 +00:00
|
|
|
{{- if $showPrevNext }}
|
2023-09-18 18:24:49 +00:00
|
|
|
{{- $startarrow := "🡐" }}
|
2023-11-28 20:39:50 +00:00
|
|
|
{{- if eq (.Language.LanguageDirection | default (T "Reading-direction") | default "ltr") "rtl" }}
|
2023-09-18 18:24:49 +00:00
|
|
|
{{- $startarrow = "🡒" }}
|
|
|
|
{{- end }}
|
2024-07-21 21:40:57 +00:00
|
|
|
{{- $prev := .Scratch.Get "relearnPrevPage" }}
|
2024-08-26 21:07:33 +00:00
|
|
|
{{- if eq .Page.Kind "term" }}
|
2023-12-01 00:03:51 +00:00
|
|
|
{{- /* go to previous term page or taxonomy page if it is the first term */}}
|
|
|
|
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
|
2024-08-29 21:50:31 +00:00
|
|
|
{{- $pages := partialCached "partials/_relearn/pagesTaxonomy.gotmpl" $taxonomy_page $taxonomy_page.Path }}
|
2024-08-29 10:28:34 +00:00
|
|
|
{{- $prev = partial "partials/_relearn/pagePrev.gotmpl" (dict "collection" $pages "item" .) | default $taxonomy_page }}
|
2024-07-21 21:40:57 +00:00
|
|
|
{{- else if eq .Page.Kind "taxonomy" }}
|
|
|
|
{{- $prev = .Site.Home }}
|
2024-04-07 19:41:06 +00:00
|
|
|
{{- end }}
|
2024-08-29 10:28:34 +00:00
|
|
|
{{- $prevTitle := partial "title.gotmpl" (dict "page" $prev "outputFormat" "html") }}
|
2023-09-18 18:24:49 +00:00
|
|
|
{{- partial "topbar/func/button.html" (dict
|
|
|
|
"page" .
|
|
|
|
"class" "topbar-button-prev"
|
2024-08-29 10:28:34 +00:00
|
|
|
"href" (partial "permalink.gotmpl" (dict "to" $prev))
|
2023-09-18 18:24:49 +00:00
|
|
|
"icon" "chevron-left"
|
|
|
|
"onwidths" $onwidths
|
|
|
|
"onwidthm" $onwidthm
|
|
|
|
"onwidthl" $onwidthl
|
2024-02-14 22:16:08 +00:00
|
|
|
"hint" (printf "%s (%s)" $prevTitle ($startarrow | safeHTML))
|
2023-09-18 18:24:49 +00:00
|
|
|
)}}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|