{{ define "main" }} {{ $tag := .Name }} {{ $tile := . }} {{ $title := .Name }} {{ range where .Site.RegularPages "Type" "tiles" }} {{ if eq .Params.CorrespondingTagName $tag }} {{ $tile = . }} {{ $title = .Title }} {{ end }} {{ end }}

{{ $title | markdownify }}

{{ if $tile }} {{ partial "tag-cover.html" $tile }} {{ end }} {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} {{ $PageContext := . }} {{ if .IsHome }} {{ $PageContext = .Site }} {{ end }} {{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }} {{ range $paginator.Pages }}

{{ .Title | markdownify }}

{{ partial "cover.html" . }}
{{ if .Params.showFullContent }} {{ .Content }} {{ else if .Description }} {{ .Description | markdownify }} {{ else }} {{ .Summary | markdownify }} {{ end }}
{{ if not .Params.showFullContent }}
{{ $.Site.Params.ReadMore }} →
{{ end }}
{{ end }} {{ partial "pagination.html" . }}
{{ end }}