« get me outta code hell

content: transformContent: fix [[date]] not working - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-08-08 21:15:46 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-08-08 21:15:46 -0300
commitc1a2e63ba92e87002e5afaece21d5b11b07fd4f4 (patch)
treebdbb3e28fe9ea7746deb9f85fcfda3692a350266 /src/content
parent42a81b7172c856ad611431ef7d7b468d5b1ffbfd (diff)
content: transformContent: fix [[date]] not working
The implementation was basically all there, but replacerKey
and replacerValue weren't being extracted from the tag node
properly.
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/transformContent.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js
index 625b1374..ba66a02e 100644
--- a/src/content/dependencies/transformContent.js
+++ b/src/content/dependencies/transformContent.js
@@ -236,8 +236,16 @@ export default {
           }
 
           // This will be another {type: 'tag'} node which gets processed in
-          // generate.
-          return node;
+          // generate. Extract replacerKey and replacerValue now, since it'd
+          // be a pain to deal with later.
+          return {
+            ...node,
+            data: {
+              ...node.data,
+              replacerKey: node.data.replacerKey.data,
+              replacerValue: node.data.replacerValue[0].data,
+            },
+          };
         }),
     };
   },