diff options
-rw-r--r-- | src/content/dependencies/generatePageLayout.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js index b764595a..fe2bef99 100644 --- a/src/content/dependencies/generatePageLayout.js +++ b/src/content/dependencies/generatePageLayout.js @@ -160,8 +160,14 @@ export default { path: () => true, title: () => true, accent: () => true, + + current: () => true, }), object); + if (object.current !== undefined) { + aggregate.call(v.isBoolean, object.current); + } + if (object.auto || object.html) { if (object.auto && object.html) { aggregate.push(new TypeError(`Don't specify both auto and html`)); @@ -309,11 +315,11 @@ export default { let className; - if (cur.auto === 'current') { - className = 'current'; - } else if ( - slots.navLinkStyle === 'hierarchical' && - i === slots.navLinks.length - 1 + if ( + cur.current || + cur.auto === 'current' || + (slots.navLinkStyle === 'hierarchical' && + i === slots.navLinks.length - 1) ) { className = 'current'; } |