--- import type { MarkdownHeading } from 'astro' import type { CollectionEntry } from 'astro:content' import { getConfig } from '@libs/config' import type { LayoutOverridesHTMLAttributes } from '@libs/layout' import { getSlug, processMarkdownToHtml } from '@libs/utils' import { getVersionedDocsPath } from '@libs/path' import Ads from '@components/Ads.astro' import BaseLayout from '@layouts/BaseLayout.astro' import DocsSidebar from '@components/DocsSidebar.astro' import TableOfContents from '@components/TableOfContents.astro' interface Props { frontmatter: CollectionEntry<'docs'>['data'] headings?: MarkdownHeading[] id: CollectionEntry<'docs'>['id'] } const { frontmatter, headings, id } = Astro.props // Extract the directory/section from the ID (format: "directory/filename.mdx") const parentDirectory = id.includes('/') ? id.split('/')[0] : '' const bodyProps: LayoutOverridesHTMLAttributes<'body'> = {} if (frontmatter.toc) { bodyProps['data-bs-spy'] = 'scroll' bodyProps['data-bs-target'] = '#TableOfContents' } ---
{ // This is needed because we want to show the badge if show_badge isn't present or is set to false frontmatter.added && ((frontmatter.added.show_badge !== undefined && frontmatter.added.show_badge === true) || frontmatter.added.show_badge === undefined) && ( Added in v{frontmatter.added.version} ) } View on GitHub

{frontmatter.title}

{frontmatter.description && }
{ frontmatter.toc && headings && ( On this page
) }
{ frontmatter.sections && (
{frontmatter.sections.map((section) => ( ))}
) }