Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Folder metadata

Reference for folder labels, ordering, icons, and metadata modules.

A metadata module describes its containing content folder. Add meta.ts, meta.js, or meta.mjs beside its pages. A module at the content root describes root children. See Navigation for a walkthrough.

import { defineMeta } from "brandtree";

export default defineMeta({
  title: "Logo system",
  order: 3,
  icon: "ph:shapes",
  pages: ["index", "logotype", "brandmark", "usage-rules"],
});

Fields

PropType
title?string

Sidebar group label. Defaults to the humanized folder name.

Typestring
order?number

Rank among siblings. Overrides the numeric folder prefix.

Typenumber
icon?string

Group icon name, such as ph:shapes.

Typestring
collapsed?boolean

Retained in the navigation model. The built-in sidebar currently displays groups expanded and does not apply this setting.

Typeboolean
pages?string[]

Ordered child source keys. Each listed child's zero-based array position becomes its rank. Unlisted children retain their existing rank; this does not filter pages.

Typestring[]

Child keys and ordering

The child key is the source filename or folder name without its extension and numeric prefix. It is independent of the page’s title, sidebar label, and frontmatter slug. Parenthesized group folders use their label as the key.

For a complete explicit order, list every child and put index first. Unlisted items retain their original numeric rank or their unranked position, so they can interleave with listed items. Equal ranks sort by display label.

Module exports

Export a plain object, or use defineMeta for editor type checking. Synchronous and asynchronous factories returning the same object are also accepted:

import { defineMeta } from "brandtree";

export default defineMeta(() => ({
  title: "Logo system",
  pages: ["index", "logotype", "brandmark"],
}));

Shared and translated metadata

meta.$.ts, meta.$.js, and meta.$.mjs provide shared values across locales. A locale-specific metadata module overrides shared fields; omitted fields keep their shared values. In a directory-based site, use shared metadata for common ordering rather than assuming root-language metadata applies to every locale. See Localization for an example.

Was this page helpful?