{{ define "main" }}
  <section class="home-intro">
    {{ .Content }}
  </section>

  {{ with where site.RegularPages "Section" "aktuelles" }}
    <section class="home-news">
      <h2>Aktuelles</h2>
      <div class="post-grid">
        {{ range first 3 . }}
          {{ partial "post-card.html" . }}
        {{ end }}
      </div>
      <p class="more-link"><a href="{{ "/aktuelles/" | relURL }}">Alle Beiträge →</a></p>
    </section>
  {{ end }}

  {{ with hugo.Data.members }}
    <section class="home-members">
      <h2>Unsere Mitglieder</h2>
      <ul class="member-grid">
        {{ range . }}
          <li class="member">
            {{ with resources.Get .image }}
              {{ $p := .Fill "240x240 Center webp q80" }}
              <img src="{{ $p.RelPermalink }}" width="{{ $p.Width }}" height="{{ $p.Height }}"
                   alt="{{ $.Title }}" loading="lazy" decoding="async">
            {{ end }}
            <span class="member-name">{{ .name }}</span>
          </li>
        {{ end }}
      </ul>
    </section>
  {{ end }}

  {{ with hugo.Data.memoriam }}
    <section class="home-memoriam">
      <h2>In Erinnerung</h2>
      <ul class="memoriam-list">
        {{ range . }}
          <li class="memoriam">
            {{ with resources.Get .image }}
              {{ $p := .Fill "200x200 Center webp q80" }}
              <img src="{{ $p.RelPermalink }}" width="{{ $p.Width }}" height="{{ $p.Height }}"
                   alt="" loading="lazy" decoding="async">
            {{ end }}
            <span class="memoriam-name">{{ .name }}</span>
            <span class="memoriam-date">✝ {{ .died }}</span>
          </li>
        {{ end }}
      </ul>
    </section>
  {{ end }}
{{ end }}
