From 95f824c413e00dcc5042da6b59c8310c5980fd0c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 30 Mar 2024 10:12:53 -0300 Subject: external-links, test: flatten not-so-special artist descriptors --- src/util/external-links.js | 44 +++++++++------------- .../test/snapshot/linkExternal.js.test.cjs | 2 +- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/src/util/external-links.js b/src/util/external-links.js index edef0701..503512f3 100644 --- a/src/util/external-links.js +++ b/src/util/external-links.js @@ -152,32 +152,6 @@ export const externalLinkSpec = [ icon: 'youtube', }, - // Special handling for artist links - - { - match: { - domain: 'patreon.com', - context: 'artist', - }, - - platform: 'patreon', - handle: {pathname: /([^/]+)\/?$/}, - - icon: 'globe', - }, - - { - match: { - context: 'artist', - domain: 'youtube.com', - }, - - platform: 'youtube', - handle: {pathname: /^@([^/]+)\/?$/}, - - icon: 'youtube', - }, - // Special handling for flash links { @@ -436,6 +410,15 @@ export const externalLinkSpec = [ icon: 'newgrounds', }, + { + match: {domain: 'patreon.com'}, + + platform: 'patreon', + handle: {pathname: /([^/]+)\/?$/}, + + icon: 'globe', + }, + { match: {domain: 'patreon.com'}, platform: 'patreon', @@ -496,6 +479,15 @@ export const externalLinkSpec = [ icon: 'misc', }, + { + match: {domain: 'youtube.com'}, + + platform: 'youtube', + handle: {pathname: /^@([^/]+)\/?$/}, + + icon: 'youtube', + }, + { match: {domains: ['youtube.com', 'youtu.be']}, platform: 'youtube', diff --git a/tap-snapshots/test/snapshot/linkExternal.js.test.cjs b/tap-snapshots/test/snapshot/linkExternal.js.test.cjs index 754bed12..824bec7b 100644 --- a/tap-snapshots/test/snapshot/linkExternal.js.test.cjs +++ b/tap-snapshots/test/snapshot/linkExternal.js.test.cjs @@ -80,7 +80,7 @@ exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context Wikipedia Poetry Foundation Instagram -Patreon +CecilyRenns Spotify buzinkai music.solatrus.com -- cgit 1.3.0-6-gf8a5