Skip to content

Commit e977891

Browse files
committed
✨ Content
1 parent 8e71a84 commit e977891

11 files changed

Lines changed: 20 additions & 20 deletions

File tree

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎src/lib/docs/docs.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { Component } from 'svelte'
2+
13
const MODULES = import.meta.glob('/src/docs/**/*.md')
24

35
export const DEFAULT_LANGUAGE = 'en'
@@ -7,5 +9,7 @@ export function getDocModule(lang = 'en', path: string) {
79
const normalizedLang = SUPPORTED_LANGAUGES.includes(lang) ? lang : DEFAULT_LANGUAGE
810
const key = `/src/docs/${path}/${normalizedLang}.md`
911

10-
return MODULES[key] ?? MODULES[`/src/docs/${path}/${DEFAULT_LANGUAGE}.md`]
12+
const mod = MODULES[key] ?? MODULES[`/src/docs/${path}/${DEFAULT_LANGUAGE}.md`]
13+
14+
return mod as () => Promise<{ default: Component; metadata: Record<string, any> }>
1115
}
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
<script lang="ts">
2-
interface Props {
3-
data: {
4-
lang: string
5-
path: string
6-
}
7-
}
8-
const { data }: Props = $props()
2+
const { data } = $props()
93
</script>
104

11-
<div>Hello, world!</div>
12-
<p>{data.lang}</p>
13-
<p>{data.path}</p>
14-
<p>{JSON.stringify(data)}</p>
5+
{@render data.component?.()}

0 commit comments

Comments
 (0)