        {{ if .Params.list_by_publishdate }}
            {{ $pages = sort $pages ".Params.publishdate" "desc" }}
        {{ end }}

        {{ $parent := .Page }}
        {{ $parentDir := (path.Dir .Page.File.Dir) }}

        <ul>
            {{ range $pages }}
                {{ $pageLocation := (path.Dir (path.Dir .File.Dir)) }}
                {{ if and (eq $parentDir $pageLocation) (not .Params.draft) }}
                    {{- $info := "" -}}

                    <li><a title="{{ $info }}" href="{{ .Pe