{{ define "main" }} {{ .Scratch.Set "skipSeeAlso" true }} {{ partial "primary_top.html" . }} {{ if not .Params.skip_list }}

{{ .Description }}

{{ end }} {{ if .Params.list_below }} {{ .Content }} {{ end }} {{ if not .Params.skip_list }}
{{ $pages := (where .Site.Pages "Section" .Section) }} {{ if .Params.list_by_publishdate }} {{ $pages = sort $pages ".Params.publishdate" "desc" }} {{ end }} {{ $parent := .Page }} {{ $parentDir := (path.Dir .Page.File.Dir) }} {{ if $parent.Params.simple_list }} {{ else }} {{- $decoration := .Params.decoration -}} {{ range $pages }} {{ $pageLocation := (path.Dir (path.Dir .File.Dir)) }} {{ if eq $parentDir $pageLocation }}
{{- if .Params.icon -}}{{- partial "icon.html" .Params.icon -}}{{- end -}}{{- .Title -}} {{- if $decoration -}} {{- end -}}

{{ .Description }}

{{ end }} {{ end }} {{ end }}
{{ end }} {{ if not .Params.list_below }} {{ .Content }} {{ end }} {{ partial "primary_bottom.html" . }} {{ end }}