You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

127 lines
4.2 KiB

{{ define "main" }}
<article class="measure-wide center pa3 pa4-ns nested-copy-line-height nested-img">
<section class="cf pv3 pv4-l f4 tc-l measure-wide lh-copy mid-gray">
{{- .Content -}}
<p id="top">Etwas Statistik</p>
<p >Jahresweise sind folgende Werte summiert: Touren, Teilnehmer, Distanz und Höhenmeter.</p>
</section>
<div class=" w-100">
{{ $pages := where .Site.RegularPages "Type" "in" (slice "posts") }}
{{ $maxDist := 0.0 }}
{{ $maxDistYear := "" }}
{{ $maxAscent := 0.0 }}
{{ $maxAscentYear := "" }}
{{ $maxMembers := 0 }}
{{ $maxMembersYear := "" }}
{{ $maxTours := 0 }}
{{ $maxToursYear := "" }}
<!-- Groups content by month according to the "date" field in front matter -->
{{ 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 }}
<section class="mt1">
<div class="center flex flex-wrap bg-white">
<div class="flex ">
<div class="f3 pt3 blue b">
<a href="../posts/#{{ .Key }}" class="link black dim">
{{ .Key }}
</a>
</div>
</div>
<div class="flex flex-wrap">
<div class="pt1 pl1">
{{ partial "func/HeatMeterTile.html" (dict "color" "#009999" "value" $tours "max" $maxTours "precision" 0 "unit" "") }}
</div>
<div class="pt1 pl1">
{{ partial "func/HeatMeterTile.html" (dict "color" "#0099cc" "value" $members "max" $maxMembers "precision" 0 "unit" "") }}
</div>
<div class="pt1 pl1">
{{ partial "func/HeatMeterTile.html" (dict "color" "#3e7474" "value" $dist "max" $maxDist "precision" 0 "unit" "km") }}
</div>
<div class="pt1 pl1">
{{ partial "func/HeatMeterTile.html" (dict "color" "#007f00" "value" $ascent "max" $maxAscent "precision" 0 "unit" "HM") }}
</div>
</div>
</div>
</section>
{{ end }}
</div>
</article>
{{ end }}