« 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.js3
-rw-r--r--src/page/artist-alias.js6
-rw-r--r--src/page/flash-act.js23
-rw-r--r--src/page/flash.js2
-rw-r--r--src/page/index.js1
5 files changed, 31 insertions, 4 deletions
diff --git a/src/page/album.js b/src/page/album.js
index 69fcabcf..af410763 100644
--- a/src/page/album.js
+++ b/src/page/album.js
@@ -5,7 +5,6 @@ export function targets({wikiData}) {
 }
 
 export function pathsForTarget(album) {
-  const hasGalleryPage = album.tracks.some(t => t.hasUniqueCoverArt);
   const hasCommentaryPage = !!album.commentary || album.tracks.some(t => t.commentary);
 
   return [
@@ -19,7 +18,7 @@ export function pathsForTarget(album) {
       },
     },
 
-    hasGalleryPage && {
+    {
       type: 'page',
       path: ['albumGallery', album.directory],
 
diff --git a/src/page/artist-alias.js b/src/page/artist-alias.js
index 1da2af41..d2305229 100644
--- a/src/page/artist-alias.js
+++ b/src/page/artist-alias.js
@@ -7,6 +7,12 @@ export function targets({wikiData}) {
 export function pathsForTarget(aliasArtist) {
   const {aliasedArtist} = aliasArtist;
 
+  // Don't generate a redirect page if this aliased name resolves to the same
+  // directory as the original artist! See issue #280.
+  if (aliasArtist.directory === aliasedArtist.directory) {
+    return [];
+  }
+
   return [
     {
       type: 'redirect',
diff --git a/src/page/flash-act.js b/src/page/flash-act.js
new file mode 100644
index 00000000..e54525ae
--- /dev/null
+++ b/src/page/flash-act.js
@@ -0,0 +1,23 @@
+export const description = `flash act gallery pages`;
+
+export function condition({wikiData}) {
+  return wikiData.wikiInfo.enableFlashesAndGames;
+}
+
+export function targets({wikiData}) {
+  return wikiData.flashActData;
+}
+
+export function pathsForTarget(flashAct) {
+  return [
+    {
+      type: 'page',
+      path: ['flashActGallery', flashAct.directory],
+
+      contentFunction: {
+        name: 'generateFlashActGalleryPage',
+        args: [flashAct],
+      },
+    },
+  ];
+}
diff --git a/src/page/flash.js b/src/page/flash.js
index b9d27d0f..7df74158 100644
--- a/src/page/flash.js
+++ b/src/page/flash.js
@@ -1,5 +1,3 @@
-import {empty} from '#sugar';
-
 export const description = `flash & game pages`;
 
 export function condition({wikiData}) {
diff --git a/src/page/index.js b/src/page/index.js
index 48e22d2e..21d93c8f 100644
--- a/src/page/index.js
+++ b/src/page/index.js
@@ -2,6 +2,7 @@ export * as album from './album.js';
 export * as artist from './artist.js';
 export * as artistAlias from './artist-alias.js';
 export * as flash from './flash.js';
+export * as flashAct from './flash-act.js';
 export * as group from './group.js';
 export * as homepage from './homepage.js';
 export * as listing from './listing.js';