{{/* Group word counts per month */}} {{ $monthly := dict }} {{ range .Site.RegularPages }} {{ $month := .Date.Format "2006-01" }} {{ $count := .WordCount }} {{ with index $monthly $month }} {{ $monthly = merge $monthly (dict $month (add . $count)) }} {{ else }} {{ $monthly = merge $monthly (dict $month $count) }} {{ end }} {{ end }} {{/* Sort months */}} {{ $months := slice }} {{ range $month, $_ := $monthly }} {{ $months = $months | append $month }} {{ end }} {{ $months = sort $months }} {{/* Find max value */}} {{ $max := 0 }} {{ range $month := $months }} {{ $val := index $monthly $month }} {{ if gt $val $max }}{{ $max = $val }}{{ end }} {{ end }}