mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
chore: website tooling (#41)
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
---
|
||||
import {
|
||||
type SupportedFramework,
|
||||
type AnySupportedStyle,
|
||||
type Guide,
|
||||
type Section,
|
||||
isSection,
|
||||
} from '@/types/docs';
|
||||
|
||||
type Props = {
|
||||
item: Guide | Section;
|
||||
framework: SupportedFramework;
|
||||
style: AnySupportedStyle;
|
||||
docTitles: Map<string, string>;
|
||||
};
|
||||
|
||||
const { item, framework, style, docTitles } = Astro.props;
|
||||
---
|
||||
|
||||
{
|
||||
isSection(item) ? (
|
||||
<details open>
|
||||
<summary>{item.sidebarLabel}</summary>
|
||||
{item.contents.map((contentItem) => (
|
||||
<Astro.self
|
||||
item={contentItem}
|
||||
framework={framework}
|
||||
style={style}
|
||||
docTitles={docTitles}
|
||||
/>
|
||||
))}
|
||||
</details>
|
||||
) : (
|
||||
<div class="sidebar-guide">
|
||||
<a href={`/docs/framework/${framework}/style/${style}/${item.slug}/`}>
|
||||
{item.sidebarLabel || docTitles.get(item.slug) || item.slug}
|
||||
</a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user