« get me outta code hell

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:
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),
+      ])),
+};