Partial pour les listes de mots-clés
This commit is contained in:
37
themes/42/layouts/_partials/asides/keywords.html
Normal file
37
themes/42/layouts/_partials/asides/keywords.html
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{{- $ctx := . -}}
|
||||||
|
{{- $scratch := newScratch -}}
|
||||||
|
{{- $scratch.Set "blocks" 0 -}}
|
||||||
|
{{- range $taxonomy, $_ := $ctx.Site.Taxonomies -}}
|
||||||
|
{{- with $ctx.Page.GetTerms $taxonomy -}}
|
||||||
|
{{- $scratch.Add "blocks" 1 -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- with $ctx.Params.keywords -}}
|
||||||
|
{{- if gt (len .) 0 -}}
|
||||||
|
{{- $scratch.Add "blocks" 1 -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if gt ($scratch.Get "blocks") 0 }}
|
||||||
|
<aside>
|
||||||
|
{{- range $taxonomy, $_ := $ctx.Site.Taxonomies -}}
|
||||||
|
{{- with $ctx.Page.GetTerms $taxonomy }}
|
||||||
|
<section>
|
||||||
|
<h2>{{ humanize $taxonomy }}</h2>
|
||||||
|
<ul class="keywords">
|
||||||
|
{{- range . }}
|
||||||
|
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
||||||
|
{{- end }}
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with $ctx.Params.keywords }}
|
||||||
|
{{- if gt (len .) 0 }}
|
||||||
|
<section>
|
||||||
|
<h2>Mots-clés</h2>
|
||||||
|
{{- partial "keywords.html" . }}
|
||||||
|
</section>
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
</aside>
|
||||||
|
{{- end }}
|
||||||
Reference in New Issue
Block a user