diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-11-15 10:57:55 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-11-15 10:57:55 -0400 |
commit | dd5cbf9db64e994d44c922bca2ca8ec37e9f7983 (patch) | |
tree | 56ef644f10f1814c8d58ea04a259e7e6fe02f8bf /src/content/dependencies/generateFlashIndexPage.js | |
parent | f2a31006efa7c4d9c7c15823adc70cc40c46dedd (diff) | |
parent | 52cc83065f41472a4c32c2003b0a715a66d4739a (diff) |
Merge branch 'preview' into commentary-entries
Diffstat (limited to 'src/content/dependencies/generateFlashIndexPage.js')
-rw-r--r-- | src/content/dependencies/generateFlashIndexPage.js | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/content/dependencies/generateFlashIndexPage.js b/src/content/dependencies/generateFlashIndexPage.js index ad1dab94..5fc62ab3 100644 --- a/src/content/dependencies/generateFlashIndexPage.js +++ b/src/content/dependencies/generateFlashIndexPage.js @@ -1,4 +1,4 @@ -import {stitchArrays} from '#sugar'; +import {empty, stitchArrays} from '#sugar'; export default { contentDependencies: [ @@ -95,23 +95,25 @@ export default { mainClasses: ['flash-index'], mainContent: [ - html.tag('p', - {class: 'quick-info'}, - language.$('misc.jumpTo')), - - html.tag('ul', - {class: 'quick-info'}, - stitchArrays({ - colorVariables: relations.jumpLinkColorVariables, - anchor: data.jumpLinkAnchors, - color: data.jumpLinkColors, - label: data.jumpLinkLabels, - }).map(({colorVariables, anchor, color, label}) => - html.tag('li', - html.tag('a', { - href: '#' + anchor, - style: colorVariables.slot('color', color).content, - }, label)))), + !empty(data.jumpLinkLabels) && [ + html.tag('p', + {class: 'quick-info'}, + language.$('misc.jumpTo')), + + html.tag('ul', + {class: 'quick-info'}, + stitchArrays({ + colorVariables: relations.jumpLinkColorVariables, + anchor: data.jumpLinkAnchors, + color: data.jumpLinkColors, + label: data.jumpLinkLabels, + }).map(({colorVariables, anchor, color, label}) => + html.tag('li', + html.tag('a', { + href: '#' + anchor, + style: colorVariables.slot('color', color).content, + }, label)))), + ], stitchArrays({ colorVariables: relations.actColorVariables, |