Astro for Documentation Sites: Starlight, Structure, and When Docs Deserve Their Own Site
18 November 2026 · Updated 28 November 2026 · 12 min read · by Yang Kai
Build documentation with Astro and Starlight: what Starlight includes, its honest limits in 2026, how to structure docs readers can navigate, and when docs deserve their own site.
Checklist inside: Docs Site Starter Checklist (Astro + Starlight)
Contents
- What Starlight is, and what it includes
- The honest limits, checked November 2026
- How far you can bend the design
- Starlight versus rolling your own docs
- Structuring docs people can navigate
- Search, versions, and the details that separate real docs
- When docs deserve their own site
- The docs site starter checklist
- How we researched this
- What to do next
A documentation site built from scratch spends its first month on plumbing: sidebar, search, code blocks, dark mode, a table of contents. None of that is your documentation. It is the furniture documentation sits in, and building it yourself means the writing starts a month late.
The fast route in the Astro ecosystem is Starlight, the Astro team’s own documentation theme. It hands you the furniture on day one so the budget goes to the writing. This guide covers what Starlight actually includes as of late 2026, where its limits are, how to structure docs once you have it, and the separate question the title promises: when documentation should live on its own site at all. Starlight’s facts below come from its official documentation, checked in November 2026.
The short version: use Starlight unless your docs are mostly generated API reference, your design cannot bend to a theme, or your product’s docs are really an interactive app. Those exceptions are covered below — everything else should start from Starlight.
What Starlight is, and what it includes
Starlight is a documentation theme and component set built on Astro by the Astro team, installed as an Astro integration (npx astro add starlight, or start from its template). Your pages are Markdown or MDX files in src/content/docs/, and Starlight wraps them in the complete docs reading experience:
- Sidebar navigation — defined explicitly in your Astro config, generated from a folder with
autogenerate, or mixed: hand-ordered for the learning path, generated for reference sections. Pages can set their own order and labels, or hide themselves, from frontmatter. - Full-text search — powered by Pagefind, which indexes the built HTML and runs entirely in the reader’s browser. No search service, no API key, no per-query cost. A hosted alternative exists as an official plugin if a project qualifies for Algolia DocSearch.
- The reading furniture — a per-page table of contents, previous/next links in sidebar order, light and dark themes with an automatic mode that follows the reader’s system, and syntax-highlighted code blocks with copy buttons and diff markers via Expressive Code.
- Docs components — asides (note, tip, caution, danger), tabs, steps, file trees and cards, written as short directives or components in your Markdown instead of hand-built HTML.
- Internationalisation — one content tree per language, untranslated pages falling back to the default language with a notice to the reader, right-to-left script support, and the interface labels translated into dozens of languages.
- Checked frontmatter — pages are a content collection with a schema (
docsSchema(), extendable with your own fields), so a page missing its title or description fails the build instead of shipping incomplete. The mechanics are the same ones in schemas and validation in content collections. - Edit links and freshness dates — an “edit this page” link back to your repository on every page, and an optional last-updated date, both set once in config.
That list is the argument: each item is a small project on its own, and Starlight is free and open source. Astro’s own documentation runs on it, which is also why its edge cases get found by someone other than you.
The honest limits, checked November 2026
Starlight is the right default, not a finished platform. Three limits belong in the decision:
It is still 0.x software. Starlight sits in the 0.42 line as of late 2026, and its own getting-started guide describes it as beta. Releases are frequent, and a minor version can require migration steps — the 0.41 release, for example, dropped the previous Astro major, and 0.42 requires a current Astro 7. Budget a small, regular upgrade habit rather than treating the docs site as set-and-forget. The configuration surface itself is stable and documented in the Starlight configuration reference; it is the upgrade cadence that asks for attention.
Search only exists after a build. The Pagefind index is generated during astro build, so search does nothing on the dev server. Writers checking search behaviour need a production build and preview — a small workflow surprise worth knowing before your team reports search as broken.
There is no built-in versioning. Starlight has no feature for serving v1 and v2 docs side by side with a version switcher. Teams that need it assemble it from folders and sidebar config, or run separate sites per version. The versioning section below covers why postponing that need is usually right anyway.
How far you can bend the design
A reasonable fear with any theme is outgrowing its look. Starlight’s customisation comes in layers, and most projects only need the first two:
- CSS custom properties control colours, fonts and spacing. A stylesheet registered through Starlight’s
customCssoption rebrands a site — accent colour, type, dark-mode tones — without touching a component. - Tailwind CSS v4 is supported for teams whose design system already lives there.
- Component overrides replace individual pieces of the interface — the header, the search box, the footer, the theme switcher — with your own Astro components, while the rest of the theme stays maintained and upgradeable.
The practical line: if your brand work is colours, type and a logo, Starlight bends easily. If your design requires a different page anatomy — no sidebar, a marketing-style hero on every page — you are no longer customising a docs theme, and the custom build in the next section is the honest route.
Starlight versus rolling your own docs
Choose Starlight when your docs are primarily prose with code samples, your team is small, and conventional navigation is a virtue. Readers arriving from other products’ docs will feel at home instantly, because the layout conventions — sidebar left, contents right, search on top — are the ones the industry settled on.
Choose a custom Astro build when the “docs” are really a hybrid: heavy interactive demos on most pages, an API reference generated from an OpenAPI specification as the main event rather than a section, or branding strict enough that you would spend longer fighting a theme than building fresh. That build-versus-theme judgement is the same one in choosing an Astro theme generally: start from the option that is 80% right, and verify the missing 20% is small.
Winner for most projects: Starlight. The custom build’s advantages only appear in cases Starlight was never aimed at.
A middle path exists and is underused: Starlight for the documentation section of a larger Astro site, with marketing pages built separately. Many product sites keep /docs/ on Starlight while the rest of the site uses a bespoke design, because the two audiences arrive with different intent and never compare the furniture.
Structuring docs people can navigate
Starlight gives you a sidebar; it does not give you an information architecture. The structure that works:
- A getting-started path that takes a new user from nothing to one working result, in order, with no branching. Every docs site lives or dies by this path. Write it first, and define its sidebar entries by hand so the order is the learning order.
- Guides organised by task, titled by what the reader wants to do (“Deploying to production”), not by what the software calls the feature.
- Reference material separated — configuration options, API surfaces, CLI flags — complete and scannable rather than narrative. This is the section to autogenerate in the sidebar; completeness matters more than curation here.
- One topic per page, titled as a reader would search for it. Docs pages are search-engine landing pages whether you planned it or not, so the discipline in honest SEO for Astro sites applies with extra force: unique titles, real descriptions, and internal links written into the prose where a reader mid-task needs the next step.
Write the sidebar order as the learning order. If a reader must already understand page nine to read page three, the order is wrong, not the reader.
File names deserve the same care, because in Starlight the file path is the URL: src/content/docs/guides/install.md answers at /guides/install/. Name files the way readers search — install, deploying-to-production, api-keys — and the URLs, the sidebar and the search results all inherit the clarity. A healthy small docs tree looks like this:
src/content/docs/
├── index.mdx → the docs home page
├── start/
│ ├── install.md
│ ├── first-project.md
│ └── deploy.md
├── guides/
│ ├── authentication.md
│ └── webhooks.md
└── reference/
├── configuration.md
└── cli.md
Three folders, three jobs: the path a beginner walks, the tasks a user returns for, and the facts a reader looks up. Most documentation problems are visible in this tree before a single page is written — a misc/ folder, forty files at the root, or guides and reference mixed together are all structure asking to be fixed first.
Search, versions, and the details that separate real docs
Search is non-negotiable beyond a handful of pages. Starlight’s built-in Pagefind covers it for static sites, and because it indexes the built HTML it works on a plain Cloudflare Pages deployment with no extra services. Test it with the queries readers actually type, including the synonym your product does not use — that test is in the checklist below because it fails more often than any other.
Versioning is the detail to postpone deliberately. Maintain one current docs set until you genuinely support two released versions at once, because half-maintained versioned docs are worse than none: readers land on the wrong version, follow instructions for software they do not have, and blame the product. When the day comes, the folder-per-version workaround or separate sites both work; neither needs deciding today.
Code samples must be runnable or clearly marked as fragments. A reader who copies your example and hits an error trusts nothing else on the page — and unlike a blog reader, a docs reader was mid-task and now has two problems.
Edit-this-page links quietly convert your best readers into contributors. A reader who spots a wrong flag at 11pm will fix it if the link is there, and file nothing if it is not.
When docs deserve their own site
The default is a section of the main site (/docs/), and it is right for most projects: one domain, one deploy, shared navigation, and the SEO weight of the docs accrues to the domain that sells the product. Give docs their own site — usually a subdomain such as docs.example.com — when one of these becomes true:
- A different release cadence. The docs deploy many times a day from the product repository while the marketing site changes monthly, and tying their deploys together has started causing incidents or delays.
- A genuinely separate audience. Developer documentation for an API product whose buyers never see it, or docs for an open-source project that has outgrown the company site it started on.
- Versioning for real. Two supported versions with separate docs trees, where a section of a shared site has become a maze of folders and redirects.
- Different ownership. Another team, or a community, maintains the docs and needs its own repository and review process.
Notice what is not on the list: “the docs got big.” Size alone is a structure problem, solved by the sidebar and search you already have. A separate site is an operational decision, not a growth milestone — and splitting early costs you the shared domain authority and the reader’s single, predictable address.
The docs site starter checklist
- Starlight installed via the Astro integration, building clean on the default template before customisation
- Getting-started path written first: install → configure → first success, tested by following it literally
- Sidebar defined explicitly for the learning path, autogenerated only for reference sections
- Collection schema checked: every docs page has a real title and description enforced at build time
- Search tested on a production build with three queries a real user would type, including one synonym
- Code samples verified: each full example run or explicitly labelled a fragment
- Components used sparingly: callouts for genuine warnings, tabs only where alternatives truly branch
- Edit links and feedback route: readers can reach the repo or an issue form from any page
- Hosting set: static deployment with the production build checked — search index included in output
- Upgrade habit scheduled: Starlight and Astro versions reviewed on a cadence, not discovered broken
- Analytics or a feedback habit: some way to learn which pages readers bounce from, reviewed monthly
How we researched this
Starlight’s feature list, limits and configuration options above are taken from its official documentation at starlight.astro.build, checked in November 2026 against the 0.42 release line. The structure and site-splitting advice is the guide’s own judgement, written for publishers rather than framework maintainers — it is not based on operating a Starlight site for this article, and the places where a claim is a recommendation rather than a documented fact are phrased as one.
FAQ
Is Starlight free? Yes — Starlight is open source and free to use, like Astro itself. Your costs are hosting (often a free static tier) and your writing time.
Can Starlight handle API reference documentation? It handles prose API guides well. For reference generated directly from an OpenAPI specification, people often pair Starlight pages with a dedicated API-reference tool or a custom section, rather than forcing one tool to do both jobs.
Does Starlight support multiple versions of my docs? Not as a built-in feature. The common approaches are a folder per version with sidebar config to match, or a separate site per version. Most projects are better served by one current docs set until two versions are genuinely supported at once.
Should my docs live in the same repository as my product? Keeping docs in the product repo makes it easier to update docs in the same change as the feature, which is the single best predictor of docs staying accurate. Starlight works fine as a section of a larger Astro site or as its own site fed by that repo.
How is a docs site different from a blog in Astro? Navigation and intent. Blogs are chronological and browsed; docs are hierarchical and searched. Technically both are content collections — the difference is structure, sidebar, and search, which is what Starlight adds.
What to do next
Scaffold Starlight, write only the getting-started path, and test it by following your own instructions on a clean machine or a fresh terminal. That single test finds more problems than any design review. If your product also needs a marketing site, the themes in the directory pair naturally with a Starlight docs section, and the broader case for Astro on content-led sites explains why the same stack serves both halves comfortably. Deployment specifics are in deploying Astro on Cloudflare Pages.
Category: Astro Themes & Starters · Tags: #astro #checklist #starters #tutorial
Next step: this article is part of Astro guides, which covers the full topic from first setup to advanced use.