From 9de8146884faf5d3681ddfa5d867d0ebacf1fc7a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 31 Jan 2026 17:33:31 -0400 Subject: content, css: generateContentEntry: artistless entries --- src/content/dependencies/generateContentEntry.js | 59 ++++++++++++------------ 1 file changed, 29 insertions(+), 30 deletions(-) (limited to 'src/content/dependencies/generateContentEntry.js') diff --git a/src/content/dependencies/generateContentEntry.js b/src/content/dependencies/generateContentEntry.js index 30d57f72..95c8f4b8 100644 --- a/src/content/dependencies/generateContentEntry.js +++ b/src/content/dependencies/generateContentEntry.js @@ -19,9 +19,7 @@ export default { : null), bodyContent: - (entry.body - ? relation('transformContent', entry.body) - : null), + relation('transformContent', entry.body), colorStyle: relation('generateColorStyleAttribute'), @@ -55,41 +53,42 @@ export default { language.encapsulate(titleCapsule, workingCapsule => { const workingOptions = {}; - workingOptions.artists = + const artists = html.tag('span', {class: 'content-entry-artists'}, + {[html.onlyIfContent]: true}, + (relations.artistsContent ? relations.artistsContent.slot('mode', 'inline') : relations.artistLinks ? language.formatConjunctionList(relations.artistLinks) - : language.$(titleCapsule, 'noArtists'))); + : html.blank())); + + if (!html.isBlank(artists)) { + workingCapsule += '.withArtists'; + workingOptions.artists = artists; + } - const accent = - html.tag('span', {class: 'content-entry-accent'}, + const annotation = + html.tag('span', {class: 'content-entry-annotation'}, {[html.onlyIfContent]: true}, - language.encapsulate(titleCapsule, 'accent', accentCapsule => - language.encapsulate(accentCapsule, workingCapsule => { - const workingOptions = {}; - - if (relations.annotationContent) { - workingCapsule += '.withAnnotation'; - workingOptions.annotation = - relations.annotationContent.slots({ - mode: 'inline', - absorbPunctuationFollowingExternalLinks: false, - }); - } - - if (workingCapsule === accentCapsule) { - return html.blank(); - } else { - return language.$(workingCapsule, workingOptions); - } - }))); - - if (!html.isBlank(accent)) { - workingCapsule += '.withAccent'; - workingOptions.accent = accent; + (relations.annotationContent + ? relations.annotationContent.slots({ + mode: 'inline', + absorbPunctuationFollowingExternalLinks: false, + }) + : html.blank())); + + if (!html.isBlank(annotation)) { + if (html.isBlank(artists)) { + workingCapsule += '.withAnnotation'; + workingOptions.annotation = annotation; + } else { + workingCapsule += '.withAccent'; + workingOptions.accent = + html.tag('span', {class: 'content-entry-accent'}, + language.$(titleCapsule, 'accent.withAnnotation', {annotation})); + } } return language.$(workingCapsule, workingOptions); -- cgit 1.3.0-6-gf8a5