---
import type { CollectionEntry } from "astro:content";
import { render } from "astro:content";
import { getImage } from "astro:assets";
import BaseLayout from "./Base.astro";
import BlogHero from "@/components/blog/Hero.astro";
interface Props {
post: CollectionEntry<"post">;
}
const { post } = Astro.props;
const {
data: { title, description, ogImage, publishDate, atUri },
} = post;
let socialImage: string;
if (!ogImage) {
socialImage = "/social-card.png";
} else if (typeof ogImage === "string") {
socialImage = ogImage;
} else {
const optimized = await getImage({
src: ogImage,
format: "png",
width: 1200,
});
socialImage = optimized.src;
}
const articleDate = publishDate.toISOString();
const { headings } = await render(post);
---
{
!!headings.length && (
)
}