1

Introduction du nouveau thème

This commit is contained in:
2025-10-11 00:36:18 +02:00
parent fa5ba208ed
commit 2653b0fa01
112 changed files with 1590 additions and 2766 deletions

View File

@@ -0,0 +1,53 @@
{{- $current := . }}
{{- $currentTitle := .Title }}
{{- $position := .Scratch.Get "paginationPosition" | default "up" }}
{{- with index .Params.dossier 0 }}
{{- $dossierID := . }}
{{- $allPages := site.RegularPages }}
{{- $filtered := where $allPages "Params.dossier" "intersect" (slice $dossierID) }}
{{- $valid := where $filtered "Weight" "gt" 0 }}
{{- $sorted := sort $valid "Weight" }}
{{- if gt (len $sorted) 1 }}
{{- $index := -1 }}
{{- range $i, $p := $sorted }}
{{- if eq $p.Permalink $current.Permalink }}
{{- $index = $i }}
{{- end }}
{{- end }}
{{- $prev := index $sorted (sub $index 1) }}
{{- $next := index $sorted (add $index 1) }}
{{- with $dossierID -}}
<div class="sup-title">{{ . }}</div>
{{- end -}}
<nav class="pagination" aria-label="Sommaire du dossier">
{{- if ge $index 1 }}
<a class="prev" href="{{ $prev.RelPermalink }}" title="Page précédente"></a>
{{- else }}
<span class="disabled prev"></span>
{{- end }}
<details class="{{ $position }}">
<summary>Sommaire</summary>
<ul class="stat">
{{- range $i, $p := $sorted }}
<li>
{{- if eq $p.Permalink $current.Permalink }}
<span class="current">{{ $p.Title }}</span>
{{- else }}
<a href="{{ $p.RelPermalink }}">{{ $p.Title }}</a>
{{- end }}
</li>
{{- end }}
</ul>
</details>
{{- if lt (add $index 1) (len $sorted) }}
<a class="next" href="{{ $next.RelPermalink }}" title="Page suivante"></a>
{{- else }}
<span class="disabled next"></span>
{{- end }}
</nav>
{{- end }}
{{- end }}