Move navigation from _menu.json files in each navigation-parent directory to a naviga...
[ndcode_site.git] / _lib / get_navigation.jst
diff --git a/_lib/get_navigation.jst b/_lib/get_navigation.jst
new file mode 100644 (file)
index 0000000..17ec41b
--- /dev/null
@@ -0,0 +1,8 @@
+return async (root, component_names) => {
+  let p = await root.get('navigation')
+  for (let i = 0; i < component_names.length; ++i) {
+    let children = await p.get('children')
+    p = await children.get(component_names[i])
+  }
+  return p
+}