« 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/linkWikiHome.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/linkWikiHome.js')
-rw-r--r--src/content/dependencies/linkWikiHome.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/content/dependencies/linkWikiHome.js b/src/content/dependencies/linkWikiHome.js
new file mode 100644
index 00000000..06ec6438
--- /dev/null
+++ b/src/content/dependencies/linkWikiHome.js
@@ -0,0 +1,20 @@
+export default {
+  contentDependencies: ['linkStationaryIndex'],
+  extraDependencies: ['wikiData'],
+
+  sprawl({wikiInfo}) {
+    return {wikiShortName: wikiInfo.nameShort};
+  },
+
+  relations: (relation) =>
+    ({link: relation('linkTemplate')}),
+
+  data: (sprawl) =>
+    ({wikiShortName: sprawl.wikiShortName}),
+
+  generate: (data, relations) =>
+    relations.link.slots({
+      path: ['home'],
+      content: data.wikiShortName,
+    }),
+};