From 2f5383136c4d8232204546dcd89f8cd0b02347e4 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 25 Feb 2026 19:06:14 -0400 Subject: content: transformContent: custom/override link colors memes --- src/content/dependencies/transformContent.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/content/dependencies/transformContent.js') diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js index 8e902647..fa7f2e88 100644 --- a/src/content/dependencies/transformContent.js +++ b/src/content/dependencies/transformContent.js @@ -168,6 +168,7 @@ export default { // const enteredLabel = node.data.label && transformNode(node.data.label, opts); const enteredLabel = node.data.label?.data; const enteredHash = node.data.hash?.data; + const enteredColor = getArg(node, 'color')?.[0].data; data.label = enteredLabel ?? @@ -183,6 +184,7 @@ export default { : null); data.hash = enteredHash ?? null; + data.color = enteredColor ?? null; return {i: node.i, iEnd: node.iEnd, type: 'internal-link', data}; } @@ -248,6 +250,7 @@ export default { link: relation(name, arg), label: node.data.label, hash: node.data.hash, + color: node.data.color, name: arg?.name, shortName: arg?.shortName ?? arg?.nameShort, } @@ -605,7 +608,7 @@ export default { nodeFromRelations.link, {slots: ['content', 'hash']}); - const {label, hash, shortName, name} = nodeFromRelations; + const {label, hash, color, shortName, name} = nodeFromRelations; if (slots.textOnly) { if (label) { @@ -662,6 +665,10 @@ export default { absorbFollowingPunctuation(link); } + if (color) { + link.setSlot('color', color); + } + return {type: 'processed-internal-link', data: link}; } -- cgit 1.3.0-6-gf8a5