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.
 
 
 

71 lines
2.3 KiB

{{ define "main" }}
{{ $pages := .Pages }}
{{ $year := .Title}}
{{ $all_pages := where .Site.RegularPages "Type" "in" (slice "posts") }}
{{ $all_pages = sort $all_pages "Date" }}
{{ $previous_year := "" }}
{{ $next_year := "" }}
{{ range $all_pages }}
{{ if lt (dateFormat "2006" .Params.Date) $year }}
{{ $previous_year = dateFormat "2006" .Params.Date }}
{{ end }}
{{ end }}
{{ range ( sort $all_pages "Date" "desc" ) }}
{{ if gt (dateFormat "2006" .Params.Date) $year }}
{{ $next_year = dateFormat "2006" .Params.Date }}
{{ end }}
{{ end }}
{{ partial "navigation-bar.html" ( dict "context" . "items" (slice "years" ) )}}
{{ $next := printf "../%s" $next_year }}
{{ $previous := printf "../%s" $previous_year }}
<article class="cf pa3 pa4-m pa4-l">
<div class="mw8 center flex justify-between">
<div>
{{ if ne $previous_year "" }}
<a href="{{ $previous }}" class="{{ .Site.Params.background_color_class | default "bg-black" }} tc link f5 grow no-underline dib hover-white white-80 pl3 pr3 pt2 pb2">
< {{ $previous_year }}
</a>
{{ end }}
</div>
<div>
{{ if ne $next_year "" }}
<a href="{{ $next }}" class="{{ .Site.Params.background_color_class | default "bg-black" }} tc link f5 grow no-underline dib hover-white white-80 pl3 pr3 pt2 pb2">
{{ $next_year }} >
</a>
{{ end }}
</div>
</div>
{{ $total_distance := 0 }}
{{ $total_ascent := 0 }}
{{ $total_nr_of_tours := 0 }}
{{ range .Pages }}
{{ $act_ascent:= int .Params.ascent_m }}
{{ $total_ascent = add $act_ascent $total_ascent }}
{{ $act_distance:= int .Params.distance_km }}
{{ $total_distance = add $act_distance $total_distance }}
{{ $total_nr_of_tours = add 1 $total_nr_of_tours }}
{{ end }}
<div class="measure-wide-l center f4 lh-copy nested-copy-line-height nested-links nested-img mid-gray">
<p>Touren des Jahres {{ .Title }}!</p>
{{ partial "statistic-summary.html" ( dict "total_nr" $total_nr_of_tours "distance" $total_distance "ascent" $total_ascent ) }}
</div>
</article>
<div class="mw8 center">
<section class="flex-ns flex-wrap justify-around mt5">
{{ range .Pages }}
<div class="relative w-100 mb4 bg-white">
{{ partial "summary-with-thumbnail.html" . }}
</div>
{{ end }}
</section>
</div>
{{ end }}