diff --git a/assets/sass/_theme/blocks/sitemap.sass b/assets/sass/_theme/blocks/sitemap.sass new file mode 100644 index 0000000000000000000000000000000000000000..aaa5c685b190f6e17b43bf588ae7f1a574a7fb95 --- /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 b72aa25f8968967c479754e0dab3c24c4a03a669..8ffa13c6c38ce10e7acd891dd3fdf90ff5fce519 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 0eda955af3947a08420ad5b465e537bcd668334c..0000000000000000000000000000000000000000 --- 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 4604f40ad6caaff54b3bc4e0e41c91ac193703ef..0000000000000000000000000000000000000000 --- a/content/sitemap/_index.fr.html +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Plan du site -url: plan-du-site ---- diff --git a/layouts/pages/sitemap.html b/layouts/pages/sitemap.html new file mode 100644 index 0000000000000000000000000000000000000000..65c90074fbb9dbb40673dbc10da0ee2cfef12b55 --- /dev/null +++ b/layouts/pages/sitemap.html @@ -0,0 +1,46 @@ +{{ define "main" }} + {{- partial "header/hero.html" + (dict + "title" .Title + "image" .Params.image + "context" . + ) -}} + + <div class="document-content"> + {{ partial "toc/container.html" + (dict + "toc" "sitemap/toc.html" + "context" . + ) }} + + {{ 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 }}"> + <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 }} + </ul> + {{ end }} + {{ end }} + </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 0b722516ff055ca9fa3011ff667c437489cc81cb..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..4ed5a570f5d60bc07d29393efb221e5fa06a7b8b --- /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 49a56588ba823b9ecde52462a812f1e0f2ba04da..8f82e88ef95831d065d81946b0a6376e6fe10cd4 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="Table des matières"> +<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> diff --git a/layouts/sitemap/list.html b/layouts/sitemap/list.html deleted file mode 100644 index fe90eda7eef2795dd2920d1820ee7418e98e0c39..0000000000000000000000000000000000000000 --- a/layouts/sitemap/list.html +++ /dev/null @@ -1,30 +0,0 @@ -{{ define "main" }} - {{- partial "header/hero.html" - (dict - "title" .Title - "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> - {{ end }} - {{ end }} - </ul> - {{ end }} - {{ end }} - </div> - </div> - </div> -{{ end }}