theme: move page depth processing #825

This commit is contained in:
Sören Weber 2024-04-07 15:16:34 +02:00
parent 714b64ab14
commit 36e6ccdf5b
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 2 additions and 2 deletions

View file

@ -7,7 +7,7 @@
{{- $to = $page }} {{- $to = $page }}
{{- $lasturl = partial "relLangPrettyUglyURL.hugo" (dict "to" $page) }} {{- $lasturl = partial "relLangPrettyUglyURL.hugo" (dict "to" $page) }}
{{- end }} {{- end }}
{{- $depth := add 1 (int (partial "get-page-depth.hugo" (dict "page" $page))) }} {{- $depth := add 1 (int (partial "pageHelper/depth.hugo" (dict "page" $page))) }}
{{- if .page.Site.Params.disableRootBreadcrumb }} {{- if .page.Site.Params.disableRootBreadcrumb }}
{{- $depth = add $depth -1 }} {{- $depth = add $depth -1 }}
{{- end }} {{- end }}

View file

@ -3,7 +3,7 @@
{{- $depth := .depth | default 0 }} {{- $depth := .depth | default 0 }}
{{- with $page.Parent }} {{- with $page.Parent }}
{{- $depth = add $depth 1 }} {{- $depth = add $depth 1 }}
{{- partial "get-page-depth.hugo" (dict "page" . "depth" $depth) }} {{- partial "pageHelper/depth.hugo" (dict "page" . "depth" $depth) }}
{{- else }} {{- else }}
{{- $depth }} {{- $depth }}
{{- end }} {{- end }}