« get me outta code hell

content, external-links: [normal, compact] -> [platform, handle] - 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:
author(quasar) nebula <qznebula@protonmail.com>2024-03-29 18:42:54 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-03-29 20:10:13 -0300
commitb0d20c958cf8ef1edd4ac3ce28beb9ef63d00bdb (patch)
tree2d9da8188a051a2b71b987d0a7efb0929fea400c /src/content/dependencies
parentaaeffb2fe2d2e169cf92da5142037214ac341219 (diff)
content, external-links: [normal, compact] -> [platform, handle]
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/generateAlbumReleaseInfo.js19
-rw-r--r--src/content/dependencies/generateAlbumSidebarGroupBox.js5
-rw-r--r--src/content/dependencies/generateArtistInfoPage.js7
-rw-r--r--src/content/dependencies/generateGroupInfoPage.js5
-rw-r--r--src/content/dependencies/linkExternal.js2
-rw-r--r--src/content/dependencies/linkExternalAsIcon.js8
6 files changed, 17 insertions, 29 deletions
diff --git a/src/content/dependencies/generateAlbumReleaseInfo.js b/src/content/dependencies/generateAlbumReleaseInfo.js
index 5128fbac..6fc1375b 100644
--- a/src/content/dependencies/generateAlbumReleaseInfo.js
+++ b/src/content/dependencies/generateAlbumReleaseInfo.js
@@ -96,17 +96,14 @@ export default {
               language.formatDisjunctionList(
                 relations.externalLinks
                   .map(link =>
-                    link.slots({
-                      context: [
-                        'album',
-                        (data.numTracks === 0
-                          ? 'albumNoTracks'
-                       : data.numTracks === 1
-                          ? 'albumOneTrack'
-                          : 'albumMultipleTracks'),
-                      ],
-                      style: 'normal',
-                    }))),
+                    link.slot('context', [
+                      'album',
+                      (data.numTracks === 0
+                        ? 'albumNoTracks'
+                     : data.numTracks === 1
+                        ? 'albumOneTrack'
+                        : 'albumMultipleTracks'),
+                    ]))),
           })),
     ]);
   },
diff --git a/src/content/dependencies/generateAlbumSidebarGroupBox.js b/src/content/dependencies/generateAlbumSidebarGroupBox.js
index 5b7e2e45..93ebf5d4 100644
--- a/src/content/dependencies/generateAlbumSidebarGroupBox.js
+++ b/src/content/dependencies/generateAlbumSidebarGroupBox.js
@@ -89,10 +89,7 @@ export default {
             links:
               language.formatDisjunctionList(
                 relations.externalLinks
-                  .map(link => link.slots({
-                    context: 'group',
-                    style: 'platform',
-                  }))),
+                  .map(link => link.slot('context', 'group'))),
           })),
 
       slots.mode === 'album' &&
diff --git a/src/content/dependencies/generateArtistInfoPage.js b/src/content/dependencies/generateArtistInfoPage.js
index 1b85680f..ac9209a7 100644
--- a/src/content/dependencies/generateArtistInfoPage.js
+++ b/src/content/dependencies/generateArtistInfoPage.js
@@ -163,11 +163,8 @@ export default {
               language.$('releaseInfo.visitOn', {
                 links:
                   language.formatDisjunctionList(
-                    sec.visit.externalLinks.map(link =>
-                      link.slots({
-                        context: 'artist',
-                        style: 'platform',
-                      }))),
+                    sec.visit.externalLinks
+                      .map(link => link.slot('context', 'artist'))),
               })),
 
           sec.artworks?.artistGalleryLink &&
diff --git a/src/content/dependencies/generateGroupInfoPage.js b/src/content/dependencies/generateGroupInfoPage.js
index 5cae730b..2e1d1688 100644
--- a/src/content/dependencies/generateGroupInfoPage.js
+++ b/src/content/dependencies/generateGroupInfoPage.js
@@ -137,10 +137,7 @@ export default {
                 links:
                   language.formatDisjunctionList(
                     sec.info.visitLinks
-                      .map(link => link.slots({
-                        context: 'group',
-                        style: 'platform',
-                      }))),
+                      .map(link => link.slot('context', 'group'))),
               })),
 
           html.tag('blockquote',
diff --git a/src/content/dependencies/linkExternal.js b/src/content/dependencies/linkExternal.js
index ba2dbf21..282fb76c 100644
--- a/src/content/dependencies/linkExternal.js
+++ b/src/content/dependencies/linkExternal.js
@@ -11,7 +11,7 @@ export default {
       // differentiate between a function that returns a validator (the usual
       // syntax) and a function that is itself a validator.
       validate: () => isExternalLinkStyle,
-      default: 'normal',
+      default: 'platform',
     },
 
     context: {
diff --git a/src/content/dependencies/linkExternalAsIcon.js b/src/content/dependencies/linkExternalAsIcon.js
index 3eb355a9..c363ad90 100644
--- a/src/content/dependencies/linkExternalAsIcon.js
+++ b/src/content/dependencies/linkExternalAsIcon.js
@@ -21,8 +21,8 @@ export default {
     const format = style =>
       language.formatExternalLink(data.url, {style, context: slots.context});
 
-    const normalText = format('normal');
-    const compactText = format('compact');
+    const platformText = format('platform');
+    const handleText = format('handle');
     const iconId = format('icon-id');
 
     return html.tag('a', {class: 'icon'},
@@ -34,7 +34,7 @@ export default {
       [
         html.tag('svg', [
           !slots.withText &&
-            html.tag('title', normalText),
+            html.tag('title', platformText),
 
           html.tag('use', {
             href: to('shared.staticIcon', iconId),
@@ -43,7 +43,7 @@ export default {
 
         slots.withText &&
           html.tag('span', {class: 'icon-text'},
-            compactText ?? normalText),
+            handleText ?? platformText),
       ]);
   },
 };