--- import { getMenu, getEmDashCollection, getSiteSettings } from "emdash"; import { WidgetArea, EmDashHead, EmDashBodyStart, EmDashBodyEnd, } from "emdash/ui"; import { createPublicPageContext } from "emdash/page"; import LiveSearch from "emdash/ui/search"; import { Font } from "astro:assets"; import { resolveBlogSiteIdentity } from "../utils/site-identity"; import "../styles/theme.css"; interface Props { title: string; pageTitle?: string | null; 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, pageTitle, description, image, canonical, robots, type = "website", publishedTime, modifiedTime, author, content, } = Astro.props; const { siteTitle, siteTagline, siteLogo } = resolveBlogSiteIdentity(await getSiteSettings()); // 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"); // Optional "social" menu. If a site defines a `social` menu in its seed, // it'll render in the footer's "Connect" column. Otherwise that column // just shows RSS, avoiding duplication with the "Navigate" column above. const socialMenu = await getMenu("social"); // 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, pageTitle: pageTitle ?? title, 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; ---