{{- $version := .version -}}
{{- $pageUrl := .pageUrl -}}

{{- $scratch := newScratch -}}

{{ range .section }}

{{ if eq (index (split .File.Path "/") 1 ) $version }}
{{ $scratch.Add "sectionsForVersion" (slice .)}}
{{ end }}

{{ end }}

{{ if ne ($scratch.Get "sectionsForVersion") nil }}
{{ if gt (len ($scratch.Get "sectionsForVersion")) 0 }}

<hr class="docs-nav-hr" />

<span class="docs-nav-title">
    {{ .sectionTitle }}
</span>

{{ range ($scratch.Get "sectionsForVersion") }}
{{ partial "docs/sidenav-link.html" (dict "ctx" . "pageUrl" $pageUrl "version" $version) }}
{{ end }}

{{ end }}
{{ end }}