« 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/generateArtistInfoPageChunkItem.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateArtistInfoPageChunkItem.js')
-rw-r--r--src/content/dependencies/generateArtistInfoPageChunkItem.js34
1 files changed, 10 insertions, 24 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageChunkItem.js b/src/content/dependencies/generateArtistInfoPageChunkItem.js
index 8117ca9a..92af420b 100644
--- a/src/content/dependencies/generateArtistInfoPageChunkItem.js
+++ b/src/content/dependencies/generateArtistInfoPageChunkItem.js
@@ -1,5 +1,3 @@
-import {empty} from '#sugar';
-
 export default {
   relations: (relation) => ({
     textWithTooltip:
@@ -17,8 +15,9 @@ export default {
       mutable: false,
     },
 
-    otherArtistLinks: {
-      validate: v => v.strictArrayOf(v.isHTML),
+    citation: {
+      type: 'html',
+      mutable: false,
     },
 
     rereleaseTooltip: {
@@ -54,11 +53,7 @@ export default {
                   text: language.$(entryCapsule, 'rerelease.term'),
                   tooltip: slots.rereleaseTooltip,
                 });
-
-              return language.$(workingCapsule, workingOptions);
-            }
-
-            if (!html.isBlank(slots.firstReleaseTooltip)) {
+            } else if (!html.isBlank(slots.firstReleaseTooltip)) {
               workingCapsule += '.firstRelease';
               workingOptions.firstRelease =
                 relations.textWithTooltip.slots({
@@ -66,29 +61,20 @@ export default {
                   text: language.$(entryCapsule, 'firstRelease.term'),
                   tooltip: slots.firstReleaseTooltip,
                 });
-
-              return language.$(workingCapsule, workingOptions);
-            }
-
-            let anyAccent = false;
-
-            if (!empty(slots.otherArtistLinks)) {
-              anyAccent = true;
-              workingCapsule += '.withArtists';
-              workingOptions.artists =
-                language.formatConjunctionList(slots.otherArtistLinks);
             }
 
             if (!html.isBlank(slots.annotation)) {
-              anyAccent = true;
               workingCapsule += '.withAnnotation';
               workingOptions.annotation = slots.annotation;
+            } else if (!html.isBlank(slots.citation)) {
+              workingCapsule += '.withCitation';
+              workingOptions.citation = slots.citation;
             }
 
-            if (anyAccent) {
-              return language.$(workingCapsule, workingOptions);
-            } else {
+            if (workingCapsule === entryCapsule) {
               return slots.content;
+            } else {
+              return language.$(workingCapsule, workingOptions);
             }
           }),