{{ $context := .context }} {{ $from := int .from }} {{ $fromMonth := int .fromMonth }} {{ $to := int .to }} {{ $toMonth := int .toMonth }} {{ $pages := .pages }} {{ $context.Scratch.Set "currentYear" $from }} {{ $context.Scratch.Add "consideredYears" (slice $from) }} {{ $context.Scratch.Set "pages" $pages }} {{ range $i, $sequence := (seq ((sub $to $from))) }} {{ $currentYear := $context.Scratch.Get "currentYear" }} {{ $nextYear := (add $from $sequence) }} {{ if le $nextYear $to }} {{ $context.Scratch.Add "consideredYears" (slice $nextYear) }} {{ $context.Scratch.Set "currentYear" $nextYear }} {{ end }} {{ end }}
{{ range ($context.Scratch.Get "consideredYears") }} {{ partialCached "calendar/year" (dict "context" $context "year" . "from" $from "fromMonth" $fromMonth "to" $to "toMonth" $toMonth) (string (delimit (slice $from $fromMonth $to $toMonth .) "")) }} {{ end }}