Commit 2d06a1d9 authored by NGPixel's avatar NGPixel

fix: set open external link in new tab as an option

parent fc79d924
...@@ -12,3 +12,9 @@ props: ...@@ -12,3 +12,9 @@ props:
title: Treat relative links as root absolute title: Treat relative links as root absolute
hint: For example, a link to foo/bar on page xyz will render as /foo/bar instead of /xyz/foo/bar. hint: For example, a link to foo/bar on page xyz will render as /foo/bar instead of /xyz/foo/bar.
order: 1 order: 1
openExternalLinkNewTab:
type: Boolean
default: false
title: Open external links in a new tab
hint: External links will have a _blank target attribute added automatically.
order: 2
...@@ -113,7 +113,9 @@ module.exports = { ...@@ -113,7 +113,9 @@ module.exports = {
} }
} else { } else {
$(elm).addClass(`is-external-link`) $(elm).addClass(`is-external-link`)
$(elm).attr('target', '_blank') if (this.config.openExternalLinkNewTab) {
$(elm).attr('target', '_blank')
}
} }
// -> Update element // -> Update element
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment