{{ define "hero" }} {{ partial "hero.html" . }} {{ end }} {{ define "main" }} {{ range $index, $element := (where .Pages "Type" "in" .Site.Params.mainSections).ByWeight }}