github fuma-nama/fumadocs fumadocs@16.15.5

latest releases: fumadocs-openapi@11.4.0, @fumadocs/graphql@0.2.5
2 hours ago
  • @fumadocs/base-ui@16.15.5
  • fumadocs-core@16.15.5
  • fumadocs-ui@16.15.5

Root types: version your docs with root: "<type>"

root in meta.json now accepts a string, the type of root folder. Root folders of the same type under the same parent are interchangeable, which is how you keep multiple versions of the same docs in one site:

{
  "title": "1.0.0",
  "root": "version"
}
{
  "title": "2.0.0",
  "root": "version"
}

The sidebar only shows the opened version, and docs layouts render a dropdown to switch between them. Switching keeps your place: it navigates to the same page in the other version (/docs/v1/guide to /docs/v2/guide), or its index page when the page doesn't exist there.

root: true is simply the default type, displayed as tabs. See Versioning for the guide and Root Type for the reference.

Tabs are grouped by root folder

Layout tabs are now grouped by the root folders on the current page's path, with one dropdown per group. This changes a few behaviours of the existing root: true tabs:

  • Clicking a tab navigates to the same page in the target folder when it exists, otherwise its index page as before.
  • With nested root folders, each level gets its own dropdown instead of one flat list. Tab lists (tabMode: 'top' on Docs layout, tabMode: 'navbar' on Notebook layout) show the innermost root: true group, and are hidden on pages outside of any root folder.
  • getLayoutTabs() includes typed root folders too, so a custom transform also decorates them. Custom tabs entries bound to a page tree folder are grouped the same way, other entries are appended to the root: true dropdown.
  • tabs={false} disables the dropdowns of typed root folders as well.

findProjection() in fumadocs-core/page-tree

Find the structural projection of a page in another root folder, the page at the same file path relative to the root folder:

import { findProjection } from 'fumadocs-core/page-tree';

findProjection(v1, v2, page)?.url;

Don't miss a new fumadocs release

NewReleases is sending notifications on new releases.