Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ pnpm --dir docs build # writes docs/dist

- **Docs pages** are plain Markdown in `src/content/docs/`. Their order and sections are in `src/lib/docs.ts`; the build
fails if a page is missing there or listed but missing.
- **Case studies** are Markdown in `src/content/case-studies/`, one per converted project, served at
`/case-studies/<name>/`. A study with `draft: true` is built by the dev server only, so `pnpm --dir docs build` never
publishes it. `bootstrap.md` is the first, and the template for the rest: what the project's CI runs, the whole
config, the replay estimate with its method and assumptions, what the conversion found, and what modules would change.
- **Every page is also served as Markdown** at `/docs/<page>.md`, and `/llms.txt`, `/llms-full.txt` and `/install.md`
are generated from the same files (`src/pages/`).
- **`/install.sh`** is the repository's root `install.sh`, copied at build time (`src/lib/install-script.mjs`). Never add
a second copy in `public/`.
- **YAML examples are tested.** `tests/docs_examples.rs` runs every YAML block in the docs and the README through
`cigen generate`. Each block's first line says what it is: `# cigen.yml`, `# .cigen/<path>`, `# fragment` or
`# generated: <path>`. A second line `# error: <text>` means the example must fail with that text. The homepage's
- **YAML examples are tested.** `tests/docs_examples.rs` runs every YAML block in the docs, the case studies and the
README through `cigen generate`. Each block's first line says what it is: `# cigen.yml`, `# .cigen/<path>`,
`# fragment` or `# generated: <path>`. A second line `# error: <text>` means the example must fail with that text. The homepage's
config is `src/examples/home.cigen.yml`, tested the same way.
- **The homepage** is `src/pages/index.astro`, with its content in `src/lib/home.ts`. Design tokens are in
`src/styles/tokens.css`; colours and fonts are always referenced through them.
Expand Down
18 changes: 17 additions & 1 deletion docs/src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,20 @@ const docs = defineCollection({
}),
});

export const collections = { docs };
/** Real projects converted to cigen. A draft is built only by the dev server, never deployed. */
const caseStudies = defineCollection({
loader: glob({ pattern: "**/*.md", base: "./src/content/case-studies" }),
schema: z.object({
title: z.string(),
description: z.string(),
/** The project, as `owner/name`. */
project: z.string(),
repository: z.string().url(),
/** The full commit the conversion was written against. */
commit: z.string().regex(/^[0-9a-f]{40}$/),
studied: z.coerce.date(),
draft: z.boolean(),
}),
});

export const collections = { docs, caseStudies };
Loading
Loading