{{ $imageURL := "https://bulma.io/images/placeholders/64x64.png" }} {{ $image := resources.Get "img/logo.jpg" }} {{ with $image }} {{ $imageResized := $image.Resize "64x" }} {{ $imageURL = $imageResized.Permalink }} {{ end }}
{{- /* In case of another navbar-start right after */}}
Catégories
{{ range $key, $value := .Site.Taxonomies.categories }} {{ $key | humanize }} {{ len . }} {{ end }}
Séries thématiques
{{ range where .Site.Pages "Params.code" "!=" nil }} {{ .Title }} {{ $casePosts := where .Site.RegularPages "CurrentSection.Params.code" "==" .Params.code }} {{ len $casePosts }} {{ end }}
{{- /* start/end menu shares the exact same code, just not the same position, factorize with a loop */}} {{ $currentPage := . }} {{ range (slice "start" "end")}} {{ $menuName := . }}
{{- /* now get the menu if it exists */}} {{ with index $.Site.Menus $menuName }} {{- /* and range over its pages */}} {{ range . }} {{ if .HasChildren }}
{{ .Pre }} {{ .Name }}
{{ range .Children }} {{ .Name }} {{ end }}
{{ else }} {{ .Name }} {{ end }} {{ end }} {{ end }}
{{ end }}
{{- /* Each item should have a corresponding assets/img/x.png and link in config.yaml */}} {{ range (slice "rss" "mastodon" "peertube" "funkwhale" "gitea" "mail" )}} {{ $imageName := . }} {{- /* Get image and resize to logo size */}} {{ $imagePath := printf "img/%s.png" $imageName }} {{ $image := resources.Get $imagePath }} {{ $imageResized := $image.Resize "64x" }} {{- /* Get logo link in site params (index allows to use a dynamic parameter name) */}} {{ end }}