Add `.Parents` Simplify breadcrumb navigation implementation complexity

simple implemetation see feat: add parents property by septs · Pull Request #10480 · gohugoio/hugo · GitHub

{{- $page := . -}
<nav class="breadcrumb">
<ul>
{{- range .Parents }}
<li {{- if eq $page . }} class="is-active"{{ end }}>
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</li>
{{- end }}
</ul>
</nav>
1 Like