{{ define "main" }}
{{- $pages := union .RegularPages .Sections }}

{{- if .IsHome }}
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{- end }}

{{- $paginator := .Paginate $pages }}
{{- range $paginator.Pages }}
<ul class="post-list">
    <li class="post-list-item">
        {{- if .Params.cover_url }}
        <div class="post-item-cover" style="background-image: url('.Params.cover_url')"></div>
        {{- end }}
        <div class="post-item-label">
            <a class="post