diff options
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 |
commit | 0ee5269cd196cd14f06aac6c586e7104159eac74 (patch) | |
tree | a5d91e53a3459f1b6ed68b79a8f82862c9761992 | |
parent | c5e02f9d314118a534fd0e942d87e74864674498 (diff) |
content: implement "local" links much more rudimentarily
-rw-r--r-- | src/content/dependencies/linkExternal.js | 22 | ||||
-rw-r--r-- | src/util/external-links.js | 8 |
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', |