« get me outta code hell

external-links: reddit + subreddits - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-08-23 16:06:57 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-08-23 16:06:57 -0300
commita8e8b65418f27701c4ad71fe9a17a704d245e906 (patch)
treec2c80a9d6a6aca1310e9e94b5326677cbd96cf50 /src
parent5ec7b32b7ddc2f66082892c7f0640aac02533a1f (diff)
external-links: reddit + subreddits preview
Diffstat (limited to 'src')
-rw-r--r--src/external-links.js11
-rw-r--r--src/strings-default.yaml5
2 files changed, 16 insertions, 0 deletions
diff --git a/src/external-links.js b/src/external-links.js
index ab1555bd..a4e16325 100644
--- a/src/external-links.js
+++ b/src/external-links.js
@@ -582,6 +582,17 @@ export const externalLinkSpec = [
   },
 
   {
+    match: {domains: ['reddit.com', 'old.reddit.com']},
+    platform: 'reddit',
+    icon: 'globe',
+
+    detail: {
+      substring: 'subreddit',
+      subreddit: {pathname: /^r\/[^\/]+(?=\/)?/},
+    },
+  },
+
+  {
     match: {domain: 'soundcloud.com'},
 
     platform: 'soundcloud',
diff --git a/src/strings-default.yaml b/src/strings-default.yaml
index fa884848..a8dbc28c 100644
--- a/src/strings-default.yaml
+++ b/src/strings-default.yaml
@@ -719,6 +719,11 @@ misc:
     nintendoMusic: "Nintendo Music"
     patreon: "Patreon"
     poetryFoundation: "Poetry Foundation"
+
+    reddit:
+      _: "Reddit"
+      subreddit: "Reddit ({SUBREDDIT})"
+
     soundcloud: "SoundCloud"
     spotify: "Spotify"
     steam: "Steam"