docs: regroup the nav into the docs site sections; API page
Docs site Plan 2 Task 6. nav.json now runs Tutorials (rails, laravel-and-django), Guides (rootfs, pdfs, scan-callbacks, domains-buying, rate-limits, plans), CLI reference (cli), API reference (api); slugs unchanged, so no link moves. A placeholder API page says the public API is being designed and points to the CLI. The docs home intro no longer says these pages are not a tutorial. TestNavSectionsInSpecOrder keeps the sections in the spec's order and never empty. Copy DS2-C01..C04, C14..C19 (Luna pass).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 files changed,
+67
−19
docs/site/api.md+5 −0docs/site/index.md+1 −4docs/site/nav.json+30 −15internal/docsite/nav_test.go+31 −0
CI passed — run details
diff --git a/docs/site/api.md b/docs/site/api.md| new file mode 100644 |
| index 000000000..58ce3850f |
| --- /dev/null |
| +++ b/docs/site/api.md |
| @@ -0,0 +1,5 @@ |
| +# API reference |
| + |
| +The public, versioned API for CARLOS is being designed. Endpoint details are not available yet. |
| + |
| +Until then, use the CLI. [The CLI reference](/docs/cli) lists its commands. |
diff --git a/docs/site/index.md b/docs/site/index.md| index fe9fd6eca..2c6980018 100644 |
| --- a/docs/site/index.md |
| +++ b/docs/site/index.md |
| @@ -6,10 +6,7 @@ and a DNS zone; you publish a release with `carlos ship`, and the platform |
| places it on instances, routes to it through a shared edge, and keeps TLS, |
| config, secrets and replication working underneath it. |
| -These pages are the reference for the platform itself — the commands you |
| -type, and what happens on a box after you type them. They assume you are |
| -either running a deployment or shipping onto one. They do not teach Go, and |
| -they are not a tutorial. |
| +These pages cover the platform. They explain how it works, how to run a deployment, and how to ship apps onto one. Use the tutorials and guides for step-by-step help. Use the reference to find commands. |
| If you are a Carloku customer, the docs you want are at |
| [carloku.com](https://carloku.com). Carloku is CARLOS run for you, and it |
diff --git a/docs/site/nav.json b/docs/site/nav.json| index 3a7cef08c..2d5b175dc 100644 |
| --- a/docs/site/nav.json |
| +++ b/docs/site/nav.json |
| @@ -1,7 +1,7 @@ |
| { |
| "sections": [ |
| { |
| - "title": "Guides", |
| + "title": "Tutorials", |
| "pages": [ |
| { |
| "slug": "rails", |
| @@ -16,32 +16,22 @@ |
| ] |
| }, |
| { |
| - "title": "Reference", |
| + "title": "Guides", |
| "pages": [ |
| - { |
| - "slug": "cli", |
| - "label": "The CLI", |
| - "blurb": "Every carlos command, grouped by whether you are shipping an app, running a deployment, or on a box." |
| - }, |
| { |
| "slug": "rootfs", |
| "label": "Rootfs apps", |
| "blurb": "What a rootfs app's image is started with, what it can write, and where it may run." |
| }, |
| - { |
| - "slug": "scan-callbacks", |
| - "label": "Receiving scan results", |
| - "blurb": "Ask for one object to be scanned, read the verdict, and verify the callback that tells you it is done." |
| - }, |
| { |
| "slug": "pdfs", |
| "label": "PDFs", |
| "blurb": "Render an invoice, attach it to an email, and use Gotenberg from your app." |
| }, |
| { |
| - "slug": "plans", |
| - "label": "Plans", |
| - "blurb": "Give accounts limits, packs and sponsorship. Plans stay off until you configure a catalog." |
| + "slug": "scan-callbacks", |
| + "label": "Receiving scan results", |
| + "blurb": "Ask for one object to be scanned, read the verdict, and verify the callback that tells you it is done." |
| }, |
| { |
| "slug": "domains-buying", |
| @@ -52,6 +42,31 @@ |
| "slug": "rate-limits", |
| "label": "Rate limits", |
| "blurb": "Stop one visitor taking over an instance, set limits per instance, and roll them out safely." |
| + }, |
| + { |
| + "slug": "plans", |
| + "label": "Plans", |
| + "blurb": "Give accounts limits, packs and sponsorship. Plans stay off until you configure a catalog." |
| + } |
| + ] |
| + }, |
| + { |
| + "title": "CLI reference", |
| + "pages": [ |
| + { |
| + "slug": "cli", |
| + "label": "The CLI", |
| + "blurb": "Every carlos command, grouped by whether you are shipping an app, running a deployment, or on a box." |
| + } |
| + ] |
| + }, |
| + { |
| + "title": "API reference", |
| + "pages": [ |
| + { |
| + "slug": "api", |
| + "label": "API reference", |
| + "blurb": "The public API is not available yet. Use the CLI for now." |
| } |
| ] |
| } |
diff --git a/internal/docsite/nav_test.go b/internal/docsite/nav_test.go| index 8f2d5d9b3..a8c987f87 100644 |
| --- a/internal/docsite/nav_test.go |
| +++ b/internal/docsite/nav_test.go |
| @@ -78,3 +78,34 @@ func TestNavNamingAMissingPageFails(t *testing.T) { |
| t.Fatal("Load succeeded on a nav.json naming a page that does not exist") |
| } |
| } |
| + |
| +// specSections is the docs site's section order (spec |
| +// docs/superpowers/specs/2026-11-06-docs-site-design.md §5). A section may |
| +// be missing until its first page lands, but never empty and never out of |
| +// order. |
| +var specSections = []string{"Start here", "Tutorials", "Guides", "Operating a deployment", "CLI reference", "API reference"} |
| + |
| +func TestNavSectionsInSpecOrder(t *testing.T) { |
| + site, err := Load(root) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + next := 0 |
| + for _, sec := range site.Sections { |
| + at := -1 |
| + for i := next; i < len(specSections); i++ { |
| + if specSections[i] == sec.Title { |
| + at = i |
| + break |
| + } |
| + } |
| + if at < 0 { |
| + t.Errorf("section %q is not one of %q, or is out of order", sec.Title, specSections) |
| + continue |
| + } |
| + next = at + 1 |
| + if len(sec.Pages) == 0 { |
| + t.Errorf("section %q is empty", sec.Title) |
| + } |
| + } |
| +} |