--- /** * Individual post page with PortableText rendering * * This demonstrates the embeds plugin auto-registering components * for YouTube, Vimeo, etc. with the PortableText renderer. */ import { getEmDashEntry, decodeSlug } from "emdash"; import { PortableText } from "emdash/ui"; import { embedComponents } from "@emdash-cms/plugin-embeds/astro"; const slug = decodeSlug(Astro.params.slug); const { entry: post } = slug ? await getEmDashEntry("posts", slug) : { entry: null }; if (!post) { return Astro.redirect("/404"); } const title = post.data.title; const content = post.data.content; const metaDescription = post.data.excerpt; --- {title || "Post"} - EmDash Plugins Demo {metaDescription && } ← Back to posts

{title || "Untitled"}

{post.data.status === "draft" && Draft}
{ Array.isArray(content) && content.length > 0 ? ( ) : typeof content === "string" && content ? (

{content}

) : (

No content yet.

) }