github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/docs/themes/hugo-theme-relearn/layouts/partials/topbar/button/prev.html (about) 1 {{- $onwidths := cond (isset . "onwidths") .onwidths "show" }} 2 {{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }} 3 {{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }} 4 {{- with .page }} 5 {{- $format := partial "get-format.hugo" . }} 6 {{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }} 7 {{- $showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev)) }} 8 {{- if $showPrevNext }} 9 {{- $startarrow := "🡐" }} 10 {{- if eq (.Language.LanguageDirection | default (T "Reading-direction") | default "ltr") "rtl" }} 11 {{- $startarrow = "🡒" }} 12 {{- end }} 13 {{- $prev := .Scratch.Get "relearnPrevPage" | default .Site.Home }} 14 {{- if eq $outputFormat "searchpage" }} 15 {{- $outputFormat = "html" }} 16 {{- else if eq .Page.Kind "home" }} 17 {{- $prev = "" }} 18 {{- else if eq .Page.Kind "term" }} 19 {{- /* go to previous term page or taxonomy page if it is the first term */}} 20 {{- $taxonomy_page := .Site.GetPage .Data.Plural }} 21 {{- $pages := partialCached "partials/pageHelper/taxonomyPages.html" $taxonomy_page $taxonomy_page }} 22 {{- $prev = partial "partials/pageHelper/prev.html" (dict "collection" $pages "item" .) | default $taxonomy_page }} 23 {{- end }} 24 {{- $prevTitle := partial "pageHelper/title.hugo" (dict "page" $prev "format" $format "outputFormat" $outputFormat) }} 25 {{- partial "topbar/func/button.html" (dict 26 "page" . 27 "class" "topbar-button-prev" 28 "href" (partial "relLangPrettyUglyURL.hugo" (dict "to" $prev)) 29 "icon" "chevron-left" 30 "onwidths" $onwidths 31 "onwidthm" $onwidthm 32 "onwidthl" $onwidthl 33 "hint" (printf "%s (%s)" $prevTitle ($startarrow | safeHTML)) 34 )}} 35 {{- end }} 36 {{- end }}