Pick up markdown at the root of a docs source - #383
Merged
Conversation
|
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A `.md` file directly in a `docs()` source (or in `app/templates` / `src/templates`) was gathered, warned about, and then dropped: only files inside a folder became pages. Now a root-level file is a page of the group itself, sitting in the nav next to the folders. - `build()` places a page with no folder segments at the root of the tree - a root-level page's `groupName` is empty: there is no folder to name it after, and the source's display name isn't known at that layer - `gather()` no longer skips root-level markdown or root-level nav-only link entries (a json with an `href`); a root `meta.json` is still the source's own config, not a page The three test apps already had an (empty, silently skipped) `docs/top.md`. It now has content and is a real page, which makes it each group's first page, so the index-redirect and all-links expectations move with it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
NullVoxPopuli
force-pushed
the
nvp/allow-top-level-docs-in-a-group
branch
from
August 19, 2026 15:46
4181a99 to
24668c0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
.mdfile sitting directly in adocs()source was silently dropped. Only markdown inside a folder became a page. Now a root-level file is a page of the group itself, in the nav next to the folders.Same for the co-located pages:
src/templates/welcome.mdis served at/welcome.md.What changed
src/build/plugins/markdown-pages/parse.js:build()puts a page with no folder segments at the root of the tree, instead ofconsole.warn+continuegather()no longer skips root-level markdown, or a root-level nav-only link entry (a json with anhrefand no page of its own). A rootmeta.jsonis still the source's own config, not a page./no longer turns into a folder named.A root-level page's
groupNameis''. There is no folder to name it after, and the source's display name lives in thedocs()config, a layer abovebuild(). Documented onPageinsrc/types.ts. Nothing reads it for layout: search entries get the group's display name fromsetup.js, anddocsManagerderives a page's group from its path.Consequences worth knowing
meta.jsonorderalongside the folder names. A source that already has anorderand a stray root-levelREADME.mdwill now fail the build until that file is listed (or moved out of the source).index.mdbecomes the group's first page and, like a folder'sindex.md, gets no separate<PageNav />link. The group's own<GroupNav />link points at it.Tests
parse.build.test.ts: root-level page, mixed with folders,.gjs.md, per-page config, leading./, and the name-collides-with-a-folder errorparse.rootPages.test.ts(new): throughparse()andsortTree(), so it covers gathering, sorting, a rootmeta.jsonorderthat includes a root-level page, a root-levelhreflink entry, andapp/src/templatespathsdocs/top.mdnow have content in it, so it is a real page and (by the existing sort rules) each group's first page. The index-redirect and all-links expectations move with it.docs-appbuildsDocs: a "Pages at the root of a source" section in
docs()configuration, and a note in Ordering.🤖 Generated with Claude Code