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 <noreply@anthropic.com>
This commit is contained in:
@@ -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,7 +34,11 @@ const d = homepage.data;
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero-visual">
|
||||
<div class="hero-visual" {...homepage.edit.hero_image}>
|
||||
{d.hero_image?.src && (
|
||||
<Image image={d.hero_image} />
|
||||
)}
|
||||
{!d.hero_image?.src && (
|
||||
<div class="code-window">
|
||||
<div class="code-header">
|
||||
<span class="dot red"></span>
|
||||
|
||||
Reference in New Issue
Block a user