{{ define "main" }}
  {{ with .Content }}
    <div class="index-content">
      {{ . }}
    </div>
  {{ end }}
  <div class="posts">
    {{ range .Paginator.Pages }}
      <article class="post on-list">
        <h2 class="post-title">
          <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
        </h2>
        <div class="post-meta">
          {{- if .Date -}}
            <time class="post-date">
              {{- .Date.Format "2006-01-02" -}}
            </time>
          {{- end -}}
          {{- with .Params.Author -}}
            <span class="post-author">{{- . -}}</span>
          {{- end -}}
        </div>

        {{ if .Params.tags }}
          <span class="post-tags">
            {{ range .Params.tags }}
            #<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
              {{- . -}}
            </a>&nbsp;
            {{ end }}
          </span>
        {{ end }}

        {{ partial "cover.html" . }}

        <div class="post-content">
          {{ if .Params.showFullContent }}
            {{ .Content }}
          {{ else if .Description }}
            <p>{{ .Description | markdownify }}</p>
          {{ else }}
            {{ .Summary }}
          {{ end }}
        </div>

        {{ if not .Params.showFullContent }}
           <div>
            <a class="read-more button inline" href="{{ .RelPermalink }}">{{ $.Site.Params.ReadMore }}</a>
          </div>
        {{ end }}
      </article>
    {{ end }}

    {{ partial "pagination.html" . }}
  </div>
{{ end }}
