« get me outta code hell

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:
Diffstat (limited to 'src/page')
-rw-r--r--src/page/album.js12
-rw-r--r--src/page/track.js15
2 files changed, 19 insertions, 8 deletions
diff --git a/src/page/album.js b/src/page/album.js
index c7327cc8..76f3d6b0 100644
--- a/src/page/album.js
+++ b/src/page/album.js
@@ -1,3 +1,5 @@
+import {empty} from '#sugar';
+
 export const description = `per-album info, artwork gallery & commentary pages`;
 
 export function targets({wikiData}) {
@@ -38,6 +40,16 @@ export function pathsForTarget(album) {
       },
     },
 
+    !empty(album.referencedArtworks) && {
+      type: 'page',
+      path: ['albumReferencedArtworks', album.directory],
+
+      contentFunction: {
+        name: 'generateAlbumReferencedArtworksPage',
+        args: [album],
+      },
+    },
+
     /*
     {
       type: 'data',
diff --git a/src/page/track.js b/src/page/track.js
index beb804f8..ea5d0dce 100644
--- a/src/page/track.js
+++ b/src/page/track.js
@@ -20,15 +20,14 @@ export function pathsForTarget(track) {
       },
     },
 
-    !empty(track.referencedArtworks) &&
-      {
-        type: 'page',
-        path: ['trackReferencedArtworks', track.directory],
+    !empty(track.referencedArtworks) && {
+      type: 'page',
+      path: ['trackReferencedArtworks', track.directory],
 
-        contentFunction: {
-          name: 'generateTrackReferencedArtworksPage',
-          args: [track],
-        },
+      contentFunction: {
+        name: 'generateTrackReferencedArtworksPage',
+        args: [track],
       },
+    },
   ];
 }