<nav id="sidebar" aria-label="Section Navigation">
    <div class="directory">
        {{ $section := .Site.GetPage "section" .Section }}

        {{ $pages := (where .Site.Pages "Section" .Section).ByWeight }}
        {{ $current := . }}

        {{ range $count, $page := $pages }}
            {{ if eq .Parent $section }}

                {{ $id := printf "card%d" $count }}
                <div class="card">
                    <button class="header dynamic" id="{{ $id }}" title="{{ $page.Description }}" a