From 07725f902390b4baa54bd67a218558ac388f6cde Mon Sep 17 00:00:00 2001 From: Kunthawat Greethong Date: Thu, 30 Apr 2026 11:45:22 +0700 Subject: [PATCH] fix: add hero_image live editing with Image component from emdash/ui Use Image component instead of img tag. Add hero_image to hero-visual container with {...homepage.edit.hero_image} for live editing. Co-Authored-By: Claude Opus 4.6 --- src/pages/index.astro | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index 579b4d9..1d4574f 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,5 +1,6 @@ --- import { getEmDashEntry } from "emdash"; +import { Image } from "emdash/ui"; import Base from "../layouts/Base.astro"; const { entry: homepage } = await getEmDashEntry("homepage", "main"); @@ -33,8 +34,12 @@ const d = homepage.data; -
-
+
+ {d.hero_image?.src && ( + + )} + {!d.hero_image?.src && ( +