Patch Changes
-
#177
adb8efeThanks @MohamedH1998! - Add thecopy-promptregistry component. Runnimbus-docs add copy-promptto installCopyPrompt, a one-line prompt with a Copy prompt button for readers to paste into an AI coding agent. New sites don't include it by default. -
#171
41376ddThanks @MohamedH1998! - Fix upgrade checks and CLI guidance.Behavior changes
nimbus-docs checkwarns about the placeholdersiteinstead of exiting1, matching the build. A CI job that relied oncheckfailing for an unsetsiteneeds its own check.migrate --dry-runandmigrate --jsonreportpassedand exit0when no migrations or required reviews remain and a baseline is recorded, including when no entries fall between the recorded and installed versions.
Upgrades
- Sites upgrading from before 0.13.0 with a custom loader on a collection Nimbus indexes now see the 0.13.0
withNimbusMarkdown()requirement inmigrateandoutdated. outdated --jsonaddssummary.requiredPackageApis, the required subset ofsummary.packageApis, and awarningsarray. It warns when the compared starter needs a newer package than the project has, which also blocksdiff --apply.outdatedandmigrateuse the same terms: migrations and upgrade reviews.migrateprints each outcome once, and declining its record prompt says how to record the baseline later.
CLI
- Upgrade and migrate hints, and the build errors that point at
migrateorinit, print a runnable command instead of a raw Node path or a barenimbus-docs. pnpm and Yarn projects that declare the package get the local bin, such aspnpm nimbus-docs migrate. With--cwd, the command runs from the current directory and pins the project's Nimbus version, such asnpx @cloudflare/nimbus-docs@0.15.1 migrate --cwd 'site' --yes. - After
check --fixwithout a terminal, the hint says what the remaining fixes need: a terminal for prompts, or--yesfor installs. checklists what it skipped when theapiconfig or the rendering policy isn't a plain literal, or whensrc/content.config.tsis missing.lint --helplists the lint rules and the--colorand--no-colorflags.addsuggests registering only the component you asked for insrc/components.ts, not its dependencies.
Cloudflare
add adapter-cloudflareinstalls@astrojs/cloudflare14.3, which fixes a crash on the firstastro devwith a cold cache ("Dev server process exited before becoming ready"). Existing sites can upgrade withpnpm add @astrojs/cloudflare@~14.3.0.add adapter-cloudflarenames the policy it adds:rendering: { default: "request" }, which renders every collection on request. To render only API pages on request, set that policy before running the installer, which keeps an existing policy.
-
#178
fd53431Thanks @MohamedH1998! - Behavior changes- The duplicate-route check uses a page's frontmatter
slug, soa.mdxwithslug: bnext tob.mdxnow fails the build, as other duplicate routes do. Before, the collision went unreported and Astro served one of the two pages. withBase("/", base)returns the base without a trailing slash, such as/docs, when page URLs have none: undertrailingSlash: "never", orbuild.format: "file"with"ignore". Code that appends to the result or compares it with/docs/needs updating.
checkandinitcheckwarns when an installed Astro adapter is outside the range Nimbus supports, such as@astrojs/cloudflare14.1, with the command that installs a supported version. It doesn't change the version itself.- On a PR preview,
checksays which release to pass tomigrate --fromonce you install a release, instead of repeating "run a build, then check again". init --forcerebuilds only the component and install records. It keeps the rest of a validnimbus.json: the reviewed baseline, the starter version and variant, a preview's record, and the server-output opt-in. Before, it reset them, which brought back the "no reviewed upgrade baseline" build failure.
build.format: "file"andbase- With
build.format: "file", canonical URLs andog:urlno longer end in.html, pages get previous and next links, the sidebar marks the current page, and breadcrumbs show page titles instead of "Welcome.Html". - With a
baseand no trailing slashes, the home link, "Home" breadcrumb, and 404 page link to/docs, matching the home page's canonical URL, instead of/docs/.
Routes and Markdown
- In per-page
.mdfiles andllms-full.txt, a code block in a nested list item stays in the item, so the text after it no longer turns into code, and a code block in a numbered item no longer splits the list. - The version switcher and missing-page redirects find pages in folders with dots, such as
1.2.3/, without aslug, and section index pages such asguides/index.mdx. ApreviousSlugwritten as a file path, such asguides/index, names the section's page.
- The duplicate-route check uses a page's frontmatter
-
#172
6637381Thanks @MohamedH1998! - Make generated links, the sitemap, and Markdown output follow the site config.Behavior changes
- Under the default
trailingSlash: "ignore",api.refcitation links now end in/, like sidebar links and the canonical URL, in pages, per-page.mdfiles, andllms-full.txt. - With
trailingSlash: "ignore"andbuild.format: "file"or"preserve", generated links no longer end in/, so they reach the pages Astro builds.
Links, sitemap, and routes
- Sidebar, navigation, breadcrumb, pagination, and citation links, and the API reference's sidebar, breadcrumbs, and type links, follow Astro's
trailingSlashandbuild.format. Under"never"they drop the slash, and API links no longer 404 under"always"or"never". With the defaultbuild.format, they match the canonical URL. noindex: truepages are left out of the sitemap on sites withoutbase, as they already were withbase.- The docs schema accepts Astro's
slugfrontmatter field, so a page in a1.2.3/folder can keep its dots:slug: 1.2.3/setupserves it at/1.2.3/setup/. The version switcher and missing-page redirects use theslugtoo. - API pages no longer return 500 ("missing prepared page data") in
astro devafter the Astro config switches to server output while the dev server is running, for example afteradd adapter-cloudflare.
Generated Markdown
- Per-page
.mdfiles andllms-full.txtkeep the indentation of code blocks in MDX pages, so YAML and Python keep their meaning. Code inside<Aside>gets the>prefix on every line. - A citation inside a longer fence, such as a ```` fence that shows a
example, stays literal, as does one in a fence opened on a list-item line (`-yaml`). That fence also stays inside its list item in the Markdown output. <PackageManagers>Markdown includes the package for everytypeand matches the HTML commands.type="dlx" pkg="@cloudflare/nimbus-docs" args="list"now rendersnpx @cloudflare/nimbus-docs listinstead ofnpx list.
- Under the default
-
#170
ae346f0Thanks @MohamedH1998! - Prerelease versions, such as the PR previews published to pkg.pr.new, select the upgrade entries of the release they preview. Two prereleases of the same release no longer count as newer than each other, so recording one and installing another doesn't fail the build.