From 8f39a21ef27f8b66cd49c01e38937d133f13859d Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 8 Aug 2023 11:03:25 -0300 Subject: content: move hard-coded redirects into page files --- src/page/album.js | 11 +++++++++++ src/page/group.js | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'src/page') diff --git a/src/page/album.js b/src/page/album.js index a8e0b591..1d5c7c0f 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -55,6 +55,17 @@ export function pathsForTarget(album) { ]; } +export function pathsTargetless({wikiData: {wikiInfo}}) { + return [ + wikiInfo.canonicalBase === 'https://hsmusic.wiki/' && + { + type: 'redirect', + fromPath: ['path', 'list/all-commentary/'], + toPath: ['commentaryIndex'], + }, + ]; +} + /* export function write(album, {wikiData}) { const getSocialEmbedDescription = ({ diff --git a/src/page/group.js b/src/page/group.js index 4d5f91c8..8795e15b 100644 --- a/src/page/group.js +++ b/src/page/group.js @@ -40,3 +40,21 @@ export function pathsForTarget(group) { }, ]; } + +export function pathsTargetless({wikiData: {wikiInfo}}) { + return [ + wikiInfo.canonicalBase === 'https://hsmusic.wiki/' && + { + type: 'redirect', + fromPath: ['path', 'albums/fandom/'], + toPath: ['groupGallery', 'fandom'], + }, + + wikiInfo.canonicalBase === 'https://hsmusic.wiki/' && + { + type: 'redirect', + fromPath: ['path', 'albums/official/'], + toPath: ['groupGallery', 'official'], + }, + ]; +} -- cgit 1.3.0-6-gf8a5 From 4236b4f348e14be2b78496c8d1c1c60942aa3515 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 8 Aug 2023 11:21:46 -0300 Subject: content: generateCommentaryIndexPage --- src/page/album.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/page') diff --git a/src/page/album.js b/src/page/album.js index 1d5c7c0f..edde73a8 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -57,6 +57,12 @@ export function pathsForTarget(album) { export function pathsTargetless({wikiData: {wikiInfo}}) { return [ + { + type: 'page', + path: ['commentaryIndex'], + contentFunction: {name: 'generateCommentaryIndexPage'}, + }, + wikiInfo.canonicalBase === 'https://hsmusic.wiki/' && { type: 'redirect', -- cgit 1.3.0-6-gf8a5 From f65bbab508cebdbaffd188366e983945d73abd4a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 8 Aug 2023 11:44:41 -0300 Subject: content: dedicated arbitrary page URL key This fixes getPageSubdirectoryPrefix thinking we're deeper than we really are. --- src/page/album.js | 2 +- src/page/group.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/page') diff --git a/src/page/album.js b/src/page/album.js index edde73a8..4ed5bcb1 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -66,7 +66,7 @@ export function pathsTargetless({wikiData: {wikiInfo}}) { wikiInfo.canonicalBase === 'https://hsmusic.wiki/' && { type: 'redirect', - fromPath: ['path', 'list/all-commentary/'], + fromPath: ['page', 'list/all-commentary'], toPath: ['commentaryIndex'], }, ]; diff --git a/src/page/group.js b/src/page/group.js index 8795e15b..e1ed4185 100644 --- a/src/page/group.js +++ b/src/page/group.js @@ -46,14 +46,14 @@ export function pathsTargetless({wikiData: {wikiInfo}}) { wikiInfo.canonicalBase === 'https://hsmusic.wiki/' && { type: 'redirect', - fromPath: ['path', 'albums/fandom/'], + fromPath: ['page', 'albums/fandom'], toPath: ['groupGallery', 'fandom'], }, wikiInfo.canonicalBase === 'https://hsmusic.wiki/' && { type: 'redirect', - fromPath: ['path', 'albums/official/'], + fromPath: ['page', 'albums/official'], toPath: ['groupGallery', 'official'], }, ]; -- cgit 1.3.0-6-gf8a5 From 725482638dcc96632c3a9cf2b885f4128c50a1c1 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 8 Aug 2023 11:46:44 -0300 Subject: write, content: restore & handle redirect titles properly --- src/page/album.js | 1 + src/page/artist-alias.js | 2 +- src/page/group.js | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/page') diff --git a/src/page/album.js b/src/page/album.js index 4ed5bcb1..3b2d02d2 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -68,6 +68,7 @@ export function pathsTargetless({wikiData: {wikiInfo}}) { type: 'redirect', fromPath: ['page', 'list/all-commentary'], toPath: ['commentaryIndex'], + title: 'Album Commentary', }, ]; } diff --git a/src/page/artist-alias.js b/src/page/artist-alias.js index 9e9fdf5b..23513ce1 100644 --- a/src/page/artist-alias.js +++ b/src/page/artist-alias.js @@ -15,7 +15,7 @@ export function pathsForTarget(aliasArtist) { type: 'redirect', fromPath: ['artist', aliasArtist.directory], toPath: ['artist', aliasedArtist.directory], - title: () => aliasedArtist.name, + title: aliasedArtist.name, }, ]; } diff --git a/src/page/group.js b/src/page/group.js index e1ed4185..fa6c1c97 100644 --- a/src/page/group.js +++ b/src/page/group.js @@ -48,6 +48,7 @@ export function pathsTargetless({wikiData: {wikiInfo}}) { type: 'redirect', fromPath: ['page', 'albums/fandom'], toPath: ['groupGallery', 'fandom'], + title: 'Fandom - Gallery', }, wikiInfo.canonicalBase === 'https://hsmusic.wiki/' && @@ -55,6 +56,7 @@ export function pathsTargetless({wikiData: {wikiInfo}}) { type: 'redirect', fromPath: ['page', 'albums/official'], toPath: ['groupGallery', 'official'], + title: 'Official - Gallery', }, ]; } -- cgit 1.3.0-6-gf8a5