Merge pull request #147 from IshtarStar/patch-1

Wrap blog grid item image in a tag
This commit is contained in:
prototypa
2023-03-18 02:23:29 -04:00
committed by GitHub

View File

@ -19,18 +19,20 @@ const image = await findImage(post.image);
<div class="relative md:h-64 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 && ( image && (
<Picture <a href={getPermalink(post.permalink, 'post')}>
src={image} <Picture
class="md:object-cover w-full md:w-auto md:h-full rounded shadow-lg bg-gray-400 dark:bg-slate-700" src={image}
widths={[400, 900]} class="md:object-cover w-full md:w-auto md:h-full rounded shadow-lg bg-gray-400 dark:bg-slate-700"
width={400} widths={[400, 900]}
height={224} width={400}
sizes="(max-width: 900px) 400px, 900px" height={224}
alt={post.title} sizes="(max-width: 900px) 400px, 900px"
aspectRatio="16:9" alt={post.title}
loading="lazy" aspectRatio="16:9"
decoding="async" loading="lazy"
/> decoding="async"
/>
</a>
) )
} }
</div> </div>