diff --git a/src/components/ComicCard.astro b/src/components/ComicCard.astro index 03ba864..28a0ff0 100644 --- a/src/components/ComicCard.astro +++ b/src/components/ComicCard.astro @@ -1,4 +1,5 @@ --- +// Import the necessary types and assets import type { Comic } from '../lib/types'; import { Image } from 'astro:assets'; @@ -7,14 +8,29 @@ interface Props { } const { comic } = Astro.props; -const coverUrl = comic.md_comics.md_covers[0] + +// 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'; --- -