From e7a026a9b5ccce1ccf11c37c4dcd7fbce89b05cf Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 7 Jun 2024 16:01:01 -0300 Subject: content: many onlyIfContent, onlyIfSiblings, onlyIfOptions uses --- .../dependencies/generateAlbumSidebarGroupBox.js | 27 +++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src/content/dependencies/generateAlbumSidebarGroupBox.js') diff --git a/src/content/dependencies/generateAlbumSidebarGroupBox.js b/src/content/dependencies/generateAlbumSidebarGroupBox.js index 00a96c31..cc9b2c13 100644 --- a/src/content/dependencies/generateAlbumSidebarGroupBox.js +++ b/src/content/dependencies/generateAlbumSidebarGroupBox.js @@ -1,5 +1,5 @@ import {sortChronologically} from '#sort'; -import {atOffset, empty} from '#sugar'; +import {atOffset} from '#sugar'; export default { contentDependencies: [ @@ -89,26 +89,31 @@ export default { relations.description ?.slot('mode', 'multiline'), - !empty(relations.externalLinks) && - html.tag('p', - language.$('releaseInfo.visitOn', { - links: - language.formatDisjunctionList( - relations.externalLinks - .map(link => link.slot('context', 'group'))), - })), + html.tag('p', + {[html.onlyIfContent]: true}, + + language.$('releaseInfo.visitOn', { + [language.onlyIfOptions]: ['links'], + + links: + language.formatDisjunctionList( + relations.externalLinks + .map(link => link.slot('context', 'group'))), + })), slots.mode === 'album' && - relations.nextAlbumLink && html.tag('p', {class: 'group-chronology-link'}, + {[html.onlyIfContent]: true}, language.$('albumSidebar.groupBox.next', { + [language.onlyIfOptions]: ['album'], album: relations.nextAlbumLink, })), slots.mode === 'album' && - relations.previousAlbumLink && html.tag('p', {class: 'group-chronology-link'}, + {[html.onlyIfContent]: true}, language.$('albumSidebar.groupBox.previous', { + [language.onlyIfOptions]: ['album'], album: relations.previousAlbumLink, })), ], -- cgit 1.3.0-6-gf8a5