From 9fb4baa667f76c51abc0c6469d95351f90266a6a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 4 Jun 2021 16:27:15 -0300 Subject: module-ify tag pages --- src/upd8.js | 68 ------------------------------------------------------------- 1 file changed, 68 deletions(-) (limited to 'src/upd8.js') diff --git a/src/upd8.js b/src/upd8.js index 05b997c..1aa1b5d 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -2215,74 +2215,6 @@ function generateRedirectPage(title, target, {strings}) { `; } -function writeTagPages({wikiData}) { - const { tagData, wikiInfo } = wikiData; - - if (!wikiInfo.features.artTagUI) { - return; - } - - return tagData - .filter(tag => !tag.isCW) - .map(tag => writeTagPage(tag, {wikiData})); -} - -function writeTagPage(tag, {wikiData}) { - const { wikiInfo } = wikiData; - const { things } = tag; - - const page = { - type: 'page', - path: ['tag', tag.directory], - page: ({ - getAlbumCover, - getGridHTML, - getTrackCover, - link, - strings, - to - }) => ({ - title: strings('tagPage.title', {tag: tag.name}), - theme: getThemeString(tag.color), - - main: { - classes: ['top-index'], - content: fixWS` -

${strings('tagPage.title', {tag: tag.name})}

-

${strings('tagPage.infoLine', { - coverArts: strings.count.coverArts(things.length, {unit: true}) - })}

-
- ${getGridHTML({ - entries: things.map(item => ({item})), - srcFn: thing => (thing.album - ? getTrackCover(thing) - : getAlbumCover(thing)), - hrefFn: thing => (thing.album - ? to('localized.track', thing.directory) - : to('localized.album', thing.directory)) - })} -
- ` - }, - - nav: { - links: [ - {toHome: true}, - wikiInfo.features.listings && - { - path: ['localized.listingIndex'], - title: strings('listingIndex.title') - }, - {toCurrentPage: true} - ] - } - }) - }; - - return [page]; -} - function getArtistString(artists, { iconifyURL, link, strings, showIcons = false, -- cgit 1.3.0-6-gf8a5