Taxonomies
This commit is contained in:
@@ -1,19 +1,39 @@
|
||||
{{- $page := . -}}
|
||||
{{- with .Page -}}
|
||||
{{- $page = . -}}
|
||||
{{- end -}}
|
||||
{{- if or $page.IsPage $page.IsSection -}}
|
||||
{{- $trail := slice -}}
|
||||
{{- with .Page }}{{ $page = . }}{{ end -}}
|
||||
{{- $trail := slice -}}
|
||||
{{- if $page }}
|
||||
{{- range $page.Ancestors.Reverse -}}
|
||||
{{- if ne .RelPermalink "/" -}}
|
||||
{{- $trail = $trail | append . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if gt (len $trail) 0 -}}
|
||||
<nav class="breadcrumbs" aria-label="Fil d’Ariane">
|
||||
{{- range $item := $trail -}}
|
||||
<a href="{{ $item.RelPermalink }}">{{ with $item.LinkTitle }}{{ . }}{{ else }}{{ $item.Title }}{{ end }}</a>
|
||||
|
||||
{{- if eq $page.Kind "term" }}
|
||||
{{- with site.GetPage "taxonomy" $page.Data.Plural }}
|
||||
{{- range .Ancestors.Reverse -}}
|
||||
{{- if ne .RelPermalink "/" -}}
|
||||
{{- if not (in $trail .) -}}
|
||||
{{- $trail = $trail | append . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if not (in $trail .) -}}
|
||||
{{- $trail = $trail | append . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</nav>
|
||||
{{- else if and (eq $page.Kind "taxonomy") (eq (len $trail) 0) }}
|
||||
{{- with site.Home }}
|
||||
{{- if ne .RelPermalink "/" -}}
|
||||
{{- $trail = $trail | append . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if gt (len $trail) 0 -}}
|
||||
<nav class="breadcrumbs" aria-label="Fil d’Ariane">
|
||||
{{- range $item := $trail -}}
|
||||
<a href="{{ $item.RelPermalink }}">{{ with $item.LinkTitle }}{{ . }}{{ else }}{{ $item.Title }}{{ end }}</a>
|
||||
{{- end -}}
|
||||
</nav>
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user