« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/generateArtistInfoPage.js22
1 files changed, 22 insertions, 0 deletions
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 && [