« get me outta code hell

content: generateListingIndexList, generateListingSidebar - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateListingSidebar.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-07-01 17:27:10 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-07-01 17:27:10 -0300
commit467bad1a645d77fc8b421ef9aeb9bbea6d2465ea (patch)
treea12546049a1a1a889ecd45a9f4e0ae7d91389cbd /src/content/dependencies/generateListingSidebar.js
parent326ebe513e88d27c09e672ba24373fae41e0f1e1 (diff)
content: generateListingIndexList, generateListingSidebar
Diffstat (limited to 'src/content/dependencies/generateListingSidebar.js')
-rw-r--r--src/content/dependencies/generateListingSidebar.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/content/dependencies/generateListingSidebar.js b/src/content/dependencies/generateListingSidebar.js
new file mode 100644
index 0000000..fe2a08f
--- /dev/null
+++ b/src/content/dependencies/generateListingSidebar.js
@@ -0,0 +1,20 @@
+export default {
+  contentDependencies: ['generateListingIndexList', 'linkListingIndex'],
+  extraDependencies: ['html'],
+
+  relations(relation, currentListing) {
+    return {
+      listingIndexLink: relation('linkListingIndex'),
+      listingIndexList: relation('generateListingIndexList', currentListing),
+    };
+  },
+
+  generate(relations, {html}) {
+    return {
+      leftSidebarContent: [
+        html.tag('h1', relations.listingIndexLink),
+        relations.listingIndexList.slot('mode', 'sidebar'),
+      ],
+    };
+  },
+};