Amélioration et simplification du menu ls.
This commit is contained in:
@@ -114,6 +114,17 @@ a:active {
|
|||||||
color: $lightgreen;
|
color: $lightgreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Couleur différente pour les répertoire dans le menu ls */
|
||||||
|
.lsresult li.directory {
|
||||||
|
a:link {
|
||||||
|
color: $blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:visited {
|
||||||
|
color: $lightblue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Colorisation du code en ligne.
|
// Colorisation du code en ligne.
|
||||||
code:not([class]) {
|
code:not([class]) {
|
||||||
color: $green;
|
color: $green;
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ frontmatter:
|
|||||||
- :default
|
- :default
|
||||||
|
|
||||||
params:
|
params:
|
||||||
owner: alexis
|
|
||||||
group: alexis
|
|
||||||
|
|
||||||
pagination:
|
pagination:
|
||||||
pagerSize: 15
|
pagerSize: 15
|
||||||
|
|||||||
@@ -4,13 +4,24 @@
|
|||||||
</span>
|
</span>
|
||||||
<span aria-hidden="true" style="text-align: right">
|
<span aria-hidden="true" style="text-align: right">
|
||||||
{{/* Nombre d'éléments dans le nœud, sinon 1 si c'est un fichier. */}}
|
{{/* Nombre d'éléments dans le nœud, sinon 1 si c'est un fichier. */}}
|
||||||
{{ cond $page.IsNode (len $page.Pages) "1" }}
|
{{ cond (and $page.IsNode (not .forceFile)) (len $page.Pages) "1" }}
|
||||||
</span>
|
</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">
|
<span aria-hidden="true" style="text-align: right">
|
||||||
{{/* La taille d'un répertoire est 4Kio. */}}
|
{{/* La taille d'un répertoire est 4Kio. */}}
|
||||||
{{ cond $page.IsNode "4096" $page.Len }}
|
{{ $bytes := int (cond $page.IsNode (cond .forceFile (len $page.Content) 4096) $page.Len) }}
|
||||||
|
{{/* log(0) vaut -inf., donc on force base à 0 dans ce cas. */}}
|
||||||
|
{{ $base := cond (eq $bytes 0) 0 (int (div (math.Log $bytes) (math.Log 1024))) }}
|
||||||
|
{{ $divider := float (math.Pow 1024 $base) }}
|
||||||
|
{{ $value := div $bytes $divider }}
|
||||||
|
{{ $unit := index (slice "" "K" "M" "G") $base }}
|
||||||
|
{{ if eq $base 0 }}
|
||||||
|
{{ $bytes }}
|
||||||
|
{{ else if lt $value 10 }}
|
||||||
|
{{ lang.FormatNumber 1 $value }}{{ $unit }}
|
||||||
|
{{ else }}
|
||||||
|
{{ lang.FormatNumber 0 (math.Round $value) }}{{ $unit }}
|
||||||
|
{{ end }}
|
||||||
|
{{/* cond $page.IsNode (cond .forceFile (len $page.Content) "4096") $page.Len */}}
|
||||||
</span>
|
</span>
|
||||||
{{ with (or $page.PublishDate $page.Lastmod) }}
|
{{ with (or $page.PublishDate $page.Lastmod) }}
|
||||||
<span aria-hidden="true" style="text-align: right">{{ .Day }}</span>
|
<span aria-hidden="true" style="text-align: right">{{ .Day }}</span>
|
||||||
@@ -30,7 +41,9 @@
|
|||||||
aria-current="page"
|
aria-current="page"
|
||||||
{{ end }}
|
{{ end }}
|
||||||
href="{{ $page.RelPermalink }}"
|
href="{{ $page.RelPermalink }}"
|
||||||
title="{{ $page.Title }}">{{ or .linkTitle (print
|
title="{{ $page.Title }}"
|
||||||
$page.File.BaseFileName "." $page.File.Ext) $page.LinkTitle }}</a>
|
>
|
||||||
|
{{ or .linkTitle (print $page.File.BaseFileName "." $page.File.Ext) $page.LinkTitle }}{{ cond (and $page.IsNode (not .forceFile)) "/" "" }}
|
||||||
|
</a>
|
||||||
</span>
|
</span>
|
||||||
{{/* vim: set tw=80 ts=2 sw=2 sts=2 ft=gohtmltmpl: */}}
|
{{/* vim: set tw=80 ts=2 sw=2 sts=2 ft=gohtmltmpl: */}}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{{ $page := . }}
|
{{ $page := . }}
|
||||||
<div class="cmdblock">
|
<div class="cmdblock">
|
||||||
<nav role="menu" aria-label="menu">
|
<nav role="menu" aria-label="menu">
|
||||||
<p aria-hidden="true" class="prompt">ls -alh</p>
|
<p aria-hidden="true" class="prompt">ls -pagot --group-directories-first</p>
|
||||||
{{/* . et .. sont comptés dans le calcul. */}}
|
{{/* . et .. sont comptés dans le calcul de la taille. */}}
|
||||||
{{ $sum := add 4096 4096 }}
|
{{ $sum := add 4096 4096 }}
|
||||||
{{ range .Pages }}
|
{{ range .Pages }}
|
||||||
{{/* Un nœud c'est 4096 octets. */}}
|
{{/* Un nœud c'est 4096 octets. */}}
|
||||||
|
|||||||
Reference in New Issue
Block a user