{{ define "main" }}
  {{ with .Content }}
    <div class="index-content">
      {{ . }}
    </div>
  {{ end }}
  <div class="posts">
    <!--<style>
      .post:first-of-type {
	      margin: 0px auto 10px !important;
	      padding: 0px 0px 45px !important;
      }
    </style>-->
    {{ range .Paginator.Pages }}
      <article class="post on-list" style="padding-bottom: 45px;">
        <h1 class="post-title">
          <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
        </h1>
        <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 -}}
          <!-- comments counter -->
          {{ partial "comments_counter.html" . }}
        </div>

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

        {{ partial "cover.html" . }}

        <div class="post-content">
          {{ if .Description }}
            {{ .Description | markdownify }}
          {{ else }}
            {{ .Summary | safeHTML | strings.Truncate 300 "..." }}
          {{ end }}
          <p></p><a style="color: var(--accent); display: inline; text-decoration: none;" href="{{.RelPermalink}}">[ {{ $.Site.Params.ReadMore }} → ]</a>
        </div>
      </article>
    {{ end }}

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