« get me outta code hell

page: use path conditions - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/artist.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-02-05 16:08:05 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-02-05 16:08:56 -0400
commitf34a6baadda3ba87cc482aee34ecb256879730c5 (patch)
tree46d85a1e48198315b2afb5a06a706983c5d55532 /src/page/artist.js
parent4d5465b69989d50131ade81bc1cb8a929c64fc70 (diff)
page: use path conditions staging
Diffstat (limited to 'src/page/artist.js')
-rw-r--r--src/page/artist.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/page/artist.js b/src/page/artist.js
index b68cf05c..257e060d 100644
--- a/src/page/artist.js
+++ b/src/page/artist.js
@@ -8,10 +8,6 @@ export function targets({wikiData}) {
 }
 
 export function pathsForTarget(artist) {
-  const hasGalleryPage =
-    !empty(artist.albumCoverArtistContributions) ||
-    !empty(artist.trackCoverArtistContributions);
-
   return [
     {
       type: 'page',
@@ -23,10 +19,14 @@ export function pathsForTarget(artist) {
       },
     },
 
-    hasGalleryPage && {
+    {
       type: 'page',
       path: ['artistGallery', artist.directory],
 
+      condition: () =>
+        !empty(artist.albumCoverArtistContributions) ||
+        !empty(artist.trackCoverArtistContributions),
+
       contentFunction: {
         name: 'generateArtistGalleryPage',
         args: [artist],