{{ $pages := where .context.Site.RegularPages "Type" "in" (slice "posts") }} {{ $count := len $pages }} {{ $param_name := .param_name }} {{ $totalWidth := 200.0 }} {{ $totalHeight := 150.0 }} {{ $width := div $totalWidth ( len ( $pages.GroupByDate "2006" ) ) }} {{ $maxCount := 0 }} {{ $totalCount := 0 }} {{ $actualCount := 0 }} {{ $maxDistance_km := 0 }} {{ $totalDistance_km := 0 }} {{ $actualDistance_km := 0 }} {{ $maxAscent_m := 0 }} {{ $totalAscent_m := 0 }} {{ $actualAscent_m := 0 }} {{ $maxMembers := 0 }} {{ $totalMembers := 0 }} {{ $actualMembers := 0 }} {{ range sort ( $pages.GroupByDate "2006" ) "Key" }} {{ $count := 0 }} {{ $distance_km := 0 }} {{ $ascent_m := 0 }} {{ $members := 0 }} {{ range .Pages }} {{ $count = add 1 $count }} {{ with .Params.distance_km }} {{ $distance_km = add . $distance_km }} {{ end }} {{ with .Params.ascent_m }} {{ $ascent_m = add . $ascent_m }} {{ end }} {{ with .Params.members }} {{ $members = add ( len . ) $members }} {{ end }} {{ end }} {{ if gt $distance_km $maxDistance_km }} {{ $maxDistance_km = $distance_km }} {{ end }} {{ if gt $ascent_m $maxAscent_m }} {{ $maxAscent_m = $ascent_m }} {{ end }} {{ if gt $count $maxCount }} {{ $maxCount = $count }} {{ end }} {{ if gt $members $maxMembers }} {{ $maxMembers = $members }} {{ end }} {{ $totalCount = add $count $totalCount }} {{ $totalMembers = add $members $totalMembers }} {{ $totalDistance_km = add $distance_km $totalDistance_km }} {{ $totalAscent_m = add $ascent_m $totalAscent_m }} {{ $actualCount = $count }} {{ $actualMembers = $members }} {{ $actualDistance_km = $distance_km }} {{ $actualAscent_m = $ascent_m }} {{ end }} {{ $value := "" }} {{ $actualHeight := 0 }} {{ if eq $param_name "distance_km"}} {{ $value = partial "func/NumberFormatter.html" ( dict "number" $totalDistance_km "precision" 0 ) }} {{ $actualHeight = mul $actualDistance_km ( div $totalHeight $maxDistance_km ) }} {{ end }} {{ if eq $param_name "ascent_m"}} {{ $value = partial "func/NumberFormatter.html" ( dict "number" $totalAscent_m "precision" 0 ) }} {{ $actualHeight = mul $actualAscent_m ( div $totalHeight $maxAscent_m ) }} {{ end }} {{ if eq $param_name "count"}} {{ $value = $totalCount }} {{ $actualHeight = mul $actualCount ( div $totalHeight $maxCount ) }} {{ end }} {{ if eq $param_name "members"}} {{ $value = $totalMembers }} {{ $actualHeight = mul $actualMembers ( div $totalHeight $maxMembers ) }} {{ end }} {{ $color := "#a8c7f0" }} {{ $fontcolor := "#123a6d" }} {{ $fontstroke := "#e9f1fb" }} {{ $actualColor := "#123a6d" }} {{ $x := 0 }} {{ range sort ( $pages.GroupByDate "2006" ) "Key" }} {{ $count := 0 }} {{ $distance_km := 0 }} {{ range .Pages }} {{ with .Params.distance_km }} {{ $distance_km = add . $distance_km }} {{ end }} {{ $count = add 1 $count }} {{ end }} {{ $height := 0 }} {{ $height = mul (float $totalHeight ) ( div (float $count ) ( float $maxCount ) ) }} {{ $x = add $x $width }} {{ end }} {{ $value }}