diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-07-01 14:14:38 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-07-01 14:14:38 -0300 |
commit | 34a1115df603aff44f354abe9f15d24d53f7a5ac (patch) | |
tree | 09726c8bbfff8c2eec2c189a18841a10827e1ff5 /src/page | |
parent | 28514381d7c4639608786151dc94e5a1b22f85fe (diff) |
content: avoid boilerplate around listings, make spec relevant again
Diffstat (limited to 'src/page')
-rw-r--r-- | src/page/listing.js | 16 |
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], + }, }, ]; } |