« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/generateAlbumInfoPage.js11
-rw-r--r--src/content/dependencies/generateAlbumInfoPageContent.js65
-rw-r--r--src/content/dependencies/generateAlbumSocialEmbed.js2
-rw-r--r--src/content/dependencies/generateColorStyleRules.js3
4 files changed, 72 insertions, 9 deletions
diff --git a/src/content/dependencies/generateAlbumInfoPage.js b/src/content/dependencies/generateAlbumInfoPage.js
index 74d80e33..59c314a1 100644
--- a/src/content/dependencies/generateAlbumInfoPage.js
+++ b/src/content/dependencies/generateAlbumInfoPage.js
@@ -21,7 +21,16 @@ export default {
     return relations;
   },
 
-  generate(relations, {
+  data(album) {
+    const data = {};
+
+    data.name = album.name;
+    data.color = album.color;
+
+    return data;
+  },
+
+  generate(data, relations, {
     language,
   }) {
     const page = {};
diff --git a/src/content/dependencies/generateAlbumInfoPageContent.js b/src/content/dependencies/generateAlbumInfoPageContent.js
index e959f274..a17a33f1 100644
--- a/src/content/dependencies/generateAlbumInfoPageContent.js
+++ b/src/content/dependencies/generateAlbumInfoPageContent.js
@@ -56,11 +56,11 @@ export default {
         relation('linkAlbumCommentary', album);
     }
 
-    if (!empty(album.urls)) {
-      relations.externalLinks =
-        album.urls.map(url =>
-          relation('linkExternal', url, {type: 'album'}));
-    }
+    relations.externalLinks =
+      (empty(album.urls)
+        ? null
+        : album.urls.map(url =>
+            relation('linkExternal', url, {type: 'album'})));
 
     relations.trackList = relation('generateAlbumTrackList', album);
 
@@ -237,3 +237,58 @@ export default {
     return content;
   },
 };
+
+/*
+  banner: !empty(album.bannerArtistContribs) && {
+    dimensions: album.bannerDimensions,
+    path: [
+      'media.albumBanner',
+      album.directory,
+      album.bannerFileExtension,
+    ],
+    alt: language.$('misc.alt.albumBanner'),
+    position: 'top',
+  },
+
+  sidebarLeft: generateAlbumSidebar(album, null, {
+    fancifyURL,
+    getLinkThemeString,
+    html,
+    link,
+    language,
+    transformMultiline,
+    wikiData,
+  }),
+
+  nav: {
+    linkContainerClasses: ['nav-links-hierarchy'],
+    links: [
+      {toHome: true},
+      {
+        html: language.$('albumPage.nav.album', {
+          album: link.album(album, {class: 'current'}),
+        }),
+      },
+      {
+        divider: false,
+        html: generateAlbumNavLinks(album, null, {
+          generateNavigationLinks,
+          html,
+          language,
+          link,
+        }),
+      }
+    ],
+    content: generateAlbumChronologyLinks(album, null, {
+      generateChronologyLinks,
+      html,
+    }),
+  },
+
+  secondaryNav: generateAlbumSecondaryNav(album, null, {
+    getLinkThemeString,
+    html,
+    language,
+    link,
+  }),
+*/
diff --git a/src/content/dependencies/generateAlbumSocialEmbed.js b/src/content/dependencies/generateAlbumSocialEmbed.js
index 8786a336..656bd997 100644
--- a/src/content/dependencies/generateAlbumSocialEmbed.js
+++ b/src/content/dependencies/generateAlbumSocialEmbed.js
@@ -74,7 +74,7 @@ export default {
     if (data.hasImage) {
       const imagePath = urls
         .from('shared.root')
-        .to('media.albumColor', data.coverArtDirectory, data.coverArtFileExtension);
+        .to('media.albumCover', data.coverArtDirectory, data.coverArtFileExtension);
       socialEmbed.image = '/' + imagePath;
     }
 
diff --git a/src/content/dependencies/generateColorStyleRules.js b/src/content/dependencies/generateColorStyleRules.js
index 02c3380e..44600935 100644
--- a/src/content/dependencies/generateColorStyleRules.js
+++ b/src/content/dependencies/generateColorStyleRules.js
@@ -10,7 +10,7 @@ export default {
   generate(data, {
     getColors,
   }) {
-    if (!color) return '';
+    if (!data.color) return '';
 
     const {
       primary,
@@ -30,7 +30,6 @@ export default {
       `--bg-color: ${bg}`,
       `--bg-black-color: ${bgBlack}`,
       `--shadow-color: ${shadow}`,
-      ...additionalVariables,
     ];
 
     return [