diff --git a/core/templates/mixins/render-page-tree.pug b/core/templates/mixins/render-page-tree.pug index 030a5ba..0164e36 100644 --- a/core/templates/mixins/render-page-tree.pug +++ b/core/templates/mixins/render-page-tree.pug @@ -1,10 +1,11 @@ mixin renderPage(entry) + - var entryPath = entry.path.replace('.pug', ''); + - var isActive = false + if pathname === entryPath || (entryPath && pathname.includes(entryPath)) + - basePage = entry + if pathname === entryPath || (entryPath && pathname === entryPath) + - isActive = true if !entry.path.includes('--') - - var entryPath = entry.path.replace('.pug', ''); - - var isActive = false; - if pathname === entryPath || (entryPath && pathname.includes(entryPath)) || (pathname === '' && entryPath === 'index') - - basePage = entry; - - isActive = true; li.br-tree-dir a(href=entry.href, class=isActive ? 'br-bordered-list__link--active' : null) = entry.name