Skip to content

Commit fb85c54

Browse files
committed
docs(site): blog posts redirect permanently to the product site's blog
www.objectos.ai hosts the one blog. The four posts this site published under `/blog/<slug>` — and the `/en/blog/<slug>` spelling they were prerendered under — answer a permanent redirect to the product site's imported counterpart at `/en/blog/<slug>/`, and `/blog` to its index. The `.mdx` sources and the blog route stay in the tree for now; their removal is the follow-up once the redirects are measured on production. A second table beside `docsRedirects` on purpose: `check:docs-redirects` resolves every destination of that table against `content/docs` and reports an off-site destination as UNRESOLVABLE, which is right for a docs redirect and meaningless for a cross-site one. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FMuBZmssbfQkVrKRtxNvng
1 parent 1a18333 commit fb85c54

1 file changed

Lines changed: 46 additions & 2 deletions

File tree

‎apps/docs/redirects.mjs‎

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,34 @@ export const docsRedirects = [
151151
['/docs/guides/:path*', '/docs'],
152152
];
153153

154+
/**
155+
* The blog moved to the product site. www.objectos.ai is the one blog
156+
* (maintainer ruling 2026-10-26: product site vs developer site); the four
157+
* posts this site published under `/blog/<slug>` were imported there under the
158+
* same slugs, at `/en/blog/<slug>/` (the product site's locales are its own
159+
* concern — English is the canonical import). Every old URL answers a permanent
160+
* redirect to its counterpart, and the index to the product blog's index.
161+
*
162+
* Both spellings a reader can hold are listed: the public `/blog/<slug>` and the
163+
* locale-prefixed `/en/blog/<slug>` every post was prerendered under (the
164+
* default locale of `apps/docs/lib/i18n.ts`, hidden from public URLs by
165+
* `proxy.ts`). Next evaluates `redirects()` BEFORE the proxy, so the prefixed
166+
* form goes straight to the product site instead of paying the proxy's 307 to
167+
* `/blog/<slug>` first.
168+
*
169+
* Deliberately a second table, not rows in `docsRedirects`:
170+
* `scripts/check-docs-redirects.mjs` resolves every destination of that table
171+
* against `content/docs` and reports an off-site destination as UNRESOLVABLE
172+
* — correct for a docs redirect, meaningless for a cross-site one. This table
173+
* is outside that gate's reach; what holds it honest is the product site
174+
* serving the slugs below (its import is the precondition for landing this
175+
* table at all) and `scripts/check-published-readme-links.mjs`, which reads
176+
* `docsRedirects` alone and is unaffected.
177+
*
178+
* The `.mdx` sources under `content/blog` and the `app/[lang]/blog` route are
179+
* still in the tree while these redirects go live; removing them is the
180+
* follow-up, once the redirects are measured answering on production.
181+
*/
154182
/**
155183
* The product site's origin. Declared here — the one dependency-free module
156184
* both halves can read — and re-exported by `lib/layout.shared.tsx` as
@@ -159,9 +187,25 @@ export const docsRedirects = [
159187
*/
160188
export const PRODUCT_SITE_ORIGIN = 'https://www.objectos.ai';
161189

162-
/** Next.js redirects() entries derived from the table above. */
190+
/** The posts imported by the product site, by slug — one redirect pair each. */
191+
export const MOVED_POSTS = [
192+
'context-window-is-the-constraint',
193+
'metadata-driven-architecture',
194+
'protocol-first-development',
195+
'the-ontology-is-the-software',
196+
];
197+
198+
/** `''` is the public spelling; `/en` the prerendered one (see above). */
199+
const BLOG_PATH_PREFIXES = ['', '/en'];
200+
201+
export const blogRedirects = BLOG_PATH_PREFIXES.flatMap((prefix) => [
202+
[`${prefix}/blog`, `${PRODUCT_SITE_ORIGIN}/en/blog/`],
203+
...MOVED_POSTS.map((slug) => [`${prefix}/blog/${slug}`, `${PRODUCT_SITE_ORIGIN}/en/blog/${slug}/`]),
204+
]);
205+
206+
/** Next.js redirects() entries derived from the two tables above. */
163207
export function toNextRedirects() {
164-
return docsRedirects.map(([source, destination]) => ({
208+
return [...docsRedirects, ...blogRedirects].map(([source, destination]) => ({
165209
source,
166210
destination,
167211
permanent: true,

0 commit comments

Comments
 (0)