« get me outta code hell

external-links: HSMusic (replacing "local") - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-03-30 12:59:47 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-03-30 13:01:11 -0300
commitc58e21df768e52411c3c7b739b01eddf3ae7ef51 (patch)
tree581cafe6cec7cf00ab3604dfaa60816d0d7ab221
parentdcd5845b43b995ca41fb6b1711165d096a25b807 (diff)
external-links: HSMusic (replacing "local")
-rw-r--r--src/strings-default.yaml6
-rw-r--r--src/util/external-links.js23
-rw-r--r--tap-snapshots/test/snapshot/linkExternal.js.test.cjs8
-rw-r--r--test/snapshot/linkExternal.js10
4 files changed, 31 insertions, 16 deletions
diff --git a/src/strings-default.yaml b/src/strings-default.yaml
index 5f3b115c..3c38f2f8 100644
--- a/src/strings-default.yaml
+++ b/src/strings-default.yaml
@@ -504,8 +504,6 @@ misc:
     withHandle:
       "{PLATFORM} ({HANDLE})"
 
-    local: "Wiki Archive (local upload)"
-
     appleMusic: "Apple Music"
     artstation: "ArtStation"
     bandcamp: "Bandcamp"
@@ -538,6 +536,10 @@ misc:
       page: "Homestuck (page {PAGE})"
       secretPage: "Homestuck (secret page)"
 
+    hsmusic:
+      _: "HSMusic"
+      archive: "HSMusic (wiki archive)"
+
     instagram: "Instagram"
     internetArchive: "Internet Archive"
     itch: "itch.io"
diff --git a/src/util/external-links.js b/src/util/external-links.js
index da0889a3..b8b97849 100644
--- a/src/util/external-links.js
+++ b/src/util/external-links.js
@@ -377,6 +377,23 @@ export const externalLinkSpec = [
   },
 
   {
+    match: {
+      domain: 'hsmusic.wiki',
+      pathname: /^media\/misc\/archive/,
+    },
+
+    platform: 'hsmusic.archive',
+
+    icon: 'globe',
+  },
+
+  {
+    match: {domain: 'hsmusic.wiki'},
+    platform: 'hsmusic',
+    icon: 'globe',
+  },
+
+  {
     match: {domain: 'instagram.com'},
     platform: 'instagram',
     icon: 'instagram',
@@ -417,12 +434,6 @@ export const externalLinkSpec = [
   },
 
   {
-    match: {domain: 'hsmusic.wiki'},
-    platform: 'local',
-    icon: 'globe',
-  },
-
-  {
     match: {domains: ['types.pl']},
 
     platform: 'mastodon',
diff --git a/tap-snapshots/test/snapshot/linkExternal.js.test.cjs b/tap-snapshots/test/snapshot/linkExternal.js.test.cjs
index b09aff61..1d5cb425 100644
--- a/tap-snapshots/test/snapshot/linkExternal.js.test.cjs
+++ b/tap-snapshots/test/snapshot/linkExternal.js.test.cjs
@@ -98,14 +98,14 @@ exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context
 <a href="https://gamebanana.com/members/2028092" class="nowrap">GameBanana</a>
 <a href="https://gamebanana.com/mods/459476" class="nowrap">GameBanana</a>
 <a href="https://homestuck.com/" class="nowrap">Homestuck</a>
+<a href="https://hsmusic.wiki/media/misc/archive/Firefly%20Cloud%20Remix.mp3" class="nowrap">HSMusic (wiki archive)</a>
+<a href="https://hsmusic.wiki/feedback/" class="nowrap">HSMusic</a>
 <a href="https://archive.org/details/a-life-well-lived" class="nowrap">Internet Archive</a>
 <a href="https://archive.org/details/VastError_Volume1/11+Renaissance.mp3" class="nowrap">Internet Archive</a>
 <a href="https://www.instagram.com/levc_egm/" class="nowrap">Instagram</a>
 <a href="https://tuyoki.itch.io/" class="nowrap">tuyoki</a>
 <a href="https://itch.io/profile/bravelittletoreador" class="nowrap">bravelittletoreador</a>
 <a href="https://ko-fi.com/gnaach" class="nowrap">gnaach</a>
-<a href="https://hsmusic.wiki/feedback/" class="nowrap">Wiki Archive (local upload)</a>
-<a href="https://hsmusic.wiki/media/misc/archive/Firefly%20Cloud%20Remix.mp3" class="nowrap">Wiki Archive (local upload)</a>
 <a href="https://types.pl/" class="nowrap">types.pl</a>
 <a href="https://wodaro.neocities.org" class="nowrap">wodaro.neocities.org</a>
 <a href="https://neomints.neocities.org/" class="nowrap">neomints.neocities.org</a>
@@ -167,14 +167,14 @@ exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context
 <a href="https://gamebanana.com/members/2028092" class="nowrap">GameBanana</a>
 <a href="https://gamebanana.com/mods/459476" class="nowrap">GameBanana</a>
 <a href="https://homestuck.com/" class="nowrap">Homestuck</a>
+<a href="https://hsmusic.wiki/media/misc/archive/Firefly%20Cloud%20Remix.mp3" class="nowrap">HSMusic (wiki archive)</a>
+<a href="https://hsmusic.wiki/feedback/" class="nowrap">HSMusic</a>
 <a href="https://archive.org/details/a-life-well-lived" class="nowrap">Internet Archive</a>
 <a href="https://archive.org/details/VastError_Volume1/11+Renaissance.mp3" class="nowrap">Internet Archive</a>
 <a href="https://www.instagram.com/levc_egm/" class="nowrap">Instagram</a>
 <a href="https://tuyoki.itch.io/" class="nowrap">itch.io</a>
 <a href="https://itch.io/profile/bravelittletoreador" class="nowrap">itch.io</a>
 <a href="https://ko-fi.com/gnaach" class="nowrap">Ko-fi</a>
-<a href="https://hsmusic.wiki/feedback/" class="nowrap">Wiki Archive (local upload)</a>
-<a href="https://hsmusic.wiki/media/misc/archive/Firefly%20Cloud%20Remix.mp3" class="nowrap">Wiki Archive (local upload)</a>
 <a href="https://types.pl/" class="nowrap">Mastodon (types.pl)</a>
 <a href="https://wodaro.neocities.org" class="nowrap">Neocities</a>
 <a href="https://neomints.neocities.org/" class="nowrap">Neocities</a>
diff --git a/test/snapshot/linkExternal.js b/test/snapshot/linkExternal.js
index 18885d14..0b6a4753 100644
--- a/test/snapshot/linkExternal.js
+++ b/test/snapshot/linkExternal.js
@@ -94,6 +94,12 @@ testContentFunctions(t, 'linkExternal (snapshot)', async (t, evaluate) => {
     // platform: homestuck
     'https://homestuck.com/',
 
+    // platform: hsmusic.archive
+    'https://hsmusic.wiki/media/misc/archive/Firefly%20Cloud%20Remix.mp3',
+
+    // platform: hsmusic
+    'https://hsmusic.wiki/feedback/',
+
     // platform: internetArchive
     'https://archive.org/details/a-life-well-lived',
     'https://archive.org/details/VastError_Volume1/11+Renaissance.mp3',
@@ -108,10 +114,6 @@ testContentFunctions(t, 'linkExternal (snapshot)', async (t, evaluate) => {
     // platform: ko-fi
     'https://ko-fi.com/gnaach',
 
-    // platform: local
-    'https://hsmusic.wiki/feedback/',
-    'https://hsmusic.wiki/media/misc/archive/Firefly%20Cloud%20Remix.mp3',
-
     // platform: mastodon
     'https://types.pl/',