diff options
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 |
commit | 1443cf743ee1f5967022d661b92caba6633de7aa (patch) | |
tree | 125e1db3aba3316fd798edb08dd1b6d47bfe6905 /src/content/dependencies/linkExternal.js | |
parent | 5931dde25d47695444419e9576dcdcc7d21d4a3f (diff) | |
parent | ce46282c4d6cadb3a90243b7e0aa452e2dfa90d3 (diff) |
Merge branch 'album-commentary-tweaks' into preview
Diffstat (limited to 'src/content/dependencies/linkExternal.js')
-rw-r--r-- | src/content/dependencies/linkExternal.js | 14 |
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, |