« get me outta code hell

content: inline generateCommentarySection behavior - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateTrackInfoPage.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-02-18 17:35:35 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-03-02 08:23:22 -0400
commiteedd05e6aa40d050851d877a3be90bc5b17dd5f8 (patch)
tree1da6efe75a38e30f095df272ecbc724871e83a60 /src/content/dependencies/generateTrackInfoPage.js
parentae08fc94a062554c479c4ba6c4367d31dd157a4f (diff)
content: inline generateCommentarySection behavior
Diffstat (limited to 'src/content/dependencies/generateTrackInfoPage.js')
-rw-r--r--src/content/dependencies/generateTrackInfoPage.js39
1 files changed, 27 insertions, 12 deletions
diff --git a/src/content/dependencies/generateTrackInfoPage.js b/src/content/dependencies/generateTrackInfoPage.js
index f2e4ab32..f37758fb 100644
--- a/src/content/dependencies/generateTrackInfoPage.js
+++ b/src/content/dependencies/generateTrackInfoPage.js
@@ -6,7 +6,7 @@ export default {
     'generateAlbumSecondaryNav',
     'generateAlbumSidebar',
     'generateAlbumStyleRules',
-    'generateCommentarySection',
+    'generateCommentaryEntry',
     'generateContentHeading',
     'generateContributionList',
     'generatePageLayout',
@@ -116,11 +116,13 @@ export default {
         track.album,
         track.additionalFiles),
 
-    artistCommentarySection:
-      relation('generateCommentarySection', track.commentary),
+    artistCommentaryEntries:
+      track.commentary
+        .map(entry => relation('generateCommentaryEntry', entry)),
 
-    creditSourcesSection:
-      relation('generateCommentarySection', track.creditSources),
+    creditSourceEntries:
+      track.creditSources
+        .map(entry => relation('generateCommentaryEntry', entry)),
   }),
 
   data: (_query, _sprawl, track) => ({
@@ -189,7 +191,7 @@ export default {
                         language.$(capsule, 'link')),
                   })),
 
-              !html.isBlank(relations.artistCommentarySection) &&
+              !html.isBlank(relations.artistCommentaryEntries) &&
                 language.encapsulate(capsule, 'readCommentary', capsule =>
                   language.$(capsule, {
                     link:
@@ -198,7 +200,7 @@ export default {
                         language.$(capsule, 'link')),
                   })),
 
-              !html.isBlank(relations.creditSourcesSection) &&
+              !html.isBlank(relations.creditSourceEntries) &&
                 language.encapsulate(capsule, 'readCreditSources', capsule =>
                   language.$(capsule, {
                     link:
@@ -362,12 +364,25 @@ export default {
             relations.additionalFilesList,
           ]),
 
-          relations.artistCommentarySection,
+          html.tags([
+            relations.contentHeading.clone()
+              .slots({
+                attributes: {id: 'artist-commentary'},
+                title: language.$('misc.artistCommentary'),
+              }),
 
-          relations.creditSourcesSection.slots({
-            id: 'credit-sources',
-            title: language.$('misc.creditSources'),
-          }),
+            relations.artistCommentaryEntries,
+          ]),
+
+          html.tags([
+            relations.contentHeading.clone()
+              .slots({
+                attributes: {id: 'credit-sources'},
+                title: language.$('misc.creditSources'),
+              }),
+
+            relations.creditSourceEntries,
+          ]),
         ],
 
         navLinkStyle: 'hierarchical',