From b68bcec3d860bbdf782629172aa6ded220921257 Mon Sep 17 00:00:00 2001
From: alexisben <alex@noesya.coop>
Date: Tue, 17 Jan 2023 14:08:37 +0100
Subject: [PATCH] fix sitemap

---
 assets/sass/_theme/blocks/sitemap.sass        |  6 +++++
 assets/sass/_theme/hugo-osuny.sass            |  1 +
 content/sitemap/_index.en.html                |  3 ---
 content/sitemap/_index.fr.html                |  4 ---
 .../{sitemap/list.html => pages/sitemap.html} | 25 ++++++++++++-------
 layouts/partials/sitemap/document-nav.html    |  5 ----
 layouts/partials/sitemap/summary.html         |  1 +
 layouts/partials/sitemap/toc.html             |  3 +++
 8 files changed, 27 insertions(+), 21 deletions(-)
 create mode 100644 assets/sass/_theme/blocks/sitemap.sass
 delete mode 100644 content/sitemap/_index.en.html
 delete mode 100644 content/sitemap/_index.fr.html
 rename layouts/{sitemap/list.html => pages/sitemap.html} (73%)
 delete mode 100644 layouts/partials/sitemap/document-nav.html
 create mode 100644 layouts/partials/sitemap/summary.html

diff --git a/assets/sass/_theme/blocks/sitemap.sass b/assets/sass/_theme/blocks/sitemap.sass
new file mode 100644
index 00000000..aaa5c685
--- /dev/null
+++ b/assets/sass/_theme/blocks/sitemap.sass
@@ -0,0 +1,6 @@
+.block-sitemap
+    h3 
+      a 
+        text-decoration: none
+    ul + h3
+      margin-top: $spacing3
\ No newline at end of file
diff --git a/assets/sass/_theme/hugo-osuny.sass b/assets/sass/_theme/hugo-osuny.sass
index b72aa25f..8ffa13c6 100644
--- a/assets/sass/_theme/hugo-osuny.sass
+++ b/assets/sass/_theme/hugo-osuny.sass
@@ -45,6 +45,7 @@
 @import "blocks/partners"
 @import "blocks/posts"
 @import "blocks/programs"
+@import "blocks/sitemap"
 @import "blocks/summary"
 @import "blocks/testimonials"
 @import "blocks/timeline"
diff --git a/content/sitemap/_index.en.html b/content/sitemap/_index.en.html
deleted file mode 100644
index 0eda955a..00000000
--- a/content/sitemap/_index.en.html
+++ /dev/null
@@ -1,3 +0,0 @@
----
-title: Sitemap
----
diff --git a/content/sitemap/_index.fr.html b/content/sitemap/_index.fr.html
deleted file mode 100644
index 4604f40a..00000000
--- a/content/sitemap/_index.fr.html
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: Plan du site
-url: plan-du-site
----
diff --git a/layouts/sitemap/list.html b/layouts/pages/sitemap.html
similarity index 73%
rename from layouts/sitemap/list.html
rename to layouts/pages/sitemap.html
index 61410ead..65c90074 100644
--- a/layouts/sitemap/list.html
+++ b/layouts/pages/sitemap.html
@@ -5,19 +5,25 @@
           "image" .Params.image
           "context" .
         ) -}}
+
   <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 }}
+      ) }}
+
+    {{ partial "sitemap/summary.html" (dict
+      "context" .
+      "block_wrapped" true
+      ) }}
+
+    {{ partial "blocks/list.html" . }}
+
+    <section class="block block-sitemap">
+      <div class="container">
+        <div class="block-content">
+          {{ range .Site.Sections }}
             {{ if ne .Type "sitemap" }}
               {{ $permalink := .Permalink }}
               <h3 id="{{ .Type }}">
@@ -34,6 +40,7 @@
           {{ end }}
         </div>
       </div>
-    </div>
+    </section>
+    
   </div>
 {{ end }}
diff --git a/layouts/partials/sitemap/document-nav.html b/layouts/partials/sitemap/document-nav.html
deleted file mode 100644
index 0b722516..00000000
--- a/layouts/partials/sitemap/document-nav.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="document-nav">
-  <div>
-    {{- partial "sitemap/toc.html" . -}}
-  </div>
-</div>
\ No newline at end of file
diff --git a/layouts/partials/sitemap/summary.html b/layouts/partials/sitemap/summary.html
new file mode 100644
index 00000000..4ed5a570
--- /dev/null
+++ b/layouts/partials/sitemap/summary.html
@@ -0,0 +1 @@
+{{- partial "commons/summary.html" . -}}
diff --git a/layouts/partials/sitemap/toc.html b/layouts/partials/sitemap/toc.html
index c4f755cd..8f82e88e 100644
--- a/layouts/partials/sitemap/toc.html
+++ b/layouts/partials/sitemap/toc.html
@@ -1,5 +1,8 @@
 <nav class="toc" id="nav-toc" aria-label="{{ i18n "commons.toc" }}">
   <ol>
+    {{- if .context.Params.blocks -}}
+      {{- partial "blocks/toc.html" .context.Params.blocks -}}
+    {{- end -}}
     {{ range site.Sections }}
       {{ if ne .Type "sitemap" }}
         <li>
-- 
GitLab