
| Current Path : /var/www/html/sirius-pallets/vendor/twbs/bootstrap/site/src/components/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/sirius-pallets/vendor/twbs/bootstrap/site/src/components/TableOfContents.astro |
---
import type { MarkdownHeading } from 'astro'
import { generateToc, type TocEntry } from '@libs/toc'
interface Props {
headings?: MarkdownHeading[]
entries?: TocEntry[]
}
const { entries, headings } = Astro.props
const toc = entries ? entries : generateToc(headings ?? [])
---
<ul>
{
toc.map(({ children, slug, text }) => {
return (
<li>
<a href={`#${slug}`}>{text}</a>
{children.length > 0 && <Astro.self entries={children} />}
</li>
)
})
}
</ul>