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 }}
|
|
|
|
{{- $format := partial "get-format.hugo" . }}
|
|
|
|
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
|
|
|
|
{{- $showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev)) }}
|
|
|
|
{{- if and (or (eq $outputFormat "html") (eq $outputFormat "searchpage")) $showPrevNext }}
|
|
|
|
{{- $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 }}
|
|
|
|
{{- $prev := "" }}
|
|
|
|
{{- if and (eq .RelPermalink .Site.Home.RelPermalink) (eq $outputFormat "html") }}
|
2023-12-01 00:03:51 +00:00
|
|
|
{{- else if eq .Page.Kind "taxonomy" }}
|
|
|
|
{{- $prev = .Site.Home }}
|
|
|
|
{{- else if eq .Page.Kind "term" }}
|
|
|
|
{{- /* go to previous term page or taxonomy page if it is the first term */}}
|
|
|
|
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
|
|
|
|
{{- $pages := partialCached "partials/pageHelper/taxonomyPages.html" $taxonomy_page $taxonomy_page }}
|
|
|
|
{{- $prev = partial "partials/pageHelper/prev.html" (dict "collection" $pages "item" .) }}
|
|
|
|
{{- if not $prev }}
|
|
|
|
{{- $prev = $taxonomy_page }}
|
|
|
|
{{- end }}
|
|
|
|
{{- else if or (ne $outputFormat "html") (not (.Scratch.Get "relearnPrevPage")) }}
|
2023-09-18 18:24:49 +00:00
|
|
|
{{- $prev = .Site.Home }}
|
|
|
|
{{- else }}
|
|
|
|
{{- $prev = .Scratch.Get "relearnPrevPage" }}
|
|
|
|
{{- end}}
|
|
|
|
{{- partial "topbar/func/button.html" (dict
|
|
|
|
"page" .
|
|
|
|
"class" "topbar-button-prev"
|
|
|
|
"href" (partial "relLangPrettyUglyURL.hugo" (dict "to" $prev))
|
|
|
|
"icon" "chevron-left"
|
|
|
|
"onwidths" $onwidths
|
|
|
|
"onwidthm" $onwidthm
|
|
|
|
"onwidthl" $onwidthl
|
2023-12-05 07:40:58 +00:00
|
|
|
"hint" (printf "%s (%s)" ($prev | default .).Title ($startarrow | safeHTML))
|
2023-09-18 18:24:49 +00:00
|
|
|
)}}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|