From 5fd6da3e598a0bd6c480964234629c944c791a60 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 19 Oct 2024 22:03:08 -0300 Subject: content: generateSecondaryNavParentSiblingsPart: better dynamics --- .../dependencies/generateSecondaryNavParentSiblingsPart.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/content/dependencies/generateSecondaryNavParentSiblingsPart.js b/src/content/dependencies/generateSecondaryNavParentSiblingsPart.js index c5f1df84..82b5d151 100644 --- a/src/content/dependencies/generateSecondaryNavParentSiblingsPart.js +++ b/src/content/dependencies/generateSecondaryNavParentSiblingsPart.js @@ -63,6 +63,8 @@ export default { generate: (relations, slots, {html, language}) => html.tag('span', + {[html.onlyIfContent]: true}, + slots.attributes, !html.isBlank(slots.colorStyle) && @@ -70,11 +72,15 @@ export default { .slot('context', 'primary-only'), language.encapsulate(slots.stringsKey, workingCapsule => { - const workingOptions = {}; + const workingOptions = { + [language.onlyIfOptions]: [slots.mainLinkOption], + }; workingOptions[slots.mainLinkOption] = - slots.mainLink - .slot('color', false); + (html.isBlank(slots.mainLink) + ? null + : slots.mainLink + .slot('color', false)); if (slots.mode === 'album') addPreviousNext: { if (html.isBlank(slots.previousLink) && html.isBlank(slots.nextLink)) { -- cgit 1.3.0-6-gf8a5