This guide shows how a qwik-docs project is organized and what the different files do.
qwik-docs runs on Qwik and Qwik City. The project follows the same file and directory structure as other Qwik City apps. See Qwik City's directory structure documentation for more detail.
Files and directories
qwik-docs.config.ts— The qwik-docs configuration file. Declares content collections, sidebar, logo, and site options throughdefineConfig. In Astro Starlight this role is split betweenastro.config.mjsandsrc/content.config.ts. qwik-docs has no separate content-config file: the frontmatter schema is built into the framework.vite.config.ts— The Vite config. Registers theqwikDocs({ configPath })plugin alongsideqwikCity()andqwikVite(), and sets the deploybase.content/— Content collection directories. qwik-docs turns each.mdor.mdxfile in a collection into a page on your site. Directories map to URL prefixes inqwik-docs.config.ts.src/routes/— Qwik City routes. Holds the catch-all docs route, the landing page, and any custom pages.src/— Other source code and files (entry points, global styles, base-path helper).public/— Static assets (favicon, logos, images) served as-is, not processed by the build.
Content collections
Content does not live in one fixed directory. Each collection is a directory declared in qwik-docs.config.ts and mapped under a URL prefix with collection(), withPrefix(), and merge():
// qwik-docs.config.ts
content: merge(
withPrefix('docs', collection({ directory: 'content/start' })),
withPrefix('docs/guides', collection({ directory: 'content/guides' })),
withPrefix('docs/components', collection({ directory: 'content/components' })),
),
A file's URL comes from its collection's prefix plus its path within the collection directory. For example, content/guides/pages.mdx renders at /docs/guides/pages/. There is no slug frontmatter field; the slug comes from the file path and the collection prefix.
See Pages and the configuration reference for how directories map to URLs.
Routes
All docs content renders through one Qwik City catch-all route at src/routes/docs/[...slug]/index.tsx. There is no per-page route file. src/routes/index.tsx is the landing page; it renders outside the docs layout. src/routes/layout.tsx is the root layout. Add any custom page as its own Qwik City route beside these. See Pages.
Example project contents
A qwik-docs project directory might look like this:
- public/
- favicon.svg
- logo-light.svg
- logo-dark.svg
- hero-star.webp
- content/
- start/
- getting-started.mdx
- guides/
- pages.mdx
- project-structure.mdx
- components/
- cards.mdx
- start/
- src/
- routes/
- docs/
- [...slug]/
- index.tsx
- [...slug]/
- index.tsx
- layout.tsx
- docs/
- global.css
- root.tsx
- routes/
- qwik-docs.config.ts
- vite.config.ts
- package.json
- tsconfig.json