Introduce an "area" concept, so we aren't locked into a single layout under the "API" section of the docs site. - #3398
Conversation
|
Pull request environment is available at https://stoctodocspr3398.z22.web.core.windows.net. You can view the ephemeral environment status in Octopus Deploy. This environment will be automatically deprovisioned when the pull request is closed, or after 7 days of inactivity. |
There was a problem hiding this comment.
Drive-by review: I pointed Claude Code at this PR, so the findings below are an AI's rather than mine. I checked the line references and grepped the counts it cites, and left the rest unverified. Ignore whatever is wrong or not worth the effort.
The design reads well. Things it checked that could have broken quietly and didn't: all 106 pages under
src/pages/docs/apiuseApi.astroand noApi.astropage lives outside that path, so the layout→path switch moves no page today;areas.tshas no top-levelposts.all(), so it doesn't reopen the import-cycle trap thaturlsByFile()documents;ApiNavigationtolerates absent headings, soDefault.astrorendering it is safe.One caveat on all of it: nothing on the branch declares
area:yet (0 pages, and 0paged:pages), so the three correctness items are latent. They land on whichever page uses the escape hatch first.
EDIT: Ignore the Claude review, time for a human review, (i removed the comments)
enf0rc3
left a comment
There was a problem hiding this comment.
Looks good, i see the benefits of this for nav, really cleans it up
Area (which nav tree a page belongs to) was read off the page's layout, so a page could not be in the API area and laid out like a docs page. It now comes from the path the page is served from, with a frontmatter `area:` override, and the layouts render whichever nav their area names. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2c2f798 to
b37f2d3
Compare
Background
The docs site now has two distict sections; the main docs, and the api docs.
API docs have a different layout with different column sizing, and they also have their own specific navigation tree, which is tailored to the API, and does things like rendering icons next to GET/POST/PUT requests.
Previously, the layout dictated which area/navigation tree a page was put in. If a page wanted to be in the API tree, then it was forced to use the API's column structure. We want to mix in user-written pages along with the auto-generated ones, and forcing user-written pages to use the API column structure just looks bad.
Also, in future, we intend to have areas for "Learn" and "CLI", which would have their own nav trees
Results
This PR adds the formal concept of an
area. The area is now what dictates which navigation tree a page appears in, and we can use different layouts within any given area.docs/apifolder get the API area, everything else gets the Docs area.Note: The TopNav hasn't been touched. We should update it so when you click "API" it takes you to the API area's landing page, but that will come later