aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/partials/post.html
blob: 8afa03e3491b82e8351e427eec5ab4df4b9be83d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<article class="py-2 border-y border-gray-200">
  {{ partial "meta_links.html" . }}
  <a class="block hover:opacity-50 text-slate-900" href="{{ .RelPermalink }}">
    <div class="md:flex">
      {{ $image := "" }}
      {{ if (.Resources.ByType "image").GetMatch "featured*" }}
        {{ $image =  (.Resources.ByType "image").GetMatch "*featured*" }}
      {{ else if resources.Get (index .Params.images 0) }}
        {{ $image =  resources.Get (index .Params.images 0) }}
      {{ end }}
      {{ with $image }}
        <div class="md:shrink-0">
          <img
            {{ if ne .MediaType.SubType "svg" }}
              {{ $image := .Fill (default "150x150" $.Params.thumbnail_size) }}
              width="{{ $image.Width }}" height="{{ $image.Height }}"
              src="{{ $image.RelPermalink }}"
            {{ else }}
              src="{{ $image.RelPermalink }}"
            {{ end }}
            loading="lazy"
            alt=""
          />
        </div>
      {{ end }}
      <div class="px-4">
        <h3 class="text-2xl baskerville my-1 pb-2 font-bold">{{ .Title }}</h3>
        <div class="">
          {{ .Summary | replaceRE `<sup.*?><a href.*?#fn:.*?footnote-ref.*?/a></sup>` "" | plainify }}
        </div>
      </div>
    </div>
  </a>
  {{ if .Params.metadata }}
    {{ partial "metadata.html" . }}
  {{ end }}
</article>