diff options
author | Oscar Najera <hi@oscarnajera.com> | 2025-01-07 01:54:28 +0100 |
---|---|---|
committer | Oscar Najera <hi@oscarnajera.com> | 2025-01-07 01:54:28 +0100 |
commit | c4b5e3e29612c84dc270967c3181d2dddb0a82c6 (patch) | |
tree | 230822549180ecdd0aaa5db526f88ed4c758a7a5 /layouts/partials | |
parent | b5ab9dd2e3d417477427103e6ea268cc11d61fd1 (diff) | |
download | hugo-minimalist-theme-c4b5e3e29612c84dc270967c3181d2dddb0a82c6.tar.gz hugo-minimalist-theme-c4b5e3e29612c84dc270967c3181d2dddb0a82c6.tar.bz2 hugo-minimalist-theme-c4b5e3e29612c84dc270967c3181d2dddb0a82c6.zip |
Tailwind terms and use float learning bugfix clearfix
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/post.html | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/layouts/partials/post.html b/layouts/partials/post.html index 2e99a7a..8ed64f8 100644 --- a/layouts/partials/post.html +++ b/layouts/partials/post.html @@ -1,35 +1,32 @@ -<article class="py-2 border-y border-gray-200"> +<article class="py-2 border-y border-slate-300"> {{ 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 }}" class="mx-auto" - {{ else }} - src="{{ $image.RelPermalink }}" class="mx-auto max-w-64" - {{ 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> + {{ $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> - </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" . }} |