{{ define "main" -}} {{ if (eq .Params.type "collection") }}

{{ if isset .Params "greeting" }} {{ .Params.greeting }} {{ else }} Hello! {{ end }}

{{ .Content }}
{{- range.Sections.ByWeight }}
{{- end }}
{{ else if (eq .Params.type "list") }}

{{ .Title }}

{{ .Content }}
{{ $fields := .Params.fields }} {{ $entries := .Pages }} {{ range .Params.states }} {{ $state := . }} {{ $stateEntries := where $entries ".Params.state" $state }} {{- partial "table.html" (dict "state" $state "entries" $stateEntries "fields" $fields) -}} {{ end }}
{{- end }} {{- end }} {{ define "js" -}} {{ if (eq .Params.type "list") }} {{- end }} {{- end }}