Menu de type ls.
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-03-18 23:09:00 +01:00
parent 360ab46988
commit 9fc9d86024
5 changed files with 118 additions and 1 deletions
+18
View File
@@ -109,6 +109,24 @@ a:active {
} }
} }
ul.lsresult {
margin: 0;
padding: 0;
display: table;
li {
display: table-row;
}
li span {
display: table-cell;
}
li span:not(:first-child) {
padding-left: 1ch;
}
}
// Menus. // Menus.
// ====== // ======
.menu { .menu {
+4
View File
@@ -16,6 +16,10 @@ frontmatter:
- :fileModTime - :fileModTime
- :default - :default
params:
owner: alexis
group: alexis
pagination: pagination:
pagerSize: 15 pagerSize: 15
+11 -1
View File
@@ -1,4 +1,14 @@
{{ partial "breadcrumb.html" . }} {{ partial "breadcrumb.html" . }}
{{ partial "menu.html" . }} {{ partial "lsmenu.html" (cond .IsNode . .CurrentSection) }}
<div class="cmdblock">
<p aria-hidden="true" class="prompt">
{{ if .IsNode }}
sommaire .
{{ else }}
cat {{ .LinkTitle }}
{{ end }}
</p>
</div>
{{/* vim: set tw=80 ts=2 sw=2 sts=2 ft=gohtmltmpl: */}} {{/* vim: set tw=80 ts=2 sw=2 sts=2 ft=gohtmltmpl: */}}
+42
View File
@@ -0,0 +1,42 @@
{{ $page := .page }}
<span aria-hidden="true">
{{ if not $page.IsNode }}
-rw-r--r--
{{ else }}
drwxr-xr-x
{{ end }}
</span>
<span aria-hidden="true" style="text-align: right">
{{ if $page.IsNode }}{{ len $page.Pages }}{{ else }}1{{ end }}
</span>
<span aria-hidden="true">{{ $page.Site.Params.owner }}</span>
<span aria-hidden="true">{{ $page.Site.Params.group }}</span>
<span aria-hidden="true" style="text-align: right">
{{/* La taille d'un répertoire est 4Kio. */}}
{{ if $page.IsNode }}4096{{ else }}{{ $page.Len }}{{ end }}
</span>
{{ with (or $page.PublishDate $page.Lastmod) }}
<span aria-hidden="true" style="text-align: right">{{ .Day }}</span>
<span aria-hidden="true">{{ .Format "Jan" }}</span>
<span aria-hidden="true" style="text-align: right">
{{ if eq .Year time.Now.Year }}
{{ . | time.Format ":time_short" }}
{{ else }}
{{ .Year }}
{{ end }}
</span>
{{ end }}
<span>
<a class="{{ with $page.Params.class -}}{{ . }}{{ end }}"
{{ with .currentPage }}
{{ if .Eq $page }}
href=""
{{ else }}
href="{{ $page.RelPermalink }}"
{{ end }}
{{ else }}
href="{{ $page.RelPermalink }}"
{{ end }}
title="{{ $page.Title }}">{{ or .linkTitle $page.LinkTitle }}</a>
</span>
{{/* vim: set tw=80 ts=2 sw=2 sts=2 ft=gohtmltmpl: */}}
+43
View File
@@ -0,0 +1,43 @@
{{ $page := . }}
<div class="cmdblock">
<nav role="menu" aria-label="menu">
<p aria-hidden="true" class="prompt">ls -alh</p>
{{/* . et .. sont comptés dans le calcul. */}}
{{ $sum := add 4096 4096 }}
{{ range .Pages }}
{{ if .IsNode }}
{{/* Un nœud c'est 4096 octets. */}}
{{ $sum = add $sum 4096 }}
{{ else }}
{{ $sum = add $sum .Len }}
{{ end }}
{{ end }}
{{/* La commande ls affiche total en Kio. */}}
<p aria-hidden="true">total {{ math.Floor (div $sum 1024) }}</p>
<ul class="lsresult">
<li>
{{ partial "lsline.html" (dict "page" . "linkTitle" ".") }}
</li>
<li>
{{ if .Parent }}
{{ partial "lsline.html" (dict "page" .Parent "linkTitle" "..") }}
{{ else }}
{{ partial "lsline.html" (dict "page" . "linkTitle" "..") }}
{{ end }}
</li>
{{ range .Sections.ByLastmod.Reverse }}
<li>
{{ partial "lsline.html" (dict "page" . "linkTitle" .LinkTitle) }}
</li>
{{ end }}
{{ range .Pages.ByPublishDate.Reverse }}
{{ if .IsPage }}
<li>
{{ partial "lsline.html" (dict "page" . "linkTitle" .LinkTitle "currentPage" $page) }}
</li>
{{ end }}
{{ end }}
</ul>
</nav>
</div>
{{/* vim: set tw=80 ts=2 sw=2 sts=2 ft=gohtmltmpl: */}}