src/data/config/menu.json. The file exports two menu arrays — main (used by the header navigation) and footer (used by the footer navigation) — each containing an ordered list of link objects. Reorder, add, or remove items here and the change propagates to every page automatically.
menu.json structure
The file is a single JSON object with two top-level arrays:src/data/config/menu.json
main array drives the header navigation bar. The footer array drives the link row in the global footer. Both arrays are independent — you can include different items, in a different order, in each one.
Menu item fields
Each object in a menu array accepts the following fields:string
required
A unique identifier for the menu item. Used internally by OlonJS to key list renders and resolve references. Use a short, kebab-cased string without spaces.
string
required
The display text rendered in the navigation. Keep labels short — one or two words work best in horizontal header nav.
string
required
The destination URL for the link. Use a root-relative path (e.g.
/about) for internal pages, or a full absolute URL (e.g. https://github.com/your-org) for external links.boolean
default:"false"
When
true, the header renders this item as a primary CTA button instead of a plain text link. Use it for your most important conversion action — typically a “Sign up”, “Get started”, or “Contact” link.Referencing menus in site.json
The header and footer blocks insrc/data/config/site.json reference menus using the JSON Reference ($ref) pattern:
$ref value is a relative file path followed by a JSON Pointer fragment (#/main or #/footer). At build time, OlonJS resolves the reference and inlines the matching array. This means you maintain menu data in one place — menu.json — and both site.json and any section that references a menu stay in sync automatically.
Adding a menu item
To add a new item to the header navigation, append an object to themain array. The example below adds a Newsletter link between “About” and “Contact”:
.png?fit=max&auto=format&n=AyzhRn9-CO-nDNc4&q=85&s=63c78e2325701880237e6cbce1399c2a)
.png?fit=max&auto=format&n=AyzhRn9-CO-nDNc4&q=85&s=0db283df6e4d31745079d6d03fd029ed)