Introduction du nouveau thème
This commit is contained in:
22
themes/42/layouts/_partials/site-stats.html
Normal file
22
themes/42/layouts/_partials/site-stats.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{{- $site := .Site -}}
|
||||
{{- $title := $site.Title -}}
|
||||
{{- $totalArticles := len $site.RegularPages -}}
|
||||
{{- $allSections := where $site.Pages "Kind" "section" -}}
|
||||
{{- $allSections = where $allSections "RelPermalink" "!=" "/" -}}
|
||||
{{- $leafSections := slice -}}
|
||||
{{- range $allSections -}}
|
||||
{{- if eq (len .Sections) 0 -}}
|
||||
{{- $leafSections = $leafSections | append . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $sectionsCount := len $leafSections -}}
|
||||
{{- $lastMod := $site.Lastmod | time.Format "02/01/2006" -}}
|
||||
<section id="site-stats">
|
||||
<hr class="mirror" />
|
||||
<div aria-label="Statistiques" class="stats">
|
||||
{{ partial "stat.html" (dict "title" "Articles publiés" "value" $totalArticles)}}
|
||||
{{ partial "stat.html" (dict "title" "Thématiques" "value" $sectionsCount)}}
|
||||
{{ partial "stat.html" (dict "title" "Dernière mise à jour" "value" $lastMod)}}
|
||||
</div>
|
||||
<hr />
|
||||
</section>
|
||||
Reference in New Issue
Block a user