Fix 'Images sometimes not loading in HighlightedPosts'

This commit is contained in:
prototypa
2023-01-10 09:12:27 -05:00
parent efdf41879b
commit a8704cf6d5

View File

@ -16,13 +16,15 @@ const image = await findImage(post.image);
---
<article class="mb-6 transition">
<div class="relative h-0 pb-[56.25%] lg:h-64 overflow-hidden bg-gray-400 dark:bg-slate-700 rounded shadow-lg mb-6">
<div class="relative md:h-64 bg-gray-400 dark:bg-slate-700 rounded shadow-lg mb-6">
{
image && (
<Picture
src={image}
class="object-cover w-full lg:h-64 rounded shadow-lg bg-gray-400 dark:bg-slate-700"
class="md:object-cover w-full md:w-auto md:h-full rounded shadow-lg bg-gray-400 dark:bg-slate-700"
widths={[400, 900]}
width="400"
height="224"
sizes="(max-width: 900px) 400px, 900px"
alt={post.title}
aspectRatio="16:9"