From d26289b526610f19cbb6c763b28d0c45c9648a85 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 4 Jun 2023 13:29:05 -0300 Subject: content: generateArtistInfoPage: artist avatar --- src/content/dependencies/generateArtistInfoPage.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/content') diff --git a/src/content/dependencies/generateArtistInfoPage.js b/src/content/dependencies/generateArtistInfoPage.js index 8d5077b9..71f1001d 100644 --- a/src/content/dependencies/generateArtistInfoPage.js +++ b/src/content/dependencies/generateArtistInfoPage.js @@ -11,6 +11,7 @@ export default { contentDependencies: [ 'generateArtistNavLinks', 'generateContentHeading', + 'generateCoverArtwork', 'generatePageLayout', 'linkAlbum', 'linkArtist', @@ -122,6 +123,11 @@ export default { return groupInfo; } + if (artist.hasAvatar) { + relations.cover = + relation('generateCoverArtwork', []); + } + if (artist.contextNotes) { const contextNotes = sections.contextNotes = {}; contextNotes.content = relation('transformContent', artist.contextNotes); @@ -360,6 +366,11 @@ export default { const data = {}; data.name = artist.name; + data.directory = artist.directory; + + if (artist.hasAvatar) { + data.avatarFileExtension = artist.avatarFileExtension; + } const allTracks = unique([...artist.tracksAsArtist, ...artist.tracksAsContributor]); data.totalTrackCount = allTracks.length; @@ -430,6 +441,17 @@ export default { title: data.name, headingMode: 'sticky', + cover: + (relations.cover + ? relations.cover.slots({ + path: [ + 'media.artistAvatar', + data.directory, + data.avatarFileExtension, + ], + }) + : null), + mainClasses: ['long-content'], mainContent: [ sec.contextNotes && [ -- cgit 1.3.0-6-gf8a5