Commit f870cf31 authored by Christophe Benz's avatar Christophe Benz
Browse files

Fix selected page from path

parent 7c7013bf
......@@ -23,10 +23,15 @@
const bp = breakpoint()
function pageMatchesPath(page, path) {
return page.slug === "" ? path === "/" : path.includes(page.slug)
}
$: config = $session.config
$: path = $page.path
$: currentPageConfig = config.pages.find(page => path.includes(page.slug))
$: currentPageConfig = config.pages.find(page => pageMatchesPath(page, path))
$: navMenu = config.pages.map(page => ({
id: `/${page.slug}`,
to: page.slug || ".",
text: page.appBarTitle
}))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment