« get me outta code hell

content: generateAlbumInfoPageContent: add listen links - 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>2023-04-04 10:51:50 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-04-04 10:51:50 -0300
commit07c9742601438a325349cfb051bc04c4df626291 (patch)
treebc9ac54a6ca7584b466be826ae34f61b34fc8a29 /src
parentdc573f90bd818531c474c241543f1d3532adaf91 (diff)
content: generateAlbumInfoPageContent: add listen links
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateAlbumInfoPageContent.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/content/dependencies/generateAlbumInfoPageContent.js b/src/content/dependencies/generateAlbumInfoPageContent.js
index 7d99f40c..3d0fe9fc 100644
--- a/src/content/dependencies/generateAlbumInfoPageContent.js
+++ b/src/content/dependencies/generateAlbumInfoPageContent.js
@@ -8,6 +8,7 @@ export default {
     'generateContentHeading',
     'linkAlbumCommentary',
     'linkAlbumGallery',
+    'linkExternal',
   ],
 
   extraDependencies: [
@@ -50,6 +51,12 @@ export default {
         relation('linkAlbumCommentary', album);
     }
 
+    if (!empty(album.urls)) {
+      relations.externalLinks =
+        album.urls.map(url =>
+          relation('linkExternal', url, {type: 'album'}));
+    }
+
     if (!empty(album.additionalFiles)) {
       relations.additionalFilesShortcut =
         relation('generateAdditionalFilesShortcut', album.additionalFiles);
@@ -169,6 +176,12 @@ export default {
               }),
           ]),
 
+        !empty(relations.externalLinks) &&
+          html.tag('p',
+            language.$('releaseInfo.listenOn', {
+              links: language.formatDisjunctionList(relations.externalLinks),
+            })),
+
         /*
           !empty(album.urls) &&
             html.tag('p',