fix: enable live editing on homepage with {...homepage.edit.field} attributes
Adds content binding on Base component for homepage live editing navigation. Uses homepage.id (entry ULID) not homepage.data.id (not in homepage schema). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
---
|
||||
import { getEmDashEntry } from "emdash";
|
||||
import { Image } from "emdash/ui";
|
||||
import Base from "../layouts/Base.astro";
|
||||
|
||||
const { entry: homepage } = await getEmDashEntry("homepage", "main");
|
||||
Astro.cache.set(homepage.cacheHint);
|
||||
const d = homepage.data;
|
||||
---
|
||||
<Base title="EmDash CMS - Self-Hosted for Astro" description="Fully self-hosted CMS for Astro. No cloud required, fully local, with admin panel, authentication, and plugin system.">
|
||||
<Base title="EmDash CMS - Self-Hosted for Astro" description="Fully self-hosted CMS for Astro. No cloud required, fully local, with admin panel, authentication, and plugin system."
|
||||
content={{ collection: "homepage", id: homepage.id, slug: "main" }}
|
||||
>
|
||||
<main class="landing">
|
||||
<!-- Hero Section -->
|
||||
<section class="hero">
|
||||
@@ -34,12 +35,8 @@ const d = homepage.data;
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<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="hero-visual">
|
||||
<div class="code-window">
|
||||
<div class="code-header">
|
||||
<span class="dot red"></span>
|
||||
<span class="dot yellow"></span>
|
||||
|
||||
Reference in New Issue
Block a user