From 9816f00277292f499e47b9df7bbc89a385bcb133 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 17 Jan 2026 19:18:26 -0400 Subject: content, css: generateMusicVideoDateLine --- .../dependencies/generateMusicVideoArtistsLine.js | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/content/dependencies/generateMusicVideoArtistsLine.js (limited to 'src/content/dependencies/generateMusicVideoArtistsLine.js') diff --git a/src/content/dependencies/generateMusicVideoArtistsLine.js b/src/content/dependencies/generateMusicVideoArtistsLine.js new file mode 100644 index 00000000..959d3648 --- /dev/null +++ b/src/content/dependencies/generateMusicVideoArtistsLine.js @@ -0,0 +1,41 @@ +export default { + relations: (relation, musicVideo) => ({ + artistCredit: + relation('generateArtistCredit', musicVideo.artistContribs, []), + }), + + data: (musicVideo) => ({ + label: + (musicVideo.label !== 'Music video' + ? musicVideo.label + : null), + }), + + generate(data, relations, {html, language}) { + const {artistCredit} = relations; + const capsule = language.encapsulate('misc.musicVideo'); + + let artistsLineCapsule = language.encapsulate(capsule, 'artistsLine'); + let artistsLineOptions = {[language.onlyIfOptions]: ['credit']}; + + if (data.label) { + artistsLineCapsule += '.customLabel'; + artistsLineOptions.label = data.label; + } + + artistsLineOptions.credit = + html.tag('span', {class: 'by'}, + {[html.onlyIfContent]: true}, + + artistCredit.slots({ + normalStringKey: language.encapsulate(capsule, 'artistsLine.credit'), + + showAnnotation: true, + showChronology: true, + + chronologyKind: 'musicVideo', + })); + + return language.$(artistsLineCapsule, artistsLineOptions); + }, +} -- cgit 1.3.0-6-gf8a5