Path params at runtime
- Refactored path params: each file of a dynamic path compiles once, and its content reads the params as
propswhen rendering. - Refactored
remarkShow: conditions are checked when rendering, and thedefineoption andshowElementexport are removed. - The table of contents, structured data and processed Markdown of a page only include the
<show>branches that show for its props, and give the values of its expressions. - Headings with expressions get their IDs from the rendered text, and duplicate IDs only count the headings that show.
- Added the
propsoption ofgetPage(): the content and outputs of the page follow these props, with its path params. - Processed Markdown and search records resolve JSX elements like the page, with the components that it imports or declares and the MDX components of its props.
- Search records of Fumadocs MDX keep the elements of every component by default, set
filterElementofremarkStructureto choose them. - Deprecated the
componentsoption ofgetText(), pass MDX components as page props. - Added
unstable_runtimeOutputsin file data for custom content sources: the plugins export the outputs of a page as functions of its props. Without it, a document with<show>fails to compile. - Added
rehypeHeading, which gives headings their IDs from code. Fumadocs MDX,@fumadocs/astroand local Markdown enable it. - Added
slugImportSourceofremarkHeading: a module that slugs heading IDs from the rendered text, for a customslug. - The client loader of Fumadocs MDX takes the params of a page:
preload(path, params),getComponent(path, params)anduseContent(path, props, params). - Table of contents titles resolve MDX components from the page props.
- Loading a page of an async collection or of
@fumadocs/astrono longer renders its structured data:structuredDataof the loaded page is read without rendering,structuredData()renders it. - Added the
searchtarget ofrenderToMarkdown(), which renders search records:asMarkdown()returns the target, so a component can give agents more than search indexes. - Added the
markdownnamespace ofreplaceSource(), for edits of processed Markdown only. - Search records no longer include the imports of included files.
- The frontmatter in code of Fumadocs MDX can use imports declared after it, and keeps the other variables declared in its statement.
@fumadocs/astrosupports frontmatter in code and meta files in code, likemeta.ts.- Async pages of Fumadocs MDX load their content once, and render without suspending again once loaded.
Clean template source imports
- Starter templates no longer trigger unused-import lint warnings.