Adding a page
There's no "new page" button β this is a file-backed wiki, not a database. Adding a page is two edits:
-
Write the data file. Create
content/docs/pages/<slug>.tsexporting aDocPage:import type { DocPage } from "../types"; export const mySlug: DocPage = { slug: ["my-slug"], title: "My Page", emoji: "π", summary: "One line for the search palette.", body: `# My Page\n\nMarkdown goes here.`, };slugis an array because pages can nest β["team", "onboarding"]renders at/team/onboarding. Most pages are one segment. -
Register it in
content/docs/index.ts: import it and add it to a section'spagesarray inDOCS_SECTIONS(or start a new section β sections are what the sidebar's collapsible groups render).
That's it. The sidebar, the breadcrumb, the βK search, and the page route
all read from DOCS_SECTIONS/DOCS_PAGE_BY_SLUG β there's nothing else to
wire up.
Body format
body is markdown, rendered by components/docs/DocsMarkdown.tsx
(react-markdown + remark-gfm, so tables and task lists work). It is not
sanitized against untrusted input β every page here is written by someone
with repo write access, the same trust boundary as the rest of the codebase.
Favorites and search
Favorites are per-browser, stored in localStorage (see
lib/docs/favorites.ts) β starring a page doesn't touch a file or a
database, and won't show up for anyone else. Search (βK) is a client-side
filter over every registered page's title and summary β nothing to index.
If this needs to stop being private
Right now /docs is noindexed and robots.txt-disallowed, but not
passphrase-gated β anyone with the URL can read it. If it starts holding
anything sensitive, the pattern to copy is bankGate() in middleware.ts:
a signed cookie, checked before the mount, redirecting to a login page with
?next= set to where the visitor was headed.