diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-04-14 20:26:02 -0300 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-04-14 20:26:02 -0300 |
| commit | 2336e252d25536d3678119ff070189e666b98927 (patch) | |
| tree | 788b9c689b8c7ac4324af092c73e95f20b5abd6f /src/content/dependencies/generateArtistInfoPageMusicVideosChunk.js | |
| parent | ed38f9529084cdd3ff6cdfb56148fd9a99c259b2 (diff) | |
content, data: generateArtistInfoPageMusicVideosChunkedList
Diffstat (limited to 'src/content/dependencies/generateArtistInfoPageMusicVideosChunk.js')
| -rw-r--r-- | src/content/dependencies/generateArtistInfoPageMusicVideosChunk.js | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageMusicVideosChunk.js b/src/content/dependencies/generateArtistInfoPageMusicVideosChunk.js new file mode 100644 index 00000000..6912d4d6 --- /dev/null +++ b/src/content/dependencies/generateArtistInfoPageMusicVideosChunk.js @@ -0,0 +1,58 @@ +export default { + relations: (relation, artist, album, contribs) => ({ + template: + relation('generateArtistInfoPageChunk'), + + albumLink: + relation('linkAlbum', album), + + albumArtistCredit: + relation('generateArtistCredit', album.artistContribs, []), + + items: + contribs.map(contribs => + relation('generateArtistInfoPageMusicVideosChunkItem', + artist, + contribs)), + }), + + data: (_artist, album, contribs) => ({ + albumDate: + album.date, + + contribDates: + contribs + .flat() + .map(contrib => contrib.date), + }), + + generate: (data, relations, {html, language}) => + relations.template.slots({ + mode: 'album', + + link: + language.encapsulate('artistPage.creditList.album', workingCapsule => { + const creditCapsule = workingCapsule + '.credit'; + const workingOptions = {album: relations.albumLink}; + + relations.albumArtistCredit.setSlots({ + normalStringKey: creditCapsule + '.by', + }); + + if (!html.isBlank(relations.albumArtistCredit)) { + workingCapsule += '.withCredit'; + workingOptions.credit = + html.tag('span', {class: 'by'}, + relations.albumArtistCredit); + } + + return language.$(workingCapsule, workingOptions); + }), + + date: data.albumDate, + dates: data.contribDates, + + list: + html.tag('ul', relations.items), + }), +}; |