{{ define "main" }}
<div class="container" role="main">
    <div class="posts-list">
      {{ if .IsHome }}
        {{ $pag := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }}
      {{ else }}
        {{ $pag := .Paginator.Pages }}
      {{ end }}

      {{ range .Paginator.Pages }}
        {{ partial "preview.html" . }}
      {{ end }}
      </div>
    {{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
    <ul class="pager">
      {{ if .Paginator.HasPrev }}
        <li class=