{{ define "main" }}

{{ partial "primary_top.html" . }}

{{ .Content }}

<div class="faq-landing">
    {{ range .Data.Pages.ByWeight }}
        <div>
            <div class="panel">
                <div class="header">
                    {{ .LinkTitle }}
                </div>

                <nav class="body">
                    <ul aria-label="{{ .LinkTitle }}">
                        {{ $questions := .Resources.ByType "page" }}
                        {{ $sorted_questions := sort $questions ".Params.weight" }}
                        {{ $url := .Permalink }}
                        {{ range $q := $sorted_questions }}
                            <li role="none"><a href="{{ $url }}#{{ $q.File.BaseFileName | urlize }}">{{ $q.Title }}</a></li>
                        {{ end }}
                    </ul>
                </nav>
            </div>
        </div>
    {{ end }}
</div>

{{ partial "primary_bottom.html" . }}

{{ end }}
