fix: use Image component for post list featured images

Changed from plain <img> to <Image> component so locally
uploaded images display correctly on the posts list page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kunthawat Greethong
2026-05-02 10:46:55 +07:00
parent 49725b2fd0
commit de5735bc8e

View File

@@ -1,6 +1,7 @@
--- ---
import { getEmDashCollection, getTermsForEntries } from "emdash"; import { getEmDashCollection, getTermsForEntries } from "emdash";
import Base from "../../layouts/Base.astro"; import Base from "../../layouts/Base.astro";
import { Image } from "emdash/ui";
import { getReadingTime } from "../../utils/reading-time"; import { getReadingTime } from "../../utils/reading-time";
// Sort in the database rather than in JS — lets the DB use its index on // Sort in the database rather than in JS — lets the DB use its index on
@@ -54,7 +55,7 @@ const formatDate = (date: Date) =>
<a href={`/posts/${post.id}`} class="post-link"> <a href={`/posts/${post.id}`} class="post-link">
{post.data.featured_image && ( {post.data.featured_image && (
<div class="post-image"> <div class="post-image">
<img src={post.data.featured_image.src} alt={post.data.featured_image.alt} /> <Image image={post.data.featured_image} />
</div> </div>
)} )}
<div class="post-meta"> <div class="post-meta">