« get me outta code hell

content: linkOtherReleaseOnArtistInfoPage - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/linkOtherReleaseOnArtistInfoPage.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-02-21 08:24:55 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-03-02 08:24:13 -0400
commit0bed9ef3384f76421592d8f017d7deaa464fd859 (patch)
treee2810f3186d7a72e3801aeb7d1c5aadc6b0b6113 /src/content/dependencies/linkOtherReleaseOnArtistInfoPage.js
parent4b9550a2d8dda5d58861c8f2c2c2a7b7ec803059 (diff)
content: linkOtherReleaseOnArtistInfoPage
Diffstat (limited to 'src/content/dependencies/linkOtherReleaseOnArtistInfoPage.js')
-rw-r--r--src/content/dependencies/linkOtherReleaseOnArtistInfoPage.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/content/dependencies/linkOtherReleaseOnArtistInfoPage.js b/src/content/dependencies/linkOtherReleaseOnArtistInfoPage.js
new file mode 100644
index 00000000..d3f7853a
--- /dev/null
+++ b/src/content/dependencies/linkOtherReleaseOnArtistInfoPage.js
@@ -0,0 +1,20 @@
+export default {
+  contentDependencies: ['generateColorStyleAttribute'],
+  extraDependencies: ['html', 'language'],
+
+  relations: (relation, track) => ({
+    colorStyle:
+      relation('generateColorStyleAttribute', track.album.color),
+  }),
+
+  data: (track) => ({
+    albumName:
+      track.album.name,
+  }),
+
+  generate: (data, relations, {html, language}) =>
+    html.tag('a',
+      {href: '#'},
+      relations.colorStyle.slot('context', 'primary-only'),
+      language.sanitize(data.albumName)),
+};