« get me outta code hell

content: generate{Artist,Group}InfoPage: close group/artist links - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateGroupInfoPage.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-11-16 12:08:47 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-11-17 13:39:59 -0400
commit0337711ed78c05418ba793b71fde082d96b1cb5b (patch)
treee88e4eb6100b29660b4ded1b6aac01557d65aa59 /src/content/dependencies/generateGroupInfoPage.js
parenta618ec62bb07a0037e9431b2d7fda0ea55c29881 (diff)
content: generate{Artist,Group}InfoPage: close group/artist links
Diffstat (limited to 'src/content/dependencies/generateGroupInfoPage.js')
-rw-r--r--src/content/dependencies/generateGroupInfoPage.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/content/dependencies/generateGroupInfoPage.js b/src/content/dependencies/generateGroupInfoPage.js
index 87f35656..31f43208 100644
--- a/src/content/dependencies/generateGroupInfoPage.js
+++ b/src/content/dependencies/generateGroupInfoPage.js
@@ -5,6 +5,7 @@ export default {
     'generateGroupSecondaryNav',
     'generateGroupSidebar',
     'generatePageLayout',
+    'linkArtist',
     'linkExternal',
     'transformContent',
   ],
@@ -33,6 +34,10 @@ export default {
         ? relation('generateGroupSidebar', group)
         : null),
 
+    closeArtistLinks:
+      group.closelyLinkedArtists
+        .map(artist => relation('linkArtist', artist)),
+
     visitLinks:
       group.urls
         .map(url => relation('linkExternal', url)),
@@ -63,6 +68,21 @@ export default {
           html.tag('p',
             {[html.onlyIfContent]: true},
 
+            language.encapsulate(pageCapsule, 'closelyLinkedArtists', capsule =>
+              (relations.closeArtistLinks.length === 0
+                ? html.blank()
+             : relations.closeArtistLinks.length === 1
+                ? language.$(capsule, 'one', {
+                    artist: relations.closeArtistLinks,
+                  })
+                : language.$(capsule, 'multiple', {
+                    artists:
+                      language.formatUnitList(relations.closeArtistLinks),
+                  })))),
+
+          html.tag('p',
+            {[html.onlyIfContent]: true},
+
             language.$('releaseInfo.visitOn', {
               [language.onlyIfOptions]: ['links'],