1

Apparence et navigation dans les taxonomies

This commit is contained in:
2025-11-06 22:36:03 +01:00
parent d02c785633
commit 316ade0330
7 changed files with 67 additions and 14 deletions

View File

@@ -1,10 +1,20 @@
{{- $page := . -}}
{{- with .Page }}{{ $page = . }}{{ end -}}
{{- $taxonomiesRoot := site.GetPage "section" "taxonomies" -}}
{{- $trail := slice -}}
{{- if $page }}
{{- $isTaxonomy := or (eq $page.Kind "taxonomy") (eq $page.Kind "term") -}}
{{- if and $isTaxonomy $taxonomiesRoot -}}
{{- if not (in $trail $taxonomiesRoot) -}}
{{- $trail = $trail | append $taxonomiesRoot -}}
{{- end -}}
{{- end -}}
{{- range $page.Ancestors.Reverse -}}
{{- if ne .RelPermalink "/" -}}
{{- $trail = $trail | append . -}}
{{- if not (in $trail .) -}}
{{- $trail = $trail | append . -}}
{{- end -}}
{{- end -}}
{{- end -}}
@@ -21,10 +31,12 @@
{{- $trail = $trail | append . -}}
{{- end -}}
{{- end -}}
{{- else if and (eq $page.Kind "taxonomy") (eq (len $trail) 0) }}
{{- with site.Home }}
{{- if ne .RelPermalink "/" -}}
{{- $trail = $trail | append . -}}
{{- else if eq $page.Kind "taxonomy" }}
{{- if and (eq (len $trail) 0) (not $taxonomiesRoot) }}
{{- with site.Home }}
{{- if ne .RelPermalink "/" -}}
{{- $trail = $trail | append . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end }}