diff --git a/src/components/ComicCard.astro b/src/components/ComicCard.astro index e504109..543bb63 100644 --- a/src/components/ComicCard.astro +++ b/src/components/ComicCard.astro @@ -9,28 +9,47 @@ interface Props { const { comic } = Astro.props; -// Determine if the file is AVIF based on the URL -const isAvif = comic.md_comics.md_covers[0]?.b2key.endsWith('.avif'); - const coverUrl = comic.md_comics.md_covers[0] ? `https://meo.comick.pictures/${comic.md_comics.md_covers[0].b2key}` : '/placeholder.png'; + +// Determine if the file is AVIF based on the URL +const isAvif = comic.md_comics.md_covers[0]?.b2key.endsWith('.avif'); + +// Define standard image dimensions +const IMG_WIDTH = 250; +const IMG_HEIGHT = 350; + +// Generate optimized image URL with dimensions +const optimizedCoverUrl = coverUrl.includes('meo.comick.pictures') + ? `${coverUrl}?width=${IMG_WIDTH}&quality=80` + : coverUrl; --- +