diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index ff5c83d..d7350c5 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -6,6 +6,7 @@ on: paths: - 'apps/docs/**' - 'content/docs/**' + - 'content/blog/**' - 'pnpm-lock.yaml' - '.github/workflows/deploy-docs.yml' workflow_dispatch: diff --git a/apps/docs/lib/layout.shared.tsx b/apps/docs/lib/layout.shared.tsx index b1e6341..dc4eec6 100644 --- a/apps/docs/lib/layout.shared.tsx +++ b/apps/docs/lib/layout.shared.tsx @@ -3,7 +3,7 @@ import Image from 'next/image'; export const gitConfig = { user: 'objectstack-ai', - repo: 'spec', + repo: 'objectos', branch: 'main', }; diff --git a/apps/docs/middleware.ts b/apps/docs/middleware.ts index 3d15e7d..532449d 100644 --- a/apps/docs/middleware.ts +++ b/apps/docs/middleware.ts @@ -157,7 +157,16 @@ export default function middleware(request: NextRequest) { const url = new URL(request.url); // Handle root path specially to avoid double slashes url.pathname = pathname === '/' ? `/${i18n.defaultLanguage}` : `/${i18n.defaultLanguage}${pathname}`; - return NextResponse.rewrite(url); + const response = NextResponse.rewrite(url); + // This is a locale-negotiated response for a prefix-less path (e.g. "/"). + // The underlying page is statically cached with a long s-maxage, but the + // *result here depends on the visitor's language* — so it must never be + // stored in a shared cache, or the CDN would serve this (default-locale) + // HTML to every visitor and non-English browsers would stop being + // redirected to their localized path. Mark it private so the edge skips it + // and middleware re-runs language detection on every request. + response.headers.set('Cache-Control', 'private, no-cache, must-revalidate'); + return response; } // For non-default languages, redirect to the localized path