« get me outta code hell

content: generateGroupSecondaryNav - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/linkGroupDynamically.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-10-07 09:17:30 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-10-07 09:17:59 -0300
commit388b3d381833edc40bbcabee0611b96a3e8f2879 (patch)
tree4f3bc91aecd289a1935f68bf0ccc32ce22bcafe6 /src/content/dependencies/linkGroupDynamically.js
parent7cca97b865b7d9e299a7e1e6be9947a0fc0fb9c4 (diff)
content: generateGroupSecondaryNav
Diffstat (limited to 'src/content/dependencies/linkGroupDynamically.js')
-rw-r--r--src/content/dependencies/linkGroupDynamically.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/content/dependencies/linkGroupDynamically.js b/src/content/dependencies/linkGroupDynamically.js
new file mode 100644
index 00000000..90303ed1
--- /dev/null
+++ b/src/content/dependencies/linkGroupDynamically.js
@@ -0,0 +1,14 @@
+export default {
+  contentDependencies: ['linkGroupGallery', 'linkGroup'],
+  extraDependencies: ['pagePath'],
+
+  relations: (relation, group) => ({
+    galleryLink: relation('linkGroupGallery', group),
+    infoLink: relation('linkGroup', group),
+  }),
+
+  generate: (relations, {pagePath}) =>
+    (pagePath[0] === 'groupGallery'
+      ? relations.galleryLink
+      : relations.infoLink),
+};