{{ $site := .Get "site" }} {{ $sep := "," }} {{ $filePath := printf "csv/%s-count.csv" $site }} {{ $csvFile := resources.Get $filePath }} {{ if $csvFile }} {{ $csv := $csvFile | transform.Unmarshal (dict "delimiter" $sep) }} {{ range $i, $r := after 1 $csv }} {{ end }} {{ else }}

Error: CSV File not found or couldn't be loaded.

{{ end }} {{- if eq $site "handbook" }} {{- $scratch := newScratch }} {{- range .Site.RegularPages }} {{- $scratch.Add "wordcount" .WordCount }} {{- end }} {{ end }}
Date Word Count Page Count Notes
{{ index $r 0 }} {{ lang.FormatNumberCustom 0 (index $r 1) }} {{ lang.FormatNumberCustom 0 (index $r 2) }} {{ index $r 3 }}
{{ time.Format "2006-01-02" time.Now }} {{ $scratch.Get "wordcount" | lang.FormatNumberCustom 0 }} {{ len .Site.RegularPages | lang.FormatNumberCustom 0 }} ⬅️ Hugo generated Live Count