--- import BaseLayout from "@components/base/BaseLayout.astro"; import BlogCard from "@components/blog/Card.astro"; import Share from "@components/common/Share.astro"; import { plainify } from "@lib/textConverter"; import type { BlogEntry } from "@/types"; import TableOfContents from "@components/common/TableOfContents.astro"; import { render } from "astro:content"; import EntryHeader from "@components/common/EntryHeader.astro"; interface Props { entry: BlogEntry; relatedEntries: BlogEntry[]; } const { entry, relatedEntries }: Props = Astro.props; const { title, description, autodescription, image, hideToc } = entry.data; const { Content, headings } = await render(entry); const descriptionLenth = 200; // the max length in characters for the auto-generated description const globalHideToc = false; // set true to always hide the table of contents (right side menu) const tocDepth = 3; // maximum depth for the table of contents 1 = h1, etc const actuallyHideToc = hideToc || globalHideToc || headings.filter((heading) => heading.depth <= tocDepth).length === 0; const entryDescription = description || (autodescription ? plainify(entry.body!.slice(0, descriptionLenth)) : null); ---

{ relatedEntries.length > 0 && (

Related Posts

{relatedEntries.slice(0, 2).map((entry) => (
))}
) }