Skip to content
Snippets Groups Projects
Commit 522e98df authored by Arnaud Levy's avatar Arnaud Levy
Browse files

better sitemap

parent ca6286e4
No related branches found
No related tags found
No related merge requests found
// C'est vraiment utilisé qqpart ça ?
.sitemap__section
.content
> div
......@@ -10,4 +11,18 @@
@include media-breakpoint-up(desktop)
margin-bottom: 7.5rem
li
margin-bottom: 1rem
\ No newline at end of file
margin-bottom: 1rem
.block-sitemap
ul
list-style-type: none
li
position: relative
ul
margin-left: $spacing-3
li
a
@include icon(list-hyphen)
&::before
position: absolute
left: pxToRem(-24)
font-size: pxToRem(24)
......@@ -22,17 +22,13 @@
{{ partial "contents/list.html" . }}
{{ range .Site.Sections }}
{{ if ne .Type "sitemap" }}
{{ if and (ne .Type "sitemap") (ne .Type "pages") }}
{{ $permalink := .Permalink }}
<div class="block block-sitemap" id="{{ .Type }}">
<div class="container">
<div class="block-content">
{{ $isPageRoot := eq .RelPermalink "/pages/"}}
<div class="block-content">
<h2>
{{ if not $isPageRoot }}<a href="{{ $permalink }}">{{ end }}
{{ safeHTML .Title }}
{{ if not $isPageRoot }}</a>{{ end }}
<a href="{{ $permalink }}">{{ safeHTML .Title }}</a>
</h2>
<ul>
{{ range where .Site.Pages "Section" .Type }}
......@@ -46,5 +42,25 @@
</div>
{{ end }}
{{ end }}
<div class="block block-sitemap" id="pages">
<div class="container">
<div class="block-content">
<h2>Pages</h2>
<ul>
{{ range (where .Site.Pages "Type" "pages") }}
{{ if eq .Parent.Path "/pages" }}
<li>
<a href="{{ .Permalink }}">{{ safeHTML .Title }}</a>
{{ if .Pages }}
{{ partial "pages/sitemap_recursive_pages" .}}
{{ end }}
</li>
{{ end }}
{{ end }}
</ul>
</div>
</div>
</div>
</div>
{{ end }}
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ safeHTML .Title }}</a>
{{ if .Pages }}
{{ partial "pages/sitemap_recursive_pages.html" . }}
{{ end }}
</li>
{{ end }}
</ul>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment