« 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/listRandomPageLinks.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/listRandomPageLinks.js')
-rw-r--r--src/content/dependencies/listRandomPageLinks.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/content/dependencies/listRandomPageLinks.js b/src/content/dependencies/listRandomPageLinks.js
index 089289f7..375a72d7 100644
--- a/src/content/dependencies/listRandomPageLinks.js
+++ b/src/content/dependencies/listRandomPageLinks.js
@@ -61,7 +61,19 @@ export default {
     return relations;
   },
 
-  generate(relations, {html, language}) {
+  data(query) {
+    const data = {};
+
+    if (query.divideByGroups) {
+      data.groupDirectories =
+        query.groups
+          .map(group => group.directory);
+    }
+
+    return data;
+  },
+
+  generate(data, relations, {html, language}) {
     const miscellaneousChunkRows = [
       {
         stringsKey: 'randomArtist',
@@ -111,6 +123,13 @@ export default {
           language.$('listingPage.other.randomPages.dataLoadedLine')),
       ],
 
+      showSkipToSection: true,
+
+      chunkIDs: [
+        null,
+        ...data.groupDirectories,
+      ],
+
       chunkTitles: [
         {stringsKey: 'misc'},