« get me outta code hell

Merge branch 'commentary-entries' into preview - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateCommentarySection.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-11-24 15:05:03 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-11-24 15:05:03 -0400
commiteab0e06d148b5445feab453b8042d5e93e1fa1a2 (patch)
tree62dab7600a89ca73cd1bffc19092c97fe4d58450 /src/content/dependencies/generateCommentarySection.js
parentca30b07b9e116f6d42d6ea6a2623e1500c289383 (diff)
parent9f58ba688c8a6ac3acf7b4bc435e2ccaed20b011 (diff)
Merge branch 'commentary-entries' into preview
Diffstat (limited to 'src/content/dependencies/generateCommentarySection.js')
-rw-r--r--src/content/dependencies/generateCommentarySection.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/content/dependencies/generateCommentarySection.js b/src/content/dependencies/generateCommentarySection.js
new file mode 100644
index 00000000..8ae1b2d0
--- /dev/null
+++ b/src/content/dependencies/generateCommentarySection.js
@@ -0,0 +1,29 @@
+export default {
+  contentDependencies: [
+    'transformContent',
+    'generateCommentaryEntry',
+    'generateContentHeading',
+  ],
+
+  extraDependencies: ['html', 'language'],
+
+  relations: (relation, entries) => ({
+    heading:
+      relation('generateContentHeading'),
+
+    entries:
+      entries.map(entry =>
+        relation('generateCommentaryEntry', entry)),
+  }),
+
+  generate: (relations, {html, language}) =>
+    html.tags([
+      relations.heading
+        .slots({
+          id: 'artist-commentary',
+          title: language.$('misc.artistCommentary')
+        }),
+
+      relations.entries,
+    ]),
+};