diff options
Diffstat (limited to 'src/content/dependencies')
-rw-r--r-- | src/content/dependencies/linkExternal.js | 9 | ||||
-rw-r--r-- | src/content/dependencies/transformContent.js | 5 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/content/dependencies/linkExternal.js b/src/content/dependencies/linkExternal.js index 39a593b2..f6b47db7 100644 --- a/src/content/dependencies/linkExternal.js +++ b/src/content/dependencies/linkExternal.js @@ -24,6 +24,11 @@ export default { default: 'generic', }, + fromContent: { + type: 'boolean', + default: false, + }, + indicateExternal: { type: 'boolean', default: false, @@ -93,6 +98,10 @@ export default { } } + if (slots.fromContent) { + linkAttributes.add('class', 'from-content'); + } + if (urlIsValid && slots.indicateExternal) { linkAttributes.add('class', 'indicate-external'); diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js index d409df8f..15c87019 100644 --- a/src/content/dependencies/transformContent.js +++ b/src/content/dependencies/transformContent.js @@ -347,7 +347,10 @@ export default { const {label} = node.data; const externalLink = relations.externalLinks[externalLinkIndex++]; - externalLink.setSlot('content', label); + externalLink.setSlots({ + content: label, + fromContent: true, + }); if (slots.indicateExternalLinks) { externalLink.setSlots({ |