diff --git a/src/components/AspectRatio.astro b/src/components/AspectRatio.astro new file mode 100644 index 0000000..e69de29 diff --git a/src/components/LazyImage.astro b/src/components/LazyImage.astro new file mode 100644 index 0000000..8ec026b --- /dev/null +++ b/src/components/LazyImage.astro @@ -0,0 +1,131 @@ +--- +interface Props { + src: string; + alt?: string; + width?: number; + height?: number; + class?: string; +} + +const { + src, + alt = "", + width, + height, + class: className = "" +} = Astro.props; +--- + +
+
+ + {alt} +
+ + + + + + diff --git a/src/components/PostList.astro b/src/components/PostList.astro index f171f87..1d2375e 100644 --- a/src/components/PostList.astro +++ b/src/components/PostList.astro @@ -4,6 +4,7 @@ import Folder from "@/assets/icon/folder.png?url"; import Calendar from "@/assets/icon/calendar.png?url"; import type {Post} from "@/types/post"; import {formatDatetime} from "@/lib/format.ts"; +import LazyImage from "@/components/LazyImage.astro"; interface Props { posts: Post[] @@ -23,7 +24,7 @@ posts.map((post) => {
- {post.title} +