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

pull/1528/head
NGPixel 5 years ago
parent fc79d92423
commit 2d06a1d9df

@ -12,3 +12,9 @@ props:
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.
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,8 +113,10 @@ module.exports = {
}
} else {
$(elm).addClass(`is-external-link`)
if (this.config.openExternalLinkNewTab) {
$(elm).attr('target', '_blank')
}
}
// -> Update element
$(elm).attr('href', href)

Loading…
Cancel
Save