{{ $ := .root }} {{ $page := .page }} {{ $query := where $.Site.RegularPages "Type" "publication" }} {{ if and ($page.Params.publication_type) (ne $page.Params.publication_type "-1") }} {{ $query = where $query ".Params.publication_types" "intersect" (slice $page.Params.publication_type) }} {{ end }} {{ if $page.Params.exclude_featured }} {{ $query = $query | intersect (where (where $.Site.RegularPages "Type" "publication") ".Params.featured" "!=" true) }} {{ end }} {{ $count := len $query }}

{{ with $page.Title }}{{ . | markdownify }}{{ end }}

{{ with $page.Params.subtitle }}

{{ . | markdownify }}

{{ end }}
{{ with $page.Content }}

{{ . | markdownify }}

{{ end }} {{ range first $page.Params.count $query }} {{ if eq $page.Params.view 1 }} {{ partial "publication_li_list" . }} {{ else if eq $page.Params.view 3 }} {{ partial "publication_li_card" . }} {{ else if eq $page.Params.view 4 }} {{ partial "publication_li_citation" . }} {{ else }} {{ partial "publication_li_compact" . }} {{ end }} {{ end }} {{ if gt $count $page.Params.count }} {{ end }}