« 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/generateAlbumTrackList.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateAlbumTrackList.js')
-rw-r--r--src/content/dependencies/generateAlbumTrackList.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/content/dependencies/generateAlbumTrackList.js b/src/content/dependencies/generateAlbumTrackList.js
index a3435bea..9743c750 100644
--- a/src/content/dependencies/generateAlbumTrackList.js
+++ b/src/content/dependencies/generateAlbumTrackList.js
@@ -35,7 +35,12 @@ function getDisplayMode(album) {
 }
 
 export default {
-  contentDependencies: ['generateAlbumTrackListItem', 'generateContentHeading'],
+  contentDependencies: [
+    'generateAlbumTrackListItem',
+    'generateContentHeading',
+    'transformContent',
+  ],
+
   extraDependencies: ['html', 'language'],
 
   query(album) {
@@ -53,6 +58,10 @@ export default {
           album.trackSections.map(() =>
             relation('generateContentHeading'));
 
+        relations.trackSectionDescriptions =
+          album.trackSections.map(section =>
+            relation('transformContent', section.description));
+
         relations.trackSectionItems =
           album.trackSections.map(section =>
             section.tracks.map(track =>
@@ -132,6 +141,7 @@ export default {
         return html.tag('dl', {class: 'album-group-list'},
           stitchArrays({
             heading: relations.trackSectionHeadings,
+            description: relations.trackSectionDescriptions,
             items: relations.trackSectionItems,
 
             name: data.trackSectionNames,
@@ -140,6 +150,7 @@ export default {
             startIndex: data.trackSectionStartIndices,
           }).map(({
               heading,
+              description,
               items,
 
               name,
@@ -172,12 +183,17 @@ export default {
                     }),
                 })),
 
-              html.tag('dd',
+              html.tag('dd', [
+                html.tag('blockquote',
+                  {[html.onlyIfContent]: true},
+                  description),
+
                 html.tag(listTag,
                   data.hasTrackNumbers &&
                     {start: startIndex + 1},
 
-                  slotItems(items))),
+                  slotItems(items)),
+              ]),
             ]));
 
       case 'tracks':