From 2a2da579eea65cde8dc5ba52421ae0822c729eab Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 30 Mar 2024 13:08:27 -0300 Subject: external-links: Linktree --- src/static/icons.svg | 1 + src/strings-default.yaml | 1 + src/util/external-links.js | 9 +++++++++ tap-snapshots/test/snapshot/linkExternal.js.test.cjs | 2 ++ test/snapshot/linkExternal.js | 3 +++ 5 files changed, 16 insertions(+) diff --git a/src/static/icons.svg b/src/static/icons.svg index 0a80a917..3e90e6b0 100644 --- a/src/static/icons.svg +++ b/src/static/icons.svg @@ -14,6 +14,7 @@ + diff --git a/src/strings-default.yaml b/src/strings-default.yaml index 3c38f2f8..be747f8f 100644 --- a/src/strings-default.yaml +++ b/src/strings-default.yaml @@ -544,6 +544,7 @@ misc: internetArchive: "Internet Archive" itch: "itch.io" kofi: "Ko-fi" + linktree: "Linktree" mastodon: "Mastodon" neocities: "Neocities" newgrounds: "Newgrounds" diff --git a/src/util/external-links.js b/src/util/external-links.js index a76c1e95..5df4f7d1 100644 --- a/src/util/external-links.js +++ b/src/util/external-links.js @@ -442,6 +442,15 @@ export const externalLinkSpec = [ icon: 'kofi', }, + { + match: {domain: 'linktr.ee'}, + + platform: 'linktree', + handle: {pathname: /^([^/]+)\/?$/}, + + icon: 'linktree', + }, + { match: {domains: ['types.pl']}, diff --git a/tap-snapshots/test/snapshot/linkExternal.js.test.cjs b/tap-snapshots/test/snapshot/linkExternal.js.test.cjs index 16175861..c3365d11 100644 --- a/tap-snapshots/test/snapshot/linkExternal.js.test.cjs +++ b/tap-snapshots/test/snapshot/linkExternal.js.test.cjs @@ -107,6 +107,7 @@ exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context tuyoki bravelittletoreador gnaach +bbpanzu types.pl wodaro.neocities.org neomints.neocities.org @@ -177,6 +178,7 @@ exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context itch.io itch.io Ko-fi +Linktree Mastodon (types.pl) Neocities Neocities diff --git a/test/snapshot/linkExternal.js b/test/snapshot/linkExternal.js index a9ce7eb2..3d759ff1 100644 --- a/test/snapshot/linkExternal.js +++ b/test/snapshot/linkExternal.js @@ -115,6 +115,9 @@ testContentFunctions(t, 'linkExternal (snapshot)', async (t, evaluate) => { // platform: ko-fi 'https://ko-fi.com/gnaach', + // platform: linktree + 'https://linktr.ee/bbpanzu', + // platform: mastodon 'https://types.pl/', -- cgit 1.3.0-6-gf8a5