Skip to content

Commit

Permalink
Fix 'Images sometimes not loading in HighlightedPosts'
Browse files Browse the repository at this point in the history
  • Loading branch information
prototypa committed Jan 10, 2023
1 parent efdf418 commit a8704cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/blog/GridItem.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a8704cf

Please sign in to comment.