{{ define "main" }}
  <div role="main" class="container">
    <div class="row">
      {{ with .Content }}
        <article class="post-preview">
          {{.}}
        </article>
      {{ end }}

      <div class="posts-list">
        {{ $pag := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }}
        {{ range $pag.Pages }}
          {{ partial "post_preview" . }}
        {{ end }}
      </div>

      {{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
        <ul class="pager main-pager">
          {{ if .Paginator.HasPrev }}
            <li class="previous">
              <a href="{{ .Permalink }}page/{{ .Paginator.Prev.PageNumber }}/">&larr; {{ i18n "newerPosts" }}</a>
            </li>
          {{ end }}
          {{ if .Paginator.HasNext }}
            <li class="next">
              <a href="{{ .Permalink }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} &rarr;</a>
            </li>
          {{ end }}
        </ul>
      {{ end }}
    </div>
  </div>
{{ end }}
