« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/content/dependencies/generateArtTagGalleryPage.js4
-rw-r--r--src/content/dependencies/generateArtTagNavLinks.js6
-rw-r--r--src/content/dependencies/linkArtTagDynamically.js14
-rw-r--r--src/content/dependencies/linkArtTagInfo.js (renamed from src/content/dependencies/linkArtTag.js)0
-rw-r--r--src/content/dependencies/transformContent.js4
5 files changed, 21 insertions, 7 deletions
diff --git a/src/content/dependencies/generateArtTagGalleryPage.js b/src/content/dependencies/generateArtTagGalleryPage.js
index fcdf917b..b9e0f2c5 100644
--- a/src/content/dependencies/generateArtTagGalleryPage.js
+++ b/src/content/dependencies/generateArtTagGalleryPage.js
@@ -9,7 +9,7 @@ export default {
     'generateQuickDescription',
     'image',
     'linkAlbum',
-    'linkArtTag',
+    'linkArtTagInfo',
     'linkArtTagGallery',
     'linkTrack',
   ],
@@ -45,7 +45,7 @@ export default {
       relation('generateArtTagNavLinks', artTag);
 
     relations.infoPageLink =
-      relation('linkArtTag', artTag);
+      relation('linkArtTagInfo', artTag);
 
     relations.quickDescription =
       relation('generateQuickDescription', artTag);
diff --git a/src/content/dependencies/generateArtTagNavLinks.js b/src/content/dependencies/generateArtTagNavLinks.js
index 368b36fe..34f95f6e 100644
--- a/src/content/dependencies/generateArtTagNavLinks.js
+++ b/src/content/dependencies/generateArtTagNavLinks.js
@@ -2,7 +2,7 @@ import {empty} from '#sugar';
 
 export default {
   contentDependencies: [
-    'linkArtTag',
+    'linkArtTagInfo',
     'linkArtTagGallery',
   ],
 
@@ -13,10 +13,10 @@ export default {
 
   relations: (relation, sprawl, tag) => ({
     mainLink:
-      relation('linkArtTag', tag),
+      relation('linkArtTagInfo', tag),
 
     infoLink:
-      relation('linkArtTag', tag),
+      relation('linkArtTagInfo', tag),
 
     galleryLink:
       relation('linkArtTagGallery', tag),
diff --git a/src/content/dependencies/linkArtTagDynamically.js b/src/content/dependencies/linkArtTagDynamically.js
new file mode 100644
index 00000000..964258e1
--- /dev/null
+++ b/src/content/dependencies/linkArtTagDynamically.js
@@ -0,0 +1,14 @@
+export default {
+  contentDependencies: ['linkArtTagGallery', 'linkArtTagInfo'],
+  extraDependencies: ['pagePath'],
+
+  relations: (relation, artTag) => ({
+    galleryLink: relation('linkArtTagGallery', artTag),
+    infoLink: relation('linkArtTagInfo', artTag),
+  }),
+
+  generate: (relations, {pagePath}) =>
+    (pagePath[0] === 'artTagInfo'
+      ? relations.infoLink
+      : relations.galleryLink),
+};
diff --git a/src/content/dependencies/linkArtTag.js b/src/content/dependencies/linkArtTagInfo.js
index 409cb3c0..409cb3c0 100644
--- a/src/content/dependencies/linkArtTag.js
+++ b/src/content/dependencies/linkArtTagInfo.js
diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js
index 087520ce..9c1f9529 100644
--- a/src/content/dependencies/transformContent.js
+++ b/src/content/dependencies/transformContent.js
@@ -122,8 +122,8 @@ const linkThingRelationMap = {
   albumGallery: 'linkAlbumGallery',
   artist: 'linkArtist',
   artistGallery: 'linkArtistGallery',
-  artTag: 'linkArtTagGallery',
-  artTagInfo: 'linkArtTag',
+  artTag: 'linkArtTagDynamically',
+  artTagInfo: 'linkArtTagInfo',
   flash: 'linkFlash',
   groupInfo: 'linkGroup',
   groupGallery: 'linkGroupGallery',