From d0fda4429c4f71cbc308296acf86dec506f32b8b Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 29 Mar 2024 17:06:04 -0300 Subject: external-links: misc new descriptors & icons Just committing as we might mess with the format a bit and will treat these new entries as pre-existing. --- src/static/icons.svg | 36 +++++++++---- src/strings-default.yaml | 10 ++++ src/util/external-links.js | 131 +++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 161 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/static/icons.svg b/src/static/icons.svg index fa7bb264..8393ad80 100644 --- a/src/static/icons.svg +++ b/src/static/icons.svg @@ -1,13 +1,27 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/strings-default.yaml b/src/strings-default.yaml index de0cc962..44cff01a 100644 --- a/src/strings-default.yaml +++ b/src/strings-default.yaml @@ -506,12 +506,17 @@ misc: local: "Wiki Archive (local upload)" + appleMusic: "Apple Music" + artstation: "ArtStation" bandcamp: "Bandcamp" bgreco: _: "bgreco.net" flash: "bgreco.net (high quality audio)" + bluesky: "Bluesky" + carrd: "Carrd" + deconreconstruction: _: "Deconreconstruction" music: "MUSIC@DCRC" @@ -531,13 +536,18 @@ misc: secretPage: "Homestuck (secret page)" instagram: "Instagram" + itch: "itch.io" + kofi: "Ko-fi" mastodon: "Mastodon" + neocities: "Neocities" newgrounds: "Newgrounds" patreon: "Patreon" poetryFoundation: "Poetry Foundation" soundcloud: "SoundCloud" spotify: "Spotify" + tiktok: "TikTok" tumblr: "Tumblr" + twitch: "Twitch" twitter: "Twitter" wikipedia: "Wikipedia" diff --git a/src/util/external-links.js b/src/util/external-links.js index 846302af..4dc95921 100644 --- a/src/util/external-links.js +++ b/src/util/external-links.js @@ -246,6 +246,34 @@ export const externalLinkSpec = [ // Generic domains, sorted alphabetically (by string) + { + match: {domains: ['music.apple.com']}, + platform: 'appleMusic', + icon: 'globe', + }, + + { + match: {domains: ['artstation.com']}, + + platform: 'artstation', + + compact: 'handle', + icon: 'globe', + + handle: {pathname: /^[^/]*/}, + }, + + { + match: {domains: ['.artstation.com']}, + + platform: 'artstation', + + compact: 'handle', + icon: 'globe', + + handle: {domain: /^[^.]*/}, + }, + { match: {domains: ['bc.s3m.us', 'music.solatrus.com']}, @@ -267,6 +295,31 @@ export const externalLinkSpec = [ handle: {domain: /^[^.]*/}, }, + { + match: { + domain: 'bsky.app', + pathname: /^profile\/[^/]+\/?/, + }, + + platform: 'bluesky', + + compact: 'handle', + icon: 'bluesky', + + handle: {pathname: /^profile\/([^/]+?)(?:\.bsky\.social)?\/?$/}, + }, + + { + match: {domain: '.carrd.co'}, + + platform: 'carrd', + + compact: 'handle', + icon: 'carrd', + + handle: {domain: /^[^.]*/}, + }, + { match: {domain: 'music.deconreconstruction.com'}, platform: 'deconreconstruction.music', @@ -285,10 +338,49 @@ export const externalLinkSpec = [ icon: 'deviantart', }, + { + match: {domain: '.itch.io'}, + + platform: 'itch', + + compact: 'handle', + icon: 'itch', + + handle: {domain: /^[^.]*/}, + }, + + { + match: { + domain: 'itch.io', + pathname: /^profile\/.+\/?$/, + }, + + platform: 'itch', + + compact: 'handle', + icon: 'itch', + + handle: {pathname: /^profile\/(.+)\/?$/} + }, + + { + match: { + domain: 'ko-fi.com', + pathname: /^.+\/?/, + }, + + platform: 'kofi', + + compact: 'handle', + icon: 'kofi', + + handle: {pathname: /^(.+)\/?/}, + }, + { match: { domain: 'mspaintadventures.fandom.com', - pathname: /^wiki\/(.+)\/?$/, + pathname: /^wiki\/.+\/?$/, }, platform: 'fandom', @@ -341,6 +433,17 @@ export const externalLinkSpec = [ icon: 'instagram', }, + { + match: {domains: ['tiktok.com']}, + + platform: 'tiktok', + + compact: 'handle', + icon: 'tiktok', + + handle: {pathname: /^@?([a-zA-Z0-9_]*)\/?$/}, + }, + { match: {domains: ['types.pl']}, @@ -351,6 +454,16 @@ export const externalLinkSpec = [ icon: 'mastodon', }, + { + match: {domain: '.neocities.org'}, + + platform: 'neocities', + + normal: 'domain', + compact: 'domain', + icon: 'globe', + }, + { match: {domain: 'newgrounds.com'}, platform: 'newgrounds', @@ -397,6 +510,17 @@ export const externalLinkSpec = [ handle: {domain: /^[^.]*/}, }, + { + match: {domain: 'twitch.tv'}, + + platform: 'twitch', + + compact: 'handle', + icon: 'twitch', + + handle: {pathname: /^(.+)\/?/}, + }, + { match: {domain: 'twitter.com'}, @@ -405,10 +529,7 @@ export const externalLinkSpec = [ compact: 'handle', icon: 'twitter', - handle: { - prefix: '@', - pathname: /^@?([a-zA-Z0-9_]*)\/?$/, - }, + handle: {pathname: /^@?([a-zA-Z0-9_]*)\/?$/}, }, { -- cgit 1.3.0-6-gf8a5