{{ $ := .root }} {{ $page := .page }} {{ $query := where (where $.Site.RegularPages "Type" "post") ".Params.notonhomepage" nil }} {{ $archive_page := $.Site.GetPage "section" "post" }} {{/* Check if a filter should be applied. */}} {{ if $page.Params.filter_tag }} {{ $archive_page = $.Site.GetPage (printf "tags/%s" $page.Params.filter_tag) }} {{ $query = $query | intersect $archive_page.Pages }} {{ else if $page.Params.filter_category }} {{ $archive_page = $.Site.GetPage (printf "categories/%s" $page.Params.filter_category) }} {{ $query = $query | intersect $archive_page.Pages }} {{ end }} {{ $count := len $query }}
{{ . | markdownify }}
{{ end }}{{ . | markdownify }}
{{ end }} {{ range $post := first $page.Params.count $query }} {{ if eq $page.Params.view 1 }} {{ partial "post_li_list" . }} {{ else if eq $page.Params.view 3 }} {{ partial "post_li_card" . }} {{ else }} {{ partial "post_li_compact" . }} {{ end }} {{end}} {{ if gt $count $page.Params.count }} {{ end }}