« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-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',