From de409aecc04718cdf2874d9876bc16ffdb645bfa Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 26 Jul 2023 10:10:39 -0300 Subject: content: generatePageLayout: support manual current: true --- src/content/dependencies/generatePageLayout.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src') 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'; } -- cgit 1.3.0-6-gf8a5