2021-05-21 14:53:35 +02:00
|
|
|
<nav class="navbar is-fixed-top is-transparent" role="navigation" aria-label="main navigation">
|
|
|
|
<div class="navbar-brand">
|
|
|
|
<a class="navbar-item" href="{{ .Site.Home.Permalink }}">
|
|
|
|
<img src="https://bulma.io/images/placeholders/128x128.png">
|
|
|
|
</a>
|
|
|
|
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbar">
|
|
|
|
<span aria-hidden="true"></span>
|
|
|
|
<span aria-hidden="true"></span>
|
|
|
|
<span aria-hidden="true"></span>
|
|
|
|
</a>
|
2021-05-24 23:53:06 +02:00
|
|
|
</div>
|
|
|
|
<div id="navbar" class="navbar-menu">
|
|
|
|
<!-- In case of another navbar-start right after -->
|
|
|
|
<div class="navbar-start mr-0">
|
|
|
|
<a class="navbar-item {{ if eq .Permalink .Site.Home.Permalink }}is-active is-tab{{ end }}" href="{{ .Site.Home.Permalink }}">Accueil</a>
|
|
|
|
<div class="navbar-item has-dropdown is-hoverable">
|
|
|
|
<a class="navbar-link">
|
|
|
|
Catégories
|
|
|
|
</a>
|
|
|
|
<div class="navbar-dropdown">
|
|
|
|
{{ range $key, $value := .Site.Taxonomies.categories }}
|
|
|
|
<a class="navbar-item {{ if eq $.Permalink .Page.Permalink }}is-active{{ end }}" href="{{ .Page.Permalink }}">
|
|
|
|
{{ $key | humanize }}
|
|
|
|
<span class="tag ml-2 is-rounded">{{ len . }}</span>
|
2021-05-22 00:16:10 +02:00
|
|
|
</a>
|
2021-05-24 23:53:06 +02:00
|
|
|
{{ end }}
|
2021-05-22 00:16:10 +02:00
|
|
|
</div>
|
2021-05-24 23:53:06 +02:00
|
|
|
</div>
|
|
|
|
<div class="navbar-item has-dropdown is-hoverable">
|
|
|
|
<a class="navbar-link">
|
|
|
|
Dossiers
|
|
|
|
</a>
|
|
|
|
<div class="navbar-dropdown">
|
|
|
|
{{ range where .Site.Pages "Params.Code" "!=" nil }}
|
|
|
|
<a class="navbar-item {{ if eq $.Permalink .Page.Permalink }}is-active{{ end }}" href="{{ .Page.Permalink }}">
|
|
|
|
{{ .Title | humanize }}
|
|
|
|
{{ $casePosts := where .Site.RegularPages "CurrentSection.Params.Code" "==" .Params.Code }}
|
|
|
|
<span class="tag ml-2 is-rounded">{{ len $casePosts }}</span>
|
2021-05-21 14:53:35 +02:00
|
|
|
</a>
|
2021-05-24 23:53:06 +02:00
|
|
|
{{ end }}
|
2021-05-21 14:53:35 +02:00
|
|
|
</div>
|
2021-05-21 23:50:10 +02:00
|
|
|
</div>
|
2021-05-21 14:53:35 +02:00
|
|
|
</div>
|
2021-05-24 23:53:06 +02:00
|
|
|
<!-- start/end menu shares the exact same code, just not the same position, factorize with a loop -->
|
|
|
|
{{ $currentPage := . }}
|
|
|
|
{{ range (slice "start" "end")}}
|
|
|
|
{{ $menu_name := . }}
|
|
|
|
<div class="navbar-{{ . }} mr-2">
|
|
|
|
<!-- now get the menu if it exists -->
|
|
|
|
{{ with index $.Site.Menus $menu_name }}
|
|
|
|
<!-- and range over its pages -->
|
|
|
|
{{ range . }}
|
|
|
|
{{ if .HasChildren }}
|
|
|
|
<div class="navbar-item has-dropdown is-hoverable {{ if $currentPage.HasMenuCurrent $menu_name . }}is-active is-tab{{ end }}">
|
|
|
|
<a class="navbar-link">
|
|
|
|
{{ .Pre }}
|
|
|
|
<span>{{ .Name }}</span>
|
|
|
|
</a>
|
|
|
|
<div class="navbar-dropdown">
|
|
|
|
{{ range .Children }}
|
|
|
|
<a class="navbar-item {{ if $currentPage.IsMenuCurrent $menu_name . }}is-active is-tab{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{ else }}
|
|
|
|
<a class="navbar-item {{ if $currentPage.IsMenuCurrent $menu_name . }}is-active is-tab{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2021-05-21 14:53:35 +02:00
|
|
|
</div>
|
2021-05-18 17:07:00 +02:00
|
|
|
</nav>
|