« get me outta code hell

content: generateAlbumAdditionalFilesList: description as content - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-04 11:33:18 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-04-04 11:33:18 -0300
commit7e8edc2e0bdee10127d8cb780ecfaebb6fa34240 (patch)
treef6ea25af8daa5913d9ba00ba0047c7be9a0e9b0d
parent5216ac503e849083edd9ea66306c5fb51ffe3139 (diff)
content: generateAlbumAdditionalFilesList: description as content
-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({