From 1342d0328c29182b4113cc52084668100ae79151 Mon Sep 17 00:00:00 2001 From: Johan Ronsse Date: Tue, 16 Nov 2021 11:34:45 +0100 Subject: [PATCH] Fixes #408 and also #178 - but afraid it will cause the same issue as #178 in deploy, needs more testing --- core/templates/mixins/render-page-tree.pug | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/templates/mixins/render-page-tree.pug b/core/templates/mixins/render-page-tree.pug index 030a5ba4..0164e36b 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