highlight current guide item
This commit is contained in:
parent
13a997e272
commit
e1fb690039
1 changed files with 10 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
||||||
import { getURLForLanguage } from '$lib/utils';
|
import { getURLForLanguage } from '$lib/utils';
|
||||||
import { locale } from 'svelte-i18n';
|
import { locale } from 'svelte-i18n';
|
||||||
import DocsLoader from '$lib/components/docs/DocsLoader.svelte';
|
import DocsLoader from '$lib/components/docs/DocsLoader.svelte';
|
||||||
|
import { page } from '$app/stores';
|
||||||
|
|
||||||
let guides: Record<string, string[]> = {
|
let guides: Record<string, string[]> = {
|
||||||
'getting-started': [],
|
'getting-started': [],
|
||||||
|
@ -18,7 +19,10 @@
|
||||||
<Button
|
<Button
|
||||||
variant="link"
|
variant="link"
|
||||||
href={getURLForLanguage($locale, `/help/${guide}`)}
|
href={getURLForLanguage($locale, `/help/${guide}`)}
|
||||||
class="h-6 p-0 w-fit text-muted-foreground hover:text-foreground hover:no-underline font-normal hover:font-semibold items-start"
|
class="h-6 p-0 w-fit text-muted-foreground hover:text-foreground hover:no-underline font-normal hover:font-semibold items-start {$page
|
||||||
|
.params.guide === guide
|
||||||
|
? 'font-semibold text-foreground'
|
||||||
|
: ''}"
|
||||||
>
|
>
|
||||||
<DocsLoader path={`${guide}.svx`} titleOnly={true} />
|
<DocsLoader path={`${guide}.svx`} titleOnly={true} />
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -26,7 +30,11 @@
|
||||||
<Button
|
<Button
|
||||||
variant="link"
|
variant="link"
|
||||||
href={getURLForLanguage($locale, `/help/${guide}/${subGuide}`)}
|
href={getURLForLanguage($locale, `/help/${guide}/${subGuide}`)}
|
||||||
class="h-6 p-0 w-fit text-muted-foreground hover:text-foreground hover:no-underline font-normal hover:font-semibold items-start ml-3"
|
class="h-6 p-0 w-fit text-muted-foreground hover:text-foreground hover:no-underline font-normal hover:font-semibold items-start ml-3 {$page
|
||||||
|
.params.guide ===
|
||||||
|
guide + '/' + subGuide
|
||||||
|
? 'font-semibold text-foreground'
|
||||||
|
: ''}"
|
||||||
>
|
>
|
||||||
<DocsLoader path={`${guide}/${subGuide}.svx`} titleOnly={true} />
|
<DocsLoader path={`${guide}/${subGuide}.svx`} titleOnly={true} />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
Loading…
Reference in a new issue