From 64577a579707a1193f7c7db61defdcdd6ff1bc05 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 4 Jun 2023 19:04:26 -0300 Subject: content: generateArtistGalleryPage Oh look! It's not a stub! --- src/page/artist.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/page') diff --git a/src/page/artist.js b/src/page/artist.js index ad36516..1e8dd90 100644 --- a/src/page/artist.js +++ b/src/page/artist.js @@ -2,6 +2,8 @@ // // NB: See artist-alias.js for artist alias redirect pages. +import {empty} from '../util/sugar.js'; + export const description = `per-artist info & artwork gallery pages`; export function targets({wikiData}) { @@ -9,6 +11,10 @@ export function targets({wikiData}) { } export function pathsForTarget(artist) { + const hasGalleryPage = + !empty(artist.tracksAsCoverArtist) || + !empty(artist.albumsAsCoverArtist); + return [ { type: 'page', @@ -19,5 +25,15 @@ export function pathsForTarget(artist) { args: [artist], }, }, + + hasGalleryPage && { + type: 'page', + path: ['artistGallery', artist.directory], + + contentFunction: { + name: 'generateArtistGalleryPage', + args: [artist], + }, + }, ]; } -- cgit 1.3.0-6-gf8a5