preload all guide titles

This commit is contained in:
vcoppe
2024-09-23 15:21:01 +02:00
parent c02d96e90f
commit bcc29480c7
7 changed files with 48 additions and 37 deletions

View File

@@ -6,7 +6,7 @@
import { guides } from '$lib/components/docs/docs';
export let data: {
guideModules: Record<string, any>;
guideTitles: Record<string, string>;
};
</script>
@@ -21,9 +21,7 @@
? 'font-semibold text-foreground'
: ''}"
>
{#await data.guideModules[guide] then guideModule}
{guideModule.metadata.title}
{/await}
{data.guideTitles[guide]}
</Button>
{#each guides[guide] as subGuide}
<Button
@@ -35,9 +33,7 @@
? 'font-semibold text-foreground'
: ''}"
>
{#await data.guideModules[`${guide}/${subGuide}`] then guideModule}
{guideModule.metadata.title}
{/await}
{data.guideTitles[`${guide}/${subGuide}`]}
</Button>
{/each}
{/each}