guide
Concepts
Nodes
In Routify, every file and folder is a node in a route tree. These nodes are primarily accessed for navigation, but can also be used to retrieve metadata from other pages / modules.
The navigation for this site is automatically generated by recursively iterating the nodes.
Getting the node of the current file
export let context
const { node } = context
Iterating the children of a node
{#each node.children as child}
<a href={child.path}> {child.name} </a>
{/each}
Resolving a node
It is also possible to resolve a different node than the current one.
import { resolveNode } from '@roxi/routify'
const node = resolveNode('../path/to/node')
Note
A module.svelte
file is merged into its respective (parent) folder node at buildtime.
For more info, please refer to advanced/nodes.