« get me outta code hell

content: generateArtistGalleryPage - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-04 19:04:26 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-04 19:04:26 -0300
commit64577a579707a1193f7c7db61defdcdd6ff1bc05 (patch)
tree7d2bda06a044b42e8dda120382bd3df5b38fdf9a /src/page
parent0a4bd44da7eb9a720504df45b068e77a81a82a1c (diff)
content: generateArtistGalleryPage
Oh look! It's not a stub!
Diffstat (limited to 'src/page')
-rw-r--r--src/page/artist.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/page/artist.js b/src/page/artist.js
index ad365161..1e8dd907 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],
+      },
+    },
   ];
 }