Apparence et navigation dans les taxonomies
This commit is contained in:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user