using markdown for docs

This commit is contained in:
vcoppe
2024-07-02 10:07:54 +02:00
parent 8e446ec74a
commit 89382a497c
18 changed files with 366 additions and 5 deletions

View File

@@ -0,0 +1,19 @@
<script lang="ts">
import { _, locale } from 'svelte-i18n';
export let path: string;
let module = undefined;
const modules = import.meta.glob('/src/lib/docs/**/*.{md,svx}');
$: if ($locale) {
modules[`/src/lib/docs/${$locale}/${path}`]().then((mod) => {
module = mod.default;
});
}
</script>
{#if module !== undefined}
<svelte:component this={module} />
{/if}