« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-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"