« get me outta code hell

content: implement "local" links much more rudimentarily - 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-11-23 17:47:18 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-11-24 13:45:21 -0400
commit0ee5269cd196cd14f06aac6c586e7104159eac74 (patch)
treea5d91e53a3459f1b6ed68b79a8f82862c9761992 /src
parentc5e02f9d314118a534fd0e942d87e74864674498 (diff)
content: implement "local" links much more rudimentarily
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/linkExternal.js22
-rw-r--r--src/util/external-links.js8
2 files changed, 8 insertions, 22 deletions
diff --git a/src/content/dependencies/linkExternal.js b/src/content/dependencies/linkExternal.js
index 7f090084..1b81efcc 100644
--- a/src/content/dependencies/linkExternal.js
+++ b/src/content/dependencies/linkExternal.js
@@ -30,28 +30,6 @@ export default {
   },
 
     /*
-    let isLocal;
-    let domain;
-    let pathname;
-
-    try {
-      const url = new URL(data.url);
-      domain = url.hostname;
-      pathname = url.pathname;
-    } catch (error) {
-      // No support for relative local URLs yet, sorry! (I.e, local URLs must
-      // be absolute relative to the domain name in order to work.)
-      isLocal = true;
-      domain = null;
-      pathname = null;
-    }
-
-    // isLocal also applies for URLs which match the 'Canonical Base' under
-    // wiki-info.yaml, if present.
-    if (data.canonicalDomain && domain === data.canonicalDomain) {
-      isLocal = true;
-    }
-
     : domain.includes('youtu')
         ? slots.mode === 'album'
           ? data.url.includes('list=')
diff --git a/src/util/external-links.js b/src/util/external-links.js
index 2047a720..7a34fa9e 100644
--- a/src/util/external-links.js
+++ b/src/util/external-links.js
@@ -65,6 +65,14 @@ export const fallbackDescriptor = {
 // TODO: Define all this stuff in data as YAML!
 export const externalLinkSpec = [
   {
+    matchDomain: 'hsmusic.wiki',
+
+    string: 'local',
+
+    icon: 'globe',
+  },
+
+  {
     matchDomain: 'bandcamp.com',
 
     string: 'bandcamp',