diff --git a/AGENTS.md b/AGENTS.md index 4744de4..bdd8d75 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -51,7 +51,7 @@ Monorepo providing shared code style configurations for PleaseAI projects. ## Docs Site -- Located at `apps/docs/` (`@pleaseai/code-style-docs`) — [Nimbus](https://github.com/cloudflare/nimbus) (Astro 7 + Tailwind v4), static output deployed to the Cloudflare Pages project `pleaseai-code-style` +- Located at `apps/docs/` (`@pleaseai/code-style-docs`) — [Nimbus](https://github.com/cloudflare/nimbus) (Astro 7 + Tailwind v4), static output deployed to the Cloudflare Pages project `code-style` - Bun workspace member (`apps/*`); `bun run build` (turbo) builds it to `apps/docs/dist/` - Dev / build / deploy: `bun run docs:dev`, `bun run docs:build`, `bun run docs:deploy` (`wrangler pages deploy`) - Checks inside `apps/docs`: `bun run typecheck` (`astro check`), `bun run lint:docs` (Nimbus prose/MDX lint) diff --git a/apps/docs/astro.config.ts b/apps/docs/astro.config.ts index d12169f..3f0f5ca 100644 --- a/apps/docs/astro.config.ts +++ b/apps/docs/astro.config.ts @@ -55,8 +55,9 @@ export default defineConfig({ }, }, // `/` has no content of its own: send readers to the default locale's - // landing page. Static output emits this as a meta-refresh page, like the - // previous site did. + // landing page. Nimbus writes this into `dist/_redirects`, so Cloudflare + // Pages answers `/` with a 301; Astro's meta-refresh `index.html` is never + // served. redirects: { '/': `/${defaultLocale}`, }, diff --git a/apps/docs/wrangler.jsonc b/apps/docs/wrangler.jsonc index bea2905..ea4fdd7 100644 --- a/apps/docs/wrangler.jsonc +++ b/apps/docs/wrangler.jsonc @@ -2,7 +2,7 @@ "$schema": "node_modules/wrangler/config-schema.json", // Existing Cloudflare Pages project. The site is fully static, so no // bindings, compatibility flags, or vars are needed. - "name": "pleaseai-code-style", + "name": "code-style", "pages_build_output_dir": "dist", "compatibility_date": "2026-10-12" } diff --git a/docs/adr/0003-migrate-docs-to-nimbus.md b/docs/adr/0003-migrate-docs-to-nimbus.md index 30bd91b..f5c8450 100644 --- a/docs/adr/0003-migrate-docs-to-nimbus.md +++ b/docs/adr/0003-migrate-docs-to-nimbus.md @@ -15,7 +15,7 @@ ADR-0002 (0002-workaround-docus-i18n-routing-bug.md). The documentation site (`https://code-style.pages.dev`) ran on **Docus** (Nuxt 4 + Nuxt Content) from `docs/`, deployed to the Cloudflare Pages project -`pleaseai-code-style`. Keeping it working required a stack of workarounds: +`code-style`. Keeping it working required a stack of workarounds: - **Bun linker** — Docus ships raw `.ts` server files that Nitro's `rollup-plugin-inject` cannot parse under Bun's isolated linker, so the root @@ -37,8 +37,8 @@ requirement, not an add-on. ### Constraints -- Keep every live URL: `/` (200), `/en`, `/ko`, `/en/`, `/ko/`, - and `/llms.txt`. +- Keep every live URL: `/` (sends readers to `/en`), `/en`, `/ko`, + `/en/`, `/ko/`, and `/llms.txt`. - Keep the existing Cloudflare Pages project and its domain. - Bun workspace, ESM only, lint with the repository's own ESLint config. - English and Korean content, with the same pages in both locales. @@ -71,8 +71,10 @@ the owned source instead of adopting a third-party plugin: - `astro.config.ts` declares `i18n` with `locales: ['en', 'ko']`, `defaultLocale: 'en'`, and `prefixDefaultLocale: true`, so every locale is - prefixed. `redirects: { '/': '/en' }` makes `/` a meta-refresh page to the - English landing, as before. + prefixed. `redirects: { '/': '/en' }` sends `/` to the English landing. + Nimbus writes the rule into `dist/_redirects`, so Cloudflare Pages answers + `/` with a 301 to `/en`. Astro's meta-refresh `index.html` is still emitted + but is never served. - Content lives in one Nimbus `docs` collection under `src/content/docs//`, so the locale is the first segment of every URL. `sidebar.scope: 'section'` limits the rail (and prev/next) to the @@ -169,7 +171,8 @@ Nitro upgrade risks breaking the build or the i18n routes again. - Page URLs are unchanged. Docus's `/raw//.md` Markdown paths are replaced by Nimbus's `///index.md`; `/sitemap.xml` - redirects to `/sitemap-index.xml`. + redirects to `/sitemap-index.xml`. `/` answered 200 on the Docus site and + now answers a 301 to `/en`. - `bunfig.toml` keeps `linker = "hoisted"`. It was introduced for Docus and may no longer be needed, but removing it changes how every workspace package resolves dependencies and has not been verified.