« get me outta code hell

Merge branch 'album-commentary-tweaks' into preview - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/linkExternal.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-11-24 15:22:49 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-11-24 15:22:49 -0400
commit1443cf743ee1f5967022d661b92caba6633de7aa (patch)
tree125e1db3aba3316fd798edb08dd1b6d47bfe6905 /src/content/dependencies/linkExternal.js
parent5931dde25d47695444419e9576dcdcc7d21d4a3f (diff)
parentce46282c4d6cadb3a90243b7e0aa452e2dfa90d3 (diff)
Merge branch 'album-commentary-tweaks' into preview
Diffstat (limited to 'src/content/dependencies/linkExternal.js')
-rw-r--r--src/content/dependencies/linkExternal.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/content/dependencies/linkExternal.js b/src/content/dependencies/linkExternal.js
index 0a079614..70e1ccff 100644
--- a/src/content/dependencies/linkExternal.js
+++ b/src/content/dependencies/linkExternal.js
@@ -18,11 +18,23 @@ export default {
       validate: () => isExternalLinkContext,
       default: 'generic',
     },
+
+    tab: {
+      validate: v => v.is('default', 'separate'),
+      default: 'default',
+    },
   },
 
   generate: (data, slots, {html, language}) =>
     html.tag('a',
-      {href: data.url, class: 'nowrap'},
+      {
+        href: data.url,
+        class: 'nowrap',
+        target:
+          (slots.tab === 'separate'
+            ? '_blank'
+            : null),
+      },
       language.formatExternalLink(data.url, {
         style: slots.style,
         context: slots.context,