🚨 Disclaimer: Routify 3 is currently in Release Candidate stage.

Please be aware that while the documentation is comprehensive, it may contain inaccuracies or errors. The codebase is also subject to changes that could affect functionality. We appreciate your understanding and welcome any feedback or contributions.

api

Metadata

Metadata represents page and module specific data that is available at runtime regardless of whether the page or module has been loaded.

It can be used for custom fields such as

Inline

Metadata can be added to a page or module by adding a HTML comment:

<!-- routify:meta order=4 -->

External

Metadata can be stored in external files by creating an identically named file with a .meta.js extension. This allows you to execute your own logic at build time.

/**
 * @param {MetaContext} context
 */
export default async (ctx) => {    
    return {
        order: 4,
    }
}

Meta options

  • recursive: Controls the scope of decorators. When set to false, a decorator will only be applied to the immediate children and not nested routes.
  • bundle: Bundle the content of the folder into a single file. Can be used recursively for sub bundles.
  • reset: Removes the component chain inheritance, rendering only the current route and its children. For example, in a foo > bar > baz > boo chain, if baz has a reset, only baz > boo will be rendered.
  • order: The ranking of the page when using node.children
  • title: Available at node.title. If not specified the filename is used.
  • inline: Mark a page as inline.
  • isDefault: If an index file isn’t present, you can mark an alternative file as the default, eg. dashboard.svelte.
  • history: Manages navigation history for the specific route, enabling or disabling the ability to track previous states.
  • captureStart: Capture part of a file. Eg. captureStart="intro" on line 4 and captureEnd="intro" on line 10 would capture line 5-9 and store it meta.captures.intro.
  • noRoute: Mark a component as a non route. This means the component doesn’t have a corresponding path.