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 { getEmDashEntry } from "emdash";
|
||||||
import { Image } from "emdash/ui";
|
|
||||||
import Base from "../layouts/Base.astro";
|
import Base from "../layouts/Base.astro";
|
||||||
|
|
||||||
const { entry: homepage } = await getEmDashEntry("homepage", "main");
|
const { entry: homepage } = await getEmDashEntry("homepage", "main");
|
||||||
Astro.cache.set(homepage.cacheHint);
|
Astro.cache.set(homepage.cacheHint);
|
||||||
const d = homepage.data;
|
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">
|
<main class="landing">
|
||||||
<!-- Hero Section -->
|
<!-- Hero Section -->
|
||||||
<section class="hero">
|
<section class="hero">
|
||||||
@@ -34,11 +35,7 @@ const d = homepage.data;
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="hero-visual" {...homepage.edit.hero_image}>
|
<div class="hero-visual">
|
||||||
{d.hero_image?.src && (
|
|
||||||
<Image image={d.hero_image} />
|
|
||||||
)}
|
|
||||||
{!d.hero_image?.src && (
|
|
||||||
<div class="code-window">
|
<div class="code-window">
|
||||||
<div class="code-header">
|
<div class="code-header">
|
||||||
<span class="dot red"></span>
|
<span class="dot red"></span>
|
||||||
|
|||||||
Reference in New Issue
Block a user