hugo-theme-relearn/layouts/partials/_relearn/pageDepth.gotmpl

9 lines
310 B
Go Template
Raw Normal View History

{{- /* https://discourse.gohugo.io/t/how-to-know-the-section-depth/37302/4 */ -}}
{{- $page := .page }}
{{- $depth := .depth | default 0 }}
{{- with $page.Parent }}
2023-09-23 21:28:31 +00:00
{{- $depth = add $depth 1 }}
{{- partial "_relearn/pageDepth.gotmpl" (dict "page" . "depth" $depth) }}
{{- else }}
{{- $depth }}
{{- end }}