{{ define "content"  }}
<article>
  <header>
    <h1>{{ .Name }}</h1>
  </header>

  <main>
    {{ .Content }}

    {{ if ne .Params.hideIndex true }}
      <h1>{{ default "Index" .Params.indexTitle }}</h1>

      <ul>
        {{ $pagesOfSection := (where .Site.Pages.ByWeight "Section" .Section) }}
        {{ $childPages := (where (where $pagesOfSection "Parent" "!=" nil) "Parent.File.Path" .File.Path) }}
        {{ range $childPages }}
          {{ if not (strings.HasSuffix .Permalink "/documentation/latest/") }}
          <li>
            <a href="{{ .Permalink }}">{{ .Name }}</a>
          </li>
          {{ end }}
        {{ end }}
      </ul>
    {{ end }}
  </main>
</article>
{{ end }}

