|
1 | 1 | {{ define "main" }} |
2 | 2 | <article class="space-y-4" aria-labelledby="post-title"> |
3 | 3 | {{- with .Params.cover.image -}} |
4 | | - {{- if not $.Params.cover.alt -}} |
5 | | - {{- errorf "cover.alt is required when cover.image is set for %q" $.File.Path -}} |
6 | | - {{- end -}} |
7 | | - {{- $imageAlt := $.Params.cover.alt -}} |
8 | | - {{- $coverTitle := $.Params.cover.title -}} |
9 | | - {{- $coverCaption := $.Params.cover.caption -}} |
10 | | - <figure class="relative overflow-hidden rounded-2xl border border-slate-200 shadow-sm dark:border-slate-800"> |
| 4 | + {{- if not $.Params.cover.alt -}} |
| 5 | + {{- errorf "cover.alt is required when cover.image is set for %q" $.File.Path -}} |
| 6 | + {{- end -}} |
| 7 | + {{- $imageAlt := $.Params.cover.alt -}} |
| 8 | + {{- $coverTitle := $.Params.cover.title -}} |
| 9 | + {{- $coverCaption := $.Params.cover.caption -}} |
| 10 | + <figure class="relative overflow-hidden rounded-2xl border border-slate-200 shadow-sm dark:border-slate-800"> |
11 | 11 | {{ partial "image.html" (dict |
12 | | - "page" $ |
13 | | - "src" . |
14 | | - "alt" $imageAlt |
15 | | - "class" "w-full object-cover" |
16 | | - "sizes" "(max-width: 768px) 100vw, 768px" |
17 | | - "loading" "eager" |
18 | | - "decoding" "async" |
19 | | - "fetchpriority" "high" |
20 | | - ) }} |
21 | | - |
22 | | - {{- with $coverCaption -}} |
23 | | - <figcaption |
24 | | - class="absolute inset-x-0 bottom-0 px-4 py-2 text-center text-xs text-slate-100 bg-black/50 backdrop-blur-sm"> |
25 | | - {{ . }} |
26 | | - </figcaption> |
27 | | - {{- end -}} |
28 | | - </figure> |
29 | | - {{- end -}} |
| 12 | + "page" $ |
| 13 | + "src" . |
| 14 | + "alt" $imageAlt |
| 15 | + "class" "w-full object-cover" |
| 16 | + "sizes" "(max-width: 768px) 100vw, 768px" |
| 17 | + "loading" "eager" |
| 18 | + "decoding" "async" |
| 19 | + "fetchpriority" "high") |
| 20 | + }} |
| 21 | + {{- with $coverCaption -}} |
| 22 | + <figcaption class="absolute inset-x-0 bottom-0 px-4 py-2 text-center text-xs text-slate-100 bg-black/50 backdrop-blur-sm"> |
| 23 | + {{ . }} |
| 24 | + </figcaption> |
| 25 | + {{- end -}} |
| 26 | + </figure>{{- end -}} |
30 | 27 |
|
31 | 28 | <header class="space-y-2"> |
32 | | - <h1 id="post-title" class="text-2xl font-semibold text-slate-900 dark:text-slate-100">{{ .Title }}</h1> |
| 29 | + <h1 class="text-2xl font-semibold text-slate-900 dark:text-slate-100">{{ .Title }}</h1> |
33 | 30 | {{- with .Date -}} |
34 | | - <div class="text-sm text-slate-500 dark:text-slate-400"> |
35 | | - Gepubliceerd op |
36 | | - <time datetime="{{ .Format " 2006-01-02 |
37 | | - " }}">{{ partial "date.html" (dict "date" . "format" ":date_long") }}</time> |
38 | | - {{- if and $.Lastmod (gt $.Lastmod $.Date) -}} |
39 | | - <span> · Bijgewerkt op</span> |
40 | | - <time datetime="{{ $.Lastmod.Format " 2006-01-02 |
41 | | - " }}">{{ partial "date.html" (dict "date" $.Lastmod "format" ":date_long") }}</time> |
42 | | - {{- end -}} |
43 | | - </div> |
| 31 | + <p class="text-sm text-slate-500 dark:text-slate-400"> |
| 32 | + Gepubliceerd op {{ partial "date.html" (dict "date" . "format" ":date_long") }}{{ if and $.Lastmod (gt (sub $.Lastmod.Unix $.Date.Unix) 86400) }} · bijgewerkt {{ partial "date.html" (dict "date" $.Lastmod "format" ":date_long") }}{{ end }} |
| 33 | + </p> |
44 | 34 | {{- end -}} |
45 | 35 | </header> |
46 | 36 |
|
|
0 commit comments