thp-lang.org/src/components/TOCHeading.astro

20 lines
493 B
Plaintext
Raw Normal View History

2024-04-23 15:16:51 +00:00
---
// github.com/rezahedi/rezahedi.dev/blob/main/src/components/TOCHeading.astro
const { heading } = Astro.props;
---
<li>
2024-04-23 21:25:10 +00:00
<a class="inline-block py-1 hover:underline" href={"#" + heading.slug}>
2024-04-23 15:16:51 +00:00
{heading.text}
</a>
{
heading.subheadings.length > 0 && (
<ul class="px-2">
{heading.subheadings.map((subheading: any) => (
<Astro.self heading={subheading} />
))}
</ul>
)
}
</li>