{{ define "main" }}

{{.Title}}

{{.Content}}
{{ $has_categories := gt (len (first 1 (where .Pages ".Params.category" "ne" nil))) 0 }} {{ $has_without_categories := gt (len (first 1 (where .Pages ".Params.category" "eq" nil))) 0 }} {{ if $has_categories }} {{ range .Pages.GroupByParam "Category" }}
{{ if .Key }}

{{ .Key }}

{{ end }} {{ range .Pages }} {{ end }}
{{ end }} {{ end }} {{ if and $has_categories $has_without_categories }}

Others:

{{ end }} {{ range where .Pages ".Params.category" "==" nil }}
{{.Date.Format "2006-01-02"}} | {{.Title}}
{{ end }} {{ end }}