mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-31 15:43:25 +00:00
using markdown for docs
This commit is contained in:
19
website/src/lib/components/docs/DocsLoader.svelte
Normal file
19
website/src/lib/components/docs/DocsLoader.svelte
Normal 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}
|
Reference in New Issue
Block a user