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

Don't fail if path ends with "/"

parent 6fad2ff5
......@@ -24,7 +24,10 @@
const bp = breakpoint()
function pageMatchesPath(page, path) {
return page.slug === "" ? path === "/" : path.includes(page.slug)
if (path.endsWith("/")) {
path = path.slice(0, -1)
}
return page.slug === "" ? path === "/" : path === `/${page.slug}`
}
$: config = $session.config
......
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