{{- $page := .page }}
{{- $header_level := .header_level }}
{{- if gt $page.Pages.Len 0 }}
<ol>
{{ range $page.Pages }}
    <li>
        <h{{ $header_level }}><a href='{{ .RelPermalink }}'>{{ .Title }}</a></h{{ $header_level }}>
        {{- $header_level := add $header_level 1 }}
        {{ partial "pagesTOC.html" (dict "page" . "header_level" $header_level) }}
    </li>
{{ end }}
</ol>
{{ end -}}
