Amélioration du menu ls.

Avec notamment l'ajout de l'entrée de la section courante _index.md, et de
l'attribut aria-current quand nécessaire.
This commit is contained in:
2026-03-25 00:47:58 +01:00
parent b8a3d89e03
commit de5d7bb639
3 changed files with 24 additions and 23 deletions
+13 -8
View File
@@ -11,19 +11,24 @@
{{/* La commande ls affiche total en Kio. */}}
<p aria-hidden="true">total {{ math.Floor (div $sum 1024) }}</p>
<ul class="lsresult">
<li class="directory">{{ partial "lsline.html" (dict "page" . "linkTitle" ".") }}</li>
<li class="directory">{{ partial "lsline.html" (dict "page" (or .Parent .) "linkTitle" "..") }}</li>
{{ range .Sections.ByLastmod.Reverse }}
<li class="directory">
{{ partial "lsline.html" (dict "page" .CurrentSection "linkTitle" "." "currentPage" $page) }}
</li>
<li class="directory">
{{ partial "lsline.html" (dict "page" (or .Parent .CurrentSection) "linkTitle" ".." "currentPage" $page) }}
</li>
{{ range .CurrentSection.Sections.ByLastmod.Reverse }}
<li class="directory">
{{ partial "lsline.html" (dict "page" . "linkTitle" .LinkTitle) }}
{{ partial "lsline.html" (dict "page" . "linkTitle" .File.ContentBaseName "currentPage" $page ) }}
</li>
{{ end }}
{{ range .Pages.ByPublishDate.Reverse }}
{{ if .IsPage }}
<li class="file" aria-hidden="true">
{{ partial "lsline.html" (dict "page" .CurrentSection "forceFile" true "linkTitle" (path.Base .CurrentSection) "currentPage" $page) }}
</li>
{{ range .CurrentSection.RegularPages.ByPublishDate.Reverse }}
<li class="file">
{{ partial "lsline.html" (dict "page" . "linkTitle" .LinkTitle "currentPage" $page) }}
{{ partial "lsline.html" (dict "page" . "linkTitle" .File.LogicalName "currentPage" $page) }}
</li>
{{ end }}
{{ end }}
</ul>
</nav>