{{ 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 }}
{{ if ne $previous_year "" }} < {{ $previous_year }} {{ end }}
{{ if ne $next_year "" }} {{ $next_year }} > {{ end }}
{{ $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 }}
{{ range .Pages }}
{{ partial "summary-with-thumbnail.html" . }}
{{ end }}
{{ end }}