« 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/generateArtistInfoPageChunk.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateArtistInfoPageChunk.js')
-rw-r--r--src/content/dependencies/generateArtistInfoPageChunk.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/content/dependencies/generateArtistInfoPageChunk.js b/src/content/dependencies/generateArtistInfoPageChunk.js
index e19030c9..aadafb08 100644
--- a/src/content/dependencies/generateArtistInfoPageChunk.js
+++ b/src/content/dependencies/generateArtistInfoPageChunk.js
@@ -1,6 +1,13 @@
 import {empty} from '#sugar';
 
 export default {
+  data: (thing) => ({
+    groupDirectories:
+      (thing && thing.groups
+        ? thing.groups.map(group => group.directory)
+        : null),
+  }),
+
   slots: {
     mode: {
       validate: v => v.is('flash', 'album'),
@@ -26,7 +33,7 @@ export default {
     durationApproximate: {type: 'boolean'},
   },
 
-  generate(slots, {html, language}) {
+  generate(data, slots, {html, language}) {
     let earliestItemDate = null;
     let latestItemDate = null;
     let onlyItemDate = null;
@@ -96,6 +103,10 @@ export default {
     return html.tags([
       html.tag('dt',
         slots.id && {id: slots.id},
+
+        data.groupDirectories &&
+          {'data-groups': data.groupDirectories.join(' ')},
+
         accentedLink),
 
       html.tag('dd', slots.list),