aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/partials/post.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/post.html')
-rw-r--r--layouts/partials/post.html34
1 files changed, 34 insertions, 0 deletions
diff --git a/layouts/partials/post.html b/layouts/partials/post.html
new file mode 100644
index 0000000..8ed64f8
--- /dev/null
+++ b/layouts/partials/post.html
@@ -0,0 +1,34 @@
+<article class="py-2 border-y border-slate-300">
+ {{ partial "meta_links.html" . }}
+ <a class="block hover:opacity-50 text-slate-900" href="{{ .RelPermalink }}">
+ {{ $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:max-w-64 md:float-left mr-4">
+ <img
+ {{ if ne .MediaType.SubType "svg" }}
+ {{ $image := .Fill (default "150x150" $.Params.thumbnail_size) }}
+ width="{{ $image.Width }}" height="{{ $image.Height }}"
+ src="{{ $image.RelPermalink }}" class="mx-auto"
+ {{ else }}
+ src="{{ $image.RelPermalink }}" class="mx-auto max-w-64"
+ {{ end }}
+ loading="lazy"
+ alt=""
+ />
+ </div>
+ {{ end }}
+ <h3 class="text-2xl baskerville my-1 pb-2 font-bold">{{ .Title }}</h3>
+
+ <p class="md:after:clear-both md:after:block">
+ {{ .Summary | replaceRE `<sup.*?><a href.*?#fn:.*?footnote-ref.*?/a></sup>` "" | plainify }}
+ </p>
+ </a>
+ {{ if .Params.metadata }}
+ {{ partial "metadata.html" . }}
+ {{ end }}
+</article>