« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateAlbumAdditionalFilesList.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/content/dependencies/generateAlbumAdditionalFilesList.js b/src/content/dependencies/generateAlbumAdditionalFilesList.js
index b9269d74..77aac472 100644
--- a/src/content/dependencies/generateAlbumAdditionalFilesList.js
+++ b/src/content/dependencies/generateAlbumAdditionalFilesList.js
@@ -6,6 +6,7 @@ export default {
     'generateAdditionalFilesListChunk',
     'generateAdditionalFilesListChunkItem',
     'linkAlbumAdditionalFile',
+    'transformContent',
   ],
 
   extraDependencies: ['getSizeOfAdditionalFile', 'html', 'urls'],
@@ -18,6 +19,13 @@ export default {
       additionalFiles
         .map(() => relation('generateAdditionalFilesListChunk')),
 
+    chunkDescriptions:
+      additionalFiles
+        .map(({description}) =>
+          (description
+            ? relation('transformContent', description)
+            : null)),
+
     chunkItems:
       additionalFiles
         .map(({files}) =>
@@ -38,10 +46,6 @@ export default {
       additionalFiles
         .map(({title}) => title),
 
-    chunkDescriptions:
-      additionalFiles
-        .map(({description}) => description ?? null),
-
     chunkItemLocations:
       additionalFiles
         .map(({files}) => files ?? []),
@@ -56,10 +60,13 @@ export default {
       chunks:
         stitchArrays({
           chunk: relations.chunks,
+          description: relations.chunkDescriptions,
           title: data.chunkTitles,
-          description: data.chunkDescriptions,
         }).map(({chunk, title, description}) =>
-            chunk.slots({title, description})),
+            chunk.slots({
+              title,
+              description: description.slot('mode', 'inline'),
+            })),
 
       chunkItems:
         stitchArrays({