« get me outta code hell

data, content, html: FlashAct.nameHTML - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/linkFlashActInline.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-02-09 17:28:21 -0400
committer(quasar) nebula <qznebula@protonmail.com>2026-02-09 17:28:21 -0400
commit3c98e89daad1e312907c6f5f614b44b38f65408e (patch)
tree69dee2add4069c8331dae0880c266bee7b6313a6 /src/content/dependencies/linkFlashActInline.js
parentdf5ff85bdc2d56cbb8ef4d104dd7b82867ecca73 (diff)
data, content, html: FlashAct.nameHTML
Diffstat (limited to 'src/content/dependencies/linkFlashActInline.js')
-rw-r--r--src/content/dependencies/linkFlashActInline.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/content/dependencies/linkFlashActInline.js b/src/content/dependencies/linkFlashActInline.js
new file mode 100644
index 00000000..ba2a4883
--- /dev/null
+++ b/src/content/dependencies/linkFlashActInline.js
@@ -0,0 +1,24 @@
+// junk component which only exists because you can't
+// "extend" the slots of underlying linkThing.
+
+export default {
+  relations: (relation, flashAct) => ({
+    link:
+      relation('linkThing', 'localized.flashActGallery', flashAct),
+  }),
+
+  data: (flashAct) => ({
+    name:
+      flashAct.name,
+
+    nameHTML:
+      flashAct.nameHTML,
+  }),
+
+  generate: (data, relations, {html, language}) =>
+    relations.link.slot('content',
+      html.ifelse([
+        html.permit(data.nameHTML, {inline: true}),
+        language.sanitize(data.name),
+      ])),
+};