diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-01-31 17:33:31 -0400 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-01-31 17:33:31 -0400 |
| commit | 9de8146884faf5d3681ddfa5d867d0ebacf1fc7a (patch) | |
| tree | f10ebbea5f2dd1e7a7d0f2bb85326728df7d2c2f /src/content/dependencies | |
| parent | 014c18c9a8238c996708cf9d6e61ac246bfda996 (diff) | |
content, css: generateContentEntry: artistless entries
Diffstat (limited to 'src/content/dependencies')
| -rw-r--r-- | src/content/dependencies/generateContentEntry.js | 59 |
1 files changed, 29 insertions, 30 deletions
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); |