« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/listing.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/page/listing.js')
-rw-r--r--src/page/listing.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/page/listing.js b/src/page/listing.js
index da4c2968..c770f825 100644
--- a/src/page/listing.js
+++ b/src/page/listing.js
@@ -14,11 +14,21 @@ import {getTotalDuration} from '../util/wiki-data.js';
 
 export const description = `wiki-wide listing pages & index`;
 
-export function pathsTargetless() {
+export function targets({wikiData}) {
+  return (
+    wikiData.listingSpec
+      .filter(listing => listing.contentFunction));
+}
+
+export function pathsForTarget(listing) {
   return [
     {
-      type: 'page', path: ['listing', 'albums/by-name'],
-      contentFunction: {name: 'listAlbumsByName'},
+      type: 'page',
+      path: ['listing', listing.directory],
+      contentFunction: {
+        name: listing.contentFunction,
+        args: [listing],
+      },
     },
   ];
 }