{{/* Eine Journal-Karte. Kontext (.) = die Library-Seite. */}}
{{ $section := "" }}
{{ with .Parent }}{{ $section = path.Base .RelPermalink }}{{ end }}
{{ $author := .Params.author | default site.Params.author.name }}
{{ $cover := .Params.cover_image }}
{{ $layout := .Params.layout }}
{{ if not $layout }}{{ $layout = cond (ne $cover nil) "image" "text" }}{{ end }}
<li class="journal-entry journal-entry--layout-{{ $layout }}"
    data-section="{{ $section }}"
    {{ with .Params.color }}data-color="{{ . }}"{{ end }}>
  <a class="journal-entry-link" href="{{ .RelPermalink }}">
    {{ if and $cover (eq $layout "image") }}
      <img class="journal-bg-image" src="{{ $cover | relURL }}" alt="" loading="eager" />
    {{ end }}
    <div class="journal-entry-body">
      {{ if and $cover (eq $layout "icon") }}
        <img class="journal-icon-image" src="{{ $cover | relURL }}" alt="" loading="lazy" />
      {{ end }}
      {{ with .Parent }}
        <p class="journal-rubric"><span class="journal-section">{{ .Title }}</span></p>
      {{ end }}
      <h3 class="journal-title">{{ .LinkTitle }}</h3>
      {{ with .Params.summary }}
        <p class="journal-summary">{{ . }}</p>
      {{ end }}
      <p class="journal-byline">
        {{- with $author -}}<span class="journal-author">{{ . }}</span>{{- end -}}
        {{- if and $author .Date -}}, {{ end -}}
        <time class="journal-date" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02.01.2006" }}</time>
      </p>
    </div>
  </a>
</li>
