« 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/generateAlbumCommentaryPage.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateAlbumCommentaryPage.js')
-rw-r--r--src/content/dependencies/generateAlbumCommentaryPage.js24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/content/dependencies/generateAlbumCommentaryPage.js b/src/content/dependencies/generateAlbumCommentaryPage.js
index 15d43a32..ea31292c 100644
--- a/src/content/dependencies/generateAlbumCommentaryPage.js
+++ b/src/content/dependencies/generateAlbumCommentaryPage.js
@@ -1,3 +1,5 @@
+import {stitchArrays} from '../../util/sugar.js';
+
 export default {
   contentDependencies: [
     'generateAlbumNavAccent',
@@ -127,18 +129,20 @@ export default {
               relations.albumCommentaryContent),
           ],
 
-          relations.trackCommentaryContent.map((commentaryContent, i) => [
-            relations.trackCommentaryHeadings[i]
-              .slots({
+          stitchArrays({
+            heading: relations.trackCommentaryHeadings,
+            link: relations.trackCommentaryLinks,
+            directory: data.trackCommentaryDirectories,
+            content: relations.trackCommentaryContent,
+            colorVariables: relations.trackCommentaryColorVariables,
+          }).map(({heading, link, directory, content, colorVariables}) => [
+              heading.slots({
                 tag: 'h3',
-                id: data.trackCommentaryDirectories[i],
-                title: relations.trackCommentaryLinks[i],
+                id: directory,
+                title: link,
               }),
-
-            html.tag('blockquote',
-              {style: relations.trackCommentaryColorVariables[i]},
-              relations.trackCommentaryContent[i]),
-          ]),
+              html.tag('blockquote', {style: colorVariables}, content),
+            ]),
         ],
 
         navLinkStyle: 'hierarchical',