« get me outta code hell

content: linkThing: anchor flag - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-06 20:15:56 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-06 20:15:56 -0300
commit05b7dc2f86b7b4e89b07cc54f53e851fe11e0e1a (patch)
treea5eb2df4b5061314b48391fdf2a1dd52d63b5da2 /src
parenta2413a5a08ded1fdf1b039bd992565827cda46ab (diff)
content: linkThing: anchor flag
This disables passing the path to the linked thing and
blanks the href, so that only the hash is passed through.
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/linkThing.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/content/dependencies/linkThing.js b/src/content/dependencies/linkThing.js
index 1e648ee6..4ccdf58d 100644
--- a/src/content/dependencies/linkThing.js
+++ b/src/content/dependencies/linkThing.js
@@ -45,6 +45,8 @@ export default {
           default: true,
         },
 
+        anchor: {type: 'boolean', default: false},
+
         attributes: relations.linkTemplate.getSlotDescription('attributes'),
         hash: relations.linkTemplate.getSlotDescription('hash'),
       },
@@ -77,7 +79,8 @@ export default {
 
         return relations.linkTemplate
           .slots({
-            path,
+            path: slots.anchor ? [] : path,
+            href: slots.anchor ? '' : null,
             content,
             color,
             tooltip,