From b9086e513a63372d5d9548843ea757a3a53d2a8b Mon Sep 17 00:00:00 2001 From: alexisben <alex@noesya.coop> Date: Tue, 17 Jan 2023 09:39:30 +0100 Subject: [PATCH] sitemap toc wip --- layouts/partials/sitemap/toc.html | 2 +- layouts/sitemap/list.html | 43 +++++++++++++++++++------------ 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/layouts/partials/sitemap/toc.html b/layouts/partials/sitemap/toc.html index 49a56588..c4f755cd 100644 --- a/layouts/partials/sitemap/toc.html +++ b/layouts/partials/sitemap/toc.html @@ -1,4 +1,4 @@ -<nav class="toc" id="nav-toc" aria-label="Table des matières"> +<nav class="toc" id="nav-toc" aria-label="{{ i18n "commons.toc" }}"> <ol> {{ range site.Sections }} {{ if ne .Type "sitemap" }} diff --git a/layouts/sitemap/list.html b/layouts/sitemap/list.html index fe90eda7..61410ead 100644 --- a/layouts/sitemap/list.html +++ b/layouts/sitemap/list.html @@ -5,25 +5,34 @@ "image" .Params.image "context" . ) -}} - <div class="document-content container"> - <div class="content"> - {{- partial "sitemap/document-nav" . -}} - <div> - {{ range site.Sections }} - {{ if ne .Type "sitemap" }} - {{ $permalink := .Permalink }} - <h3 id="{{ .Type }}"> - <a href="{{ $permalink }}">{{ safeHTML .Title }}</a> - </h3> - <ul> - {{ range where .Site.Pages "Section" .Type }} - {{ if ne $permalink .Permalink }} - <li><a href="{{ .Permalink }}">{{ safeHTML .Title }}</a></li> + <div class="document-content"> + {{ partial "toc/container.html" + (dict + "toc" "sitemap/toc.html" + "context" . + ) + }} + <div class="container"> + <div class="content"> + {{- partial "sitemap/document-nav" . -}} + + <div> + {{ range site.Sections }} + {{ if ne .Type "sitemap" }} + {{ $permalink := .Permalink }} + <h3 id="{{ .Type }}"> + <a href="{{ $permalink }}">{{ safeHTML .Title }}</a> + </h3> + <ul> + {{ range where .Site.Pages "Section" .Type }} + {{ if ne $permalink .Permalink }} + <li><a href="{{ .Permalink }}">{{ safeHTML .Title }}</a></li> + {{ end }} {{ end }} - {{ end }} - </ul> + </ul> + {{ end }} {{ end }} - {{ end }} + </div> </div> </div> </div> -- GitLab