diff --git a/data/gitinfo.txt b/data/gitinfo.txt new file mode 100644 index 0000000..7755fa9 --- /dev/null +++ b/data/gitinfo.txt @@ -0,0 +1,4 @@ +2025-05-15 +21:31 +a0f361e +a0f361e2e17c0027b08aa9bc3ae7ccfa47349b1b diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 36463b7..0157989 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -24,13 +24,28 @@ Flux RSS - {{ $gitinfo := readFile "data/gitinfo.txt" | split "\n" }} - - {{ $date := index $gitinfo 0 }} - {{ $time := index $gitinfo 1 }} - {{ $commit := index $gitinfo 2 }} - {{ $fullcommit := index $gitinfo 3 }} - Mis à jour le $date à $time (Commit {{ $commit }} + {{- print " · "}} + + {{ with (readFile "data/gitinfo.txt") }} + {{ $raw := . }} + {{ $lines := slice }} + {{ range split (replace $raw "\r\n" "\n") "\n" }} + {{ if ne . "" }} + {{ $lines = $lines | append . }} + {{ end }} + {{ end }} + + {{ if ge (len $lines) 4 }} + + Mis à jour le {{ index $lines 0 }} à {{ index $lines 1 }} + (Commit {{ index $lines 2 }}) + + {{ else }} + Information de mise à jour non disponible + {{ end }} + {{ else }} + Fichier gitinfo non trouvé + {{ end }} {{- end }}