test for docs root
MODIFY
src/components/docs/menu-section.svelte
src/components/docs/menu-section.svelte
export let menuItem;
- $: sectionPath = $docsCurrentSectionStore
- ? `${$docsCurrentSectionStore}\/`
- : "";
- $: regex = new RegExp(`\/docs\/${sectionPath}$`);
- $: isActiveSection = regex.test(menuItem.path);
+ $: isActiveSection = $docsCurrentSectionStore
+ ? menuItem.path.endsWith(`${$docsCurrentSectionStore}/`)
+ : /\/docs\/$/.test(menuItem.path);
</script>
<style>

MODIFY
src/components/main-nav/index.svelte
src/components/main-nav/index.svelte
label: "Blog",
},
{
- href: "/docs",
+ href: "/docs/",
label: "Docs",
},
{

test for docs root