{{ $key := .page.Title }} {{ $pages := where .page.Site.RegularPages "Type" "in" (slice "posts") }} {{ $count := len $pages }} {{ $param_title := .param_title }} {{ $totalWidth := 100.0 }} {{ $totalHeight := 50.0 }} {{/* {{ $width := div $totalWidth ( len ( $pages.GroupByDate "2006" ) ) }} */}} {{ $width := div $totalWidth ( len ( $pages.GroupByDate "2006" ) ) }} {{ $color := "#a8c7f0" }} {{ $strokecolor := "#d3e3f8" }} {{ $x := 0 }} {{ $year := 0 }} {{ range sort ( $pages.GroupByDate "2006" ) "Key" }} {{ $maxDist := 0.00 }} {{ $maxCount := 0 }} {{ $dist := 0.00 }} {{ $count := 0 }} {{ range .Pages }} {{ $maxCount = add 1 $maxCount }} {{ $year = dateFormat "2006" .Date }} {{ $isMember := false }} {{ range .Params.members }} {{ if eq . $key }} {{ $isMember = true }} {{ $count = add 1 $count }} {{ end }} {{ end }} {{ with .Params.distance_km }} {{ $maxDist = add . $maxDist }} {{ if $isMember }} {{ $dist = add . $dist }} {{ end }} {{ end }} {{ end }} {{ $height := 0 }} {{ $height = mul (float $totalHeight ) ( div (float $count ) ( float $maxCount ) ) }} {{/* $maxDist */}} {{/* $dist */}} {{/* $x */}} {{/* $height */}} {{ $x = add $x $width }} {{ end }}