« get me outta code hell

content: generate{Album,}ReferencedArtworksPage - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateAlbumReferencedArtworksPage.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-11-17 18:16:18 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-11-17 18:16:18 -0400
commitec129ac9ce0b143ca4c325108ea66c2d0e7352ff (patch)
tree0dad7fa2757aa91ed698443d8767722071caed4f /src/content/dependencies/generateAlbumReferencedArtworksPage.js
parent6acbc628cb111c53d0b312ab90cd4807ad4bd8d1 (diff)
content: generate{Album,}ReferencedArtworksPage
Diffstat (limited to 'src/content/dependencies/generateAlbumReferencedArtworksPage.js')
-rw-r--r--src/content/dependencies/generateAlbumReferencedArtworksPage.js68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/content/dependencies/generateAlbumReferencedArtworksPage.js b/src/content/dependencies/generateAlbumReferencedArtworksPage.js
new file mode 100644
index 00000000..3f3d77b3
--- /dev/null
+++ b/src/content/dependencies/generateAlbumReferencedArtworksPage.js
@@ -0,0 +1,68 @@
+export default {
+  contentDependencies: [
+    'generateAlbumCoverArtwork',
+    'generateAlbumStyleRules',
+    'generateBackToAlbumLink',
+    'generateReferencedArtworksPage',
+    'linkAlbum',
+  ],
+
+  extraDependencies: ['html', 'language'],
+
+  relations: (relation, album) => ({
+    page:
+      relation('generateReferencedArtworksPage', album.referencedArtworks),
+
+    albumStyleRules:
+      relation('generateAlbumStyleRules', album, null),
+
+    albumLink:
+      relation('linkAlbum', album),
+
+    backToAlbumLink:
+      relation('generateBackToAlbumLink', album),
+
+    cover:
+      relation('generateAlbumCoverArtwork', album),
+  }),
+
+  data: (album) => ({
+    name:
+      album.name,
+
+    color:
+      album.color,
+  }),
+
+  generate: (data, relations, {html, language}) =>
+    relations.page.slots({
+      title:
+        language.$('albumPage.title', {
+          album:
+            data.name,
+        }),
+
+      color: data.color,
+      styleRules: [relations.albumStyleRules],
+
+      cover: relations.cover,
+
+      navLinks: [
+        {auto: 'home'},
+
+        {
+          html:
+            relations.albumLink
+              .slot('attributes', {class: 'current'}),
+
+          accent:
+            html.tag('a', {href: ''},
+              {class: 'current'},
+
+              language.$('referencedArtworksPage.subtitle')),
+        },
+      ],
+
+      navBottomRowContent: relations.backToAlbumLink,
+    }),
+};