diff --git a/layouts/_partials/lsline.html b/layouts/_partials/lsline.html
index 9c8b0c2..4cfed12 100644
--- a/layouts/_partials/lsline.html
+++ b/layouts/_partials/lsline.html
@@ -1,28 +1,24 @@
{{ $page := .page }}
-
- {{ if not $page.IsNode }}
- -rw-r--r--
- {{ else }}
- drwxr-xr-x
- {{ end }}
-
+{{ cond $page.IsNode "drwxr-xr-x" "-rw-r--r--" }}
- {{ if $page.IsNode }}{{ len $page.Pages }}{{ else }}1{{ end }}
+ {{/* Nombre d'éléments dans le nœud, sinon 1 si c'est un fichier. */}}
+ {{ cond $page.IsNode (len $page.Pages) "1" }}
{{ $page.Site.Params.owner }}
{{ $page.Site.Params.group }}
{{/* La taille d'un répertoire est 4Kio. */}}
- {{ if $page.IsNode }}4096{{ else }}{{ $page.Len }}{{ end }}
+ {{ cond $page.IsNode "4096" $page.Len }}
{{ with (or $page.PublishDate $page.Lastmod) }}
{{ .Day }}
{{ .Format "Jan" }}
- {{ if eq .Year time.Now.Year }}
- {{ . | time.Format ":time_short" }}
- {{ else }}
+ {{/* Si l'élément est modifié depuis plus de 6 mois on affiche l'année, sinon l'heure */}}
+ {{ if gt (time.Now.Sub .) (duration "hour" (mul 6 30 24)) }}
{{ .Year }}
+ {{ else }}
+ {{ . | time.Format ":time_short" }}
{{ end }}
{{ end }}
diff --git a/layouts/_partials/lsmenu.html b/layouts/_partials/lsmenu.html
index 0573cf8..4d1ab5c 100644
--- a/layouts/_partials/lsmenu.html
+++ b/layouts/_partials/lsmenu.html
@@ -11,16 +11,16 @@
{{/* La commande ls affiche total en Kio. */}}
total {{ math.Floor (div $sum 1024) }}
- - {{ partial "lsline.html" (dict "page" . "linkTitle" ".") }}
- - {{ partial "lsline.html" (dict "page" (or .Parent .) "linkTitle" "..") }}
+ - {{ partial "lsline.html" (dict "page" . "linkTitle" ".") }}
+ - {{ partial "lsline.html" (dict "page" (or .Parent .) "linkTitle" "..") }}
{{ range .Sections.ByLastmod.Reverse }}
- -
+
-
{{ partial "lsline.html" (dict "page" . "linkTitle" .LinkTitle) }}
{{ end }}
{{ range .Pages.ByPublishDate.Reverse }}
{{ if .IsPage }}
- -
+
-
{{ partial "lsline.html" (dict "page" . "linkTitle" .LinkTitle "currentPage" $page) }}
{{ end }}