--- import { getMenu, getEmDashCollection } from "emdash"; import { WidgetArea, EmDashHead, EmDashBodyStart, EmDashBodyEnd, } from "emdash/ui"; import { createPublicPageContext } from "emdash/page"; import LiveSearch from "emdash/ui/search"; import "../styles/theme.css"; interface Props { title: string; description?: string | null; image?: string | null; canonical?: string | null; robots?: string | null; type?: "website" | "article"; publishedTime?: string | null; modifiedTime?: string | null; author?: string | null; /** Pass content reference for plugin page contributions on content pages */ content?: { collection: string; id: string; slug?: string | null }; } const { title, description, image, canonical, robots, type = "website", publishedTime, modifiedTime, author, content, } = Astro.props; const siteTitle = "My Blog"; // If title already includes site title (from getSeoMeta), use as-is const fullTitle = title.includes(siteTitle) ? title : `${title} — ${siteTitle}`; // Fetch primary menu defined in seed const menu = await getMenu("primary"); // Fetch pages for footer const { entries: pages } = await getEmDashCollection("pages"); // Build public page context for plugin contributions // SEO data is passed here and rendered securely by EmDashHead const pageCtx = createPublicPageContext({ Astro, kind: content ? "content" : "custom", pageType: type, title: fullTitle, description, canonical, image, content, seo: { ogImage: image, robots }, articleMeta: { publishedTime, modifiedTime, author }, siteName: siteTitle, }); // Check if user is logged in (for showing admin link) const isLoggedIn = !!Astro.locals.user; ---