« get me outta code hell

data, content: singles - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/album.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-07-02 17:43:34 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-07-02 17:43:34 -0300
commit112a840bdf69bfba5aae893e92b0b20c4a4884fd (patch)
treef82c3244a2f743d69e45556138b4ecd06b5369af /src/page/album.js
parentda8d9d616eb4d002126a89e6cba7f26053c6e4c3 (diff)
data, content: singles
Diffstat (limited to 'src/page/album.js')
-rw-r--r--src/page/album.js25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/page/album.js b/src/page/album.js
index 696e2854..e585618c 100644
--- a/src/page/album.js
+++ b/src/page/album.js
@@ -8,15 +8,22 @@ export function targets({wikiData}) {
 
 export function pathsForTarget(album) {
   return [
-    {
-      type: 'page',
-      path: ['album', album.directory],
-
-      contentFunction: {
-        name: 'generateAlbumInfoPage',
-        args: [album],
-      },
-    },
+    (album.style === 'single'
+      ? {
+          type: 'redirect',
+          fromPath: ['album', album.directory],
+          toPath: ['track', album.tracks[0].directory],
+          title: album.name,
+        }
+      : {
+          type: 'page',
+          path: ['album', album.directory],
+
+          contentFunction: {
+            name: 'generateAlbumInfoPage',
+            args: [album],
+          },
+        }),
 
     {
       type: 'page',