« get me outta code hell

content, urls, client: /vgm-album/ - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-05-28 13:39:22 -0300
committer(quasar) nebula <qznebula@protonmail.com>2026-05-28 13:39:22 -0300
commite036782607ed0e1d43df7f8d4643cc7d7671c359 (patch)
treed43721535d93bac885a9d29f85f09a0e02ef96af /src
parent75e68aa1c8886e69d63a0e0b365fd6a7c309412c (diff)
content, urls, client: /vgm-album/
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateTrackSocialEmbed.js6
-rw-r--r--src/content/dependencies/linkAlbum.js2
-rw-r--r--src/content/dependencies/linkAlbumCommentary.js8
-rw-r--r--src/content/dependencies/linkAlbumDynamically.js6
-rw-r--r--src/content/dependencies/linkAlbumGallery.js8
-rw-r--r--src/content/dependencies/linkAlbumReferencedArtworks.js8
-rw-r--r--src/content/dependencies/linkAlbumReferencingArtworks.js8
-rw-r--r--src/content/dependencies/linkTrackDynamically.js2
-rw-r--r--src/page/album.js17
-rw-r--r--src/static/js/client-util.js1
-rw-r--r--src/static/js/client/album-commentary-sidebar.js5
-rw-r--r--src/static/js/client/sidebar-search.js5
-rw-r--r--src/urls-default.yaml6
13 files changed, 61 insertions, 21 deletions
diff --git a/src/content/dependencies/generateTrackSocialEmbed.js b/src/content/dependencies/generateTrackSocialEmbed.js
index 94453f7d..63ba7ffa 100644
--- a/src/content/dependencies/generateTrackSocialEmbed.js
+++ b/src/content/dependencies/generateTrackSocialEmbed.js
@@ -19,6 +19,8 @@ export default {
     data.trackDirectory = track.directory;
     data.albumDirectory = album.directory;
 
+    data.albumStyle = album.style;
+
     data.hasImage = track.hasUniqueCoverArt || album.hasCoverArt;
 
     if (track.hasUniqueCoverArt) {
@@ -47,7 +49,9 @@ export default {
           }),
 
         headingLink:
-          absoluteTo('localized.album', data.albumDirectory),
+          (data.albumStyle === 'in-game vgm'
+            ? absoluteTo('localized.vgmAlbum', data.albumDirectory)
+            : absoluteTo('localized.album', data.albumDirectory)),
 
         imagePath:
           (data.hasImage
diff --git a/src/content/dependencies/linkAlbum.js b/src/content/dependencies/linkAlbum.js
index 085d5f62..24b14e85 100644
--- a/src/content/dependencies/linkAlbum.js
+++ b/src/content/dependencies/linkAlbum.js
@@ -3,6 +3,8 @@ export default {
     link:
       (album.style === 'single'
         ? relation('linkTrack', album.tracks[0])
+     : album.style === 'in-game vgm'
+        ? relation('linkThing', 'localized.vgmAlbum', album)
         : relation('linkThing', 'localized.album', album)),
   }),
 
diff --git a/src/content/dependencies/linkAlbumCommentary.js b/src/content/dependencies/linkAlbumCommentary.js
index f1917345..431dd6ec 100644
--- a/src/content/dependencies/linkAlbumCommentary.js
+++ b/src/content/dependencies/linkAlbumCommentary.js
@@ -1,6 +1,10 @@
 export default {
-  relations: (relation, album) =>
-    ({link: relation('linkThing', 'localized.albumCommentary', album)}),
+  relations: (relation, album) => ({
+    link:
+      (album.style === 'in-game vgm'
+        ? relation('linkThing', 'localized.vgmAlbumCommentary', album)
+        : relation('linkThing', 'localized.albumCommentary', album)),
+  }),
 
   generate: (relations) => relations.link,
 };
diff --git a/src/content/dependencies/linkAlbumDynamically.js b/src/content/dependencies/linkAlbumDynamically.js
index ba572c8d..3801b218 100644
--- a/src/content/dependencies/linkAlbumDynamically.js
+++ b/src/content/dependencies/linkAlbumDynamically.js
@@ -31,7 +31,7 @@ export default {
      // When linking to an album *from* an album commentary page,
      // if the link is to the *same* album, then the effective target
      // of the link is really the album's commentary, so scroll to it.
-    (pagePath[0] === 'albumCommentary' &&
+    (pagePath[0].match(/albumCommentary$/i) &&
      pagePath[1] === data.albumDirectory &&
      data.albumHasCommentary
       ? relations.infoLink.slots({
@@ -42,11 +42,11 @@ export default {
      // When linking to *another* album from an album commentary page,
      // the target is (by default) still just the album (its info page).
      // But this can be customized per-link!
-   : pagePath[0] === 'albumCommentary' &&
+   : pagePath[0].match(/albumCommentary$/i) &&
      slots.linkCommentaryPages
       ? relations.commentaryLink
 
-   : pagePath[0] === 'albumGallery'
+   : pagePath[0].match(/albumGallery$/i)
       ? relations.galleryLink
 
       : relations.infoLink),
diff --git a/src/content/dependencies/linkAlbumGallery.js b/src/content/dependencies/linkAlbumGallery.js
index efba66d1..b3d8fac0 100644
--- a/src/content/dependencies/linkAlbumGallery.js
+++ b/src/content/dependencies/linkAlbumGallery.js
@@ -1,6 +1,10 @@
 export default {
-  relations: (relation, album) =>
-    ({link: relation('linkThing', 'localized.albumGallery', album)}),
+  relations: (relation, album) => ({
+    link:
+      (album.style === 'in-game vgm'
+        ? relation('linkThing', 'localized.vgmAlbumGallery', album)
+        : relation('linkThing', 'localized.albumGallery', album)),
+  }),
 
   generate: (relations) => relations.link,
 };
diff --git a/src/content/dependencies/linkAlbumReferencedArtworks.js b/src/content/dependencies/linkAlbumReferencedArtworks.js
index 411bd2ab..c734f403 100644
--- a/src/content/dependencies/linkAlbumReferencedArtworks.js
+++ b/src/content/dependencies/linkAlbumReferencedArtworks.js
@@ -1,6 +1,10 @@
 export default {
-  relations: (relation, album) =>
-    ({link: relation('linkThing', 'localized.albumReferencedArtworks', album)}),
+  relations: (relation, album) => ({
+    link:
+      (album.style === 'in-game vgm'
+        ? relation('linkThing', 'localized.vgmAlbumReferencedArtworks', album)
+        : relation('linkThing', 'localized.albumReferencedArtworks', album)),
+  }),
 
   generate: (relations) => relations.link,
 };
diff --git a/src/content/dependencies/linkAlbumReferencingArtworks.js b/src/content/dependencies/linkAlbumReferencingArtworks.js
index 3aee9a4b..37fdadda 100644
--- a/src/content/dependencies/linkAlbumReferencingArtworks.js
+++ b/src/content/dependencies/linkAlbumReferencingArtworks.js
@@ -1,6 +1,10 @@
 export default {
-  relations: (relation, album) =>
-    ({link: relation('linkThing', 'localized.albumReferencingArtworks', album)}),
+  relations: (relation, album) => ({
+    link:
+      (album.style === 'in-game vgm'
+        ? relation('linkThing', 'localized.vgmAlbumReferencingArtworks', album)
+        : relation('linkThing', 'localized.albumReferencingArtworks', album)),
+  }),
 
   generate: (relations) => relations.link,
 };
diff --git a/src/content/dependencies/linkTrackDynamically.js b/src/content/dependencies/linkTrackDynamically.js
index 088bbe09..06c8a082 100644
--- a/src/content/dependencies/linkTrackDynamically.js
+++ b/src/content/dependencies/linkTrackDynamically.js
@@ -18,7 +18,7 @@ export default {
 
   generate(data, relations, {pagePath}) {
     if (
-      pagePath[0] === 'albumCommentary' &&
+      pagePath[0].match(/albumCommentary$/i) &&
       pagePath[1] === data.albumDirectory &&
       data.trackHasCommentary
     ) {
diff --git a/src/page/album.js b/src/page/album.js
index e585618c..c6924881 100644
--- a/src/page/album.js
+++ b/src/page/album.js
@@ -7,17 +7,22 @@ export function targets({wikiData}) {
 }
 
 export function pathsForTarget(album) {
+  const keyPrefix =
+    (album.style === 'in-game vgm'
+      ? 'vgmAlbum'
+      : 'album');
+
   return [
     (album.style === 'single'
       ? {
           type: 'redirect',
-          fromPath: ['album', album.directory],
+          fromPath: [keyPrefix, album.directory],
           toPath: ['track', album.tracks[0].directory],
           title: album.name,
         }
       : {
           type: 'page',
-          path: ['album', album.directory],
+          path: [keyPrefix, album.directory],
 
           contentFunction: {
             name: 'generateAlbumInfoPage',
@@ -27,7 +32,7 @@ export function pathsForTarget(album) {
 
     {
       type: 'page',
-      path: ['albumGallery', album.directory],
+      path: [keyPrefix + 'Gallery', album.directory],
 
       contentFunction: {
         name: 'generateAlbumGalleryPage',
@@ -37,7 +42,7 @@ export function pathsForTarget(album) {
 
     {
       type: 'page',
-      path: ['albumCommentary', album.directory],
+      path: [keyPrefix + 'Commentary', album.directory],
 
       contentFunction: {
         name: 'generateAlbumCommentaryPage',
@@ -47,7 +52,7 @@ export function pathsForTarget(album) {
 
     {
       type: 'page',
-      path: ['albumReferencedArtworks', album.directory],
+      path: [keyPrefix + 'ReferencedArtworks', album.directory],
 
       condition: () =>
         album.hasCoverArt &&
@@ -61,7 +66,7 @@ export function pathsForTarget(album) {
 
     {
       type: 'page',
-      path: ['albumReferencingArtworks', album.directory],
+      path: [keyPrefix + 'ReferencingArtworks', album.directory],
 
       condition: () =>
         album.hasCoverArt &&
diff --git a/src/static/js/client-util.js b/src/static/js/client-util.js
index a6846714..51fbb1f0 100644
--- a/src/static/js/client-util.js
+++ b/src/static/js/client-util.js
@@ -103,6 +103,7 @@ export const openArtist = d => rebase(`artist/${d}/`);
 export const openFlash = d => rebase(`flash/${d}/`);
 export const openGroup = d => rebase(`group/${d}/`);
 export const openTrack = d => rebase(`track/${d}/`);
+export const openVGMAlbum = d => rebase(`vgm-album/${d}/`);
 
 // TODO: This should also use urlSpec.
 
diff --git a/src/static/js/client/album-commentary-sidebar.js b/src/static/js/client/album-commentary-sidebar.js
index d7c4a591..144544ed 100644
--- a/src/static/js/client/album-commentary-sidebar.js
+++ b/src/static/js/client/album-commentary-sidebar.js
@@ -23,7 +23,10 @@ export const info = {
 };
 
 export function getPageReferences() {
-  if (document.documentElement.dataset.urlKey !== 'localized.albumCommentary') {
+  if (
+    document.documentElement.dataset.urlKey !== 'localized.albumCommentary' &&
+    document.documentElement.dataset.urlKey !== 'localized.vgmAlbumCommentary'
+  ) {
     return;
   }
 
diff --git a/src/static/js/client/sidebar-search.js b/src/static/js/client/sidebar-search.js
index 94f1e4ef..3c6666e9 100644
--- a/src/static/js/client/sidebar-search.js
+++ b/src/static/js/client/sidebar-search.js
@@ -16,6 +16,7 @@ import {
   openFlash,
   openGroup,
   openTrack,
+  openVGMAlbum,
   rebase,
   templateContent,
 } from '../client-util.js';
@@ -1109,7 +1110,9 @@ function generateSidebarSearchResult(result, results) {
   switch (result.referenceType) {
     case 'album': {
       preparedSlots.href =
-        openAlbum(result.directory);
+        (result.data.classification === 'in-game vgm'
+          ? openVGMAlbum(result.directory)
+          : openAlbum(result.directory));
 
       preparedSlots.kindString =
         (result.data.classification === 'single'
diff --git a/src/urls-default.yaml b/src/urls-default.yaml
index b88b7286..e67bce39 100644
--- a/src/urls-default.yaml
+++ b/src/urls-default.yaml
@@ -68,6 +68,12 @@ localized:
     trackReferencedArtworks: 'track/<>/referenced-art/'
     trackReferencingArtworks: 'track/<>/referencing-art/'
 
+    vgmAlbum: 'vgm-album/<>/'
+    vgmAlbumCommentary: 'commentary/vgm-album/<>/'
+    vgmAlbumGallery: 'vgm-album/<>/gallery/'
+    vgmAlbumReferencedArtworks: 'vgm-album/<>/referenced-art/'
+    vgmAlbumReferencingArtworks: 'vgm-album/<>/referencing-art/'
+
 # This gets automatically switched in place when working from
 # a baseDirectory, so it should never be referenced manually.
 # It's also filled in externally to this YAML spec.