<div class="section-index">
    {{ $page := .Page -}}
    {{ $pages := (where .Site.Pages "Section" .Section).ByWeight -}}
    {{ $pages = (where $pages "Type" "!=" "search") }}
    {{ $pages = (where $pages ".Params.hide_summary" "!=" true) -}}
    {{ $pages = (where $pages ".Parent" "!=" nil) -}}
    {{ $pages = (where $pages ".Parent.File" "!=" nil) -}}
    {{ if $page.File -}}
        {{ $pages = (where $pages "Parent.File.UniqueID" "==" $page.File.UniqueID) -}}
    {{ end -}}
    {{ if or $page.Params.