hugo-theme-relearn/layouts/partials/topbar/button/next.html
2025-02-17 22:21:09 +01:00

28 lines
No EOL
991 B
HTML

{{- $onwidths := cond (isset . "onwidths") .onwidths "show" }}
{{- $onwidthm := cond (isset . "onwidthm") .onwidthm "show" }}
{{- $onwidthl := cond (isset . "onwidthl") .onwidthl "show" }}
{{- with .page }}
{{- $show := not (.Param "disableNextPrev") }}
{{- if $show }}
{{- $endarrow := "🡒" }}
{{- if eq (.Language.LanguageDirection | default (T "Reading-direction") | default "ltr") "rtl" }}
{{- $endarrow = "🡐" }}
{{- end }}
{{- $next := partialCached "_relearn/pageNext.gotmpl" . .Path }}
{{- $nextTitle := partial "title.gotmpl" (dict "page" $next "outputFormat" "html") }}
{{- $href := "" }}
{{- with (and $next $next.Path) }}
{{- $href = . }}
{{- end }}
{{- partial "topbar/func/button.html" (dict
"page" .
"class" "topbar-button-next"
"href" $href
"icon" "chevron-right"
"onwidths" $onwidths
"onwidthm" $onwidthm
"onwidthl" $onwidthl
"hint" (printf "%s (%s)" $nextTitle ($endarrow | safeHTML))
)}}
{{- end }}
{{- end }}