{{ define "main" }}
{{- .Content -}}

Etwas Statistik

Jahresweise sind folgende Werte summiert: Touren, Teilnehmer, Distanz und Höhenmeter.

{{ $pages := where .Site.RegularPages "Type" "in" (slice "posts") }} {{ $maxDist := 0.0 }} {{ $maxDistYear := "" }} {{ $maxAscent := 0.0 }} {{ $maxAscentYear := "" }} {{ $maxMembers := 0 }} {{ $maxMembersYear := "" }} {{ $maxTours := 0 }} {{ $maxToursYear := "" }} {{ range $pages.GroupByDate "2006" }} {{ $dist := 0 }} {{ $ascent := 0 }} {{ $members := 0 }} {{ $tours := 0 }} {{ range .Pages }} {{ with .Params.distance_km }} {{ $dist = add . $dist }} {{ end }} {{ with .Params.ascent_m }} {{ $ascent = add . $ascent }} {{ end }} {{ with .Params.members }} {{ $members = add ( len . ) $members }} {{ end }} {{ $tours = add 1 $tours }} {{ end }} {{ if gt $dist $maxDist }} {{ $maxDist = $dist }} {{ $maxDistYear = .Key }} {{ end }} {{ if gt $ascent $maxAscent }} {{ $maxAscent = $ascent }} {{ $maxAscentYear = .Key }} {{ end }} {{ if gt $members $maxMembers }} {{ $maxMembers = $members }} {{ $maxMembersYear = .Key }} {{ end }} {{ if gt $tours $maxTours }} {{ $maxTours = $tours }} {{ $maxToursYear = .Key }} {{ end }} {{ end }} {{ range $pages.GroupByDate "2006" }} {{ $dist := 0 }} {{ $ascent := 0 }} {{ $members := 0 }} {{ $tours := 0 }} {{ range .Pages }} {{ with .Params.distance_km }} {{ $dist = add . $dist }} {{ end }} {{ with .Params.Ascent_m }} {{ $ascent = add . $ascent }} {{ end }} {{ with .Params.members }} {{ $members = add ( len . ) $members }} {{ end }} {{ $tours = add 1 $tours }} {{ end }}
{{ partial "func/HeatMeterTile.html" (dict "color" "#009999" "value" $tours "max" $maxTours "precision" 0 "unit" "") }}
{{ partial "func/HeatMeterTile.html" (dict "color" "#0099cc" "value" $members "max" $maxMembers "precision" 0 "unit" "") }}
{{ partial "func/HeatMeterTile.html" (dict "color" "#3e7474" "value" $dist "max" $maxDist "precision" 0 "unit" "km") }}
{{ partial "func/HeatMeterTile.html" (dict "color" "#007f00" "value" $ascent "max" $maxAscent "precision" 0 "unit" "HM") }}
{{ end }}
{{ end }}