{{ define "main" }}
<article class="prose max-w-full dark:prose-invert glass">
  {{ with .Title }}
    <header>
      <h1>{{ . | emojify }}</h1>
    </header>
  {{ end }}
  <section>{{ .Content | emojify }}</section>
  <section>
    {{ if .Data.Pages }}
      {{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }}
        {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
          <h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
            {{ .Key }}
          </h2>
          <hr class="w-36 border-dotted border-neutral-400" />
          {{ range .Pages }}
            {{ partial "article-link.html" . }}
          {{ end }}
        {{ end }}
      {{ else }}
        {{ range (.Paginate .Pages).Pages }}
          {{ partial "article-link.html" . }}
        {{ end }}
      {{ end }}
      {{ partial "pagination.html" . }}
    {{ else }}
      <section class="prose mt-10 dark:prose-invert">
        <p class="border-t py-8">
          <em>{{ i18n "list.no_articles" | emojify }}</em>
        </p>
      </section>
    {{ end }}
  </section>
</article>
{{ end }}