« 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/generateArtistInfoPageArtworksChunk.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateArtistInfoPageArtworksChunk.js')
-rw-r--r--src/content/dependencies/generateArtistInfoPageArtworksChunk.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageArtworksChunk.js b/src/content/dependencies/generateArtistInfoPageArtworksChunk.js
index 2b10df3e..66e4204a 100644
--- a/src/content/dependencies/generateArtistInfoPageArtworksChunk.js
+++ b/src/content/dependencies/generateArtistInfoPageArtworksChunk.js
@@ -5,6 +5,8 @@ export default {
     'linkAlbum',
   ],
 
+  extraDependencies: ['html'],
+
   relations: (relation, album, contribs) => ({
     template:
       relation('generateArtistInfoPageChunk'),
@@ -24,11 +26,25 @@ export default {
         .map(contrib => contrib.date),
   }),
 
-  generate: (data, relations) =>
+  slots: {
+    filterEditsForWiki: {
+      type: 'boolean',
+      default: false,
+    },
+  },
+
+  generate: (data, relations, slots) =>
     relations.template.slots({
       mode: 'album',
       albumLink: relations.albumLink,
-      dates: data.dates,
-      items: relations.items,
+
+      dates:
+        (slots.filterEditsForWiki
+          ? Array.from({length: data.dates}, () => null)
+          : data.dates),
+
+      items:
+        relations.items.map(item =>
+          item.slot('filterEditsForWiki', slots.filterEditsForWiki)),
     }),
 };