diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-11-17 06:53:34 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-11-17 06:53:34 -0400 |
commit | a34b8d027866fbe858a4d2ff3543bc84c9d5983a (patch) | |
tree | 39ffd1c8736a5c0483f17e4480f87f05faf67eb1 /src/content/dependencies | |
parent | fbcfb88ea407ab76d278c28f1f0711502ab2fbf9 (diff) |
data, yaml, content: support multiple artists per commentary entry
Diffstat (limited to 'src/content/dependencies')
-rw-r--r-- | src/content/dependencies/generateCommentaryEntry.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/content/dependencies/generateCommentaryEntry.js b/src/content/dependencies/generateCommentaryEntry.js index b265ed41..0b2b2558 100644 --- a/src/content/dependencies/generateCommentaryEntry.js +++ b/src/content/dependencies/generateCommentaryEntry.js @@ -1,3 +1,5 @@ +import {empty} from '#sugar'; + export default { contentDependencies: [ 'generateColorStyleVariables', @@ -8,9 +10,10 @@ export default { extraDependencies: ['html', 'language'], relations: (relation, entry) => ({ - artistLink: - (entry.artist && !entry.artistDisplayText - ? relation('linkArtist', entry.artist) + artistLinks: + (!empty(entry.artists) && !entry.artistDisplayText + ? entry.artists + .map(artist => relation('linkArtist', artist)) : null), artistsContent: @@ -45,8 +48,8 @@ export default { html.tag('span', {class: 'commentary-entry-artists'}, (relations.artistsContent ? relations.artistsContent.slot('mode', 'inline') - : relations.artistLink - ? relations.artistLink + : relations.artistLinks + ? language.formatConjunctionList(relations.artistLinks) : language.$('misc.artistCommentary.entry.title.noArtists'))); const accentParts = ['misc.artistCommentary.entry.title.accent']; |