From 788546b9de7ac5972d749a22c8851f90057ef5e3 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 1 May 2024 07:04:48 -0300 Subject: content: generateGroupSecondaryNav: fix handling no prev/next --- src/content/dependencies/generateGroupSecondaryNav.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/content/dependencies/generateGroupSecondaryNav.js b/src/content/dependencies/generateGroupSecondaryNav.js index 17eb508..a4f8131 100644 --- a/src/content/dependencies/generateGroupSecondaryNav.js +++ b/src/content/dependencies/generateGroupSecondaryNav.js @@ -69,12 +69,16 @@ export default { }), generate(data, relations, {html, language}) { - const {content: previousNextPart} = - relations.previousNextLinks.slots({ - previousLink: relations.previousGroupLink, - nextLink: relations.nextGroupLink, - id: true, - }); + const previousNextPart = + (relations.previousNextLinks + ? relations.previousNextLinks + .slots({ + previousLink: relations.previousGroupLink, + nextLink: relations.nextGroupLink, + id: true, + }) + .content /* TODO: Kludge. */ + : null); const {categoryLink} = relations; @@ -83,7 +87,7 @@ export default { return relations.secondaryNav.slots({ class: 'nav-links-groups', content: - (relations.previousGroupLink || relations.nextGroupLink + (previousNextPart ? html.tag('span', {class: 'nav-link'}, relations.colorStyle.slot('context', 'primary-only'), -- cgit 1.3.0-6-gf8a5