Skip to content

Commit 6df5d73

Browse files
committed
Remove localized discovery for English-only posts
1 parent 3586888 commit 6df5d73

4 files changed

Lines changed: 35 additions & 6 deletions

File tree

web/app/[locale]/(landing)/blog/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { useTranslations } from "next-intl";
1+
import { useLocale, useTranslations } from "next-intl";
22
import { getTranslations } from "next-intl/server";
33
import { buildAlternates, openGraphDefaults, twitterSummary } from "@/i18n/seo";
44
import { blogIndexSeoCopy } from "@/i18n/audited-seo";
55
import { Link } from "@/i18n/navigation";
6-
import { blogPosts } from "@/app/[locale]/components/blog-posts";
6+
import { blogPostsForLocale } from "@/app/[locale]/components/blog-posts";
77

88
export async function generateMetadata({
99
params,
@@ -31,6 +31,8 @@ export async function generateMetadata({
3131

3232
export default function BlogPage() {
3333
const t = useTranslations("blog");
34+
const locale = useLocale();
35+
const blogPosts = blogPostsForLocale(locale);
3436

3537
return (
3638
<>

web/app/[locale]/components/blog-pager.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
"use client";
22

3-
import { useTranslations } from "next-intl";
3+
import { useLocale, useTranslations } from "next-intl";
44
import { Link, usePathname } from "../../../i18n/navigation";
5-
import { blogPosts } from "./blog-posts";
5+
import { blogPostsForLocale } from "./blog-posts";
66

77
export function BlogPager() {
88
const pathname = usePathname();
9+
const locale = useLocale();
910
const t = useTranslations("blog.posts");
11+
const blogPosts = blogPostsForLocale(locale);
1012
const index = blogPosts.findIndex(
1113
(post) => `/blog/${post.slug}` === pathname
1214
);

web/app/[locale]/components/blog-posts.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
import { englishFallbackContentLocales } from "@/i18n/locale-availability";
2+
3+
type BlogPost = {
4+
slug: string;
5+
key: string;
6+
title: string;
7+
date: string;
8+
summary: string;
9+
locales?: readonly string[];
10+
};
11+
112
export const blogPosts = [
213
{
314
slug: "claude-code-best-worktree-manager",
@@ -102,6 +113,7 @@ export const blogPosts = [
102113
date: "2026-03-30",
103114
summary:
104115
"oh-my-openagent (formerly oh-my-opencode) orchestrates parallel specialist agents across Claude, GPT, and Gemini. cmux omo turns their tmux panes into native splits.",
116+
locales: englishFallbackContentLocales,
105117
},
106118
{
107119
slug: "gpl",
@@ -110,6 +122,7 @@ export const blogPosts = [
110122
date: "2026-03-30",
111123
summary:
112124
"cmux relicensed from AGPL-3.0 to GPL-3.0.",
125+
locales: englishFallbackContentLocales,
113126
},
114127
{
115128
slug: "cmd-shift-u",
@@ -143,4 +156,10 @@ export const blogPosts = [
143156
summary:
144157
"A native macOS terminal built on Ghostty, designed for running multiple AI coding agents side by side.",
145158
},
146-
];
159+
] satisfies readonly BlogPost[];
160+
161+
export function blogPostsForLocale(locale: string) {
162+
return blogPosts.filter(
163+
(post) => !post.locales || post.locales.some((candidate) => candidate === locale),
164+
);
165+
}

web/app/lib/agent-page-paths.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { locales } from "../../i18n/routing";
22
import { comparePages, comparePath } from "./compare-pages";
33
import type { ComparePageKey } from "./compare-pages";
44
import {
5+
englishFallbackContentLocales,
56
fallbackContentLocales,
67
featureWorkflowContentLocales,
78
remoteTmuxDocsLocales,
@@ -134,8 +135,13 @@ export const agentReadablePages = [
134135
{
135136
path: "/blog/cmux-omo",
136137
title: "oh-my-openagent subagents as native cmux panes",
138+
locales: englishFallbackContentLocales,
139+
},
140+
{
141+
path: "/blog/gpl",
142+
title: "cmux is now GPL",
143+
locales: englishFallbackContentLocales,
137144
},
138-
{ path: "/blog/gpl", title: "cmux is now GPL" },
139145
{ path: "/blog/cmd-shift-u", title: "Cmd+Shift+U" },
140146
{ path: "/blog/zen-of-cmux", title: "The Zen of cmux" },
141147
{ path: "/blog/show-hn-launch", title: "Launching cmux on Show HN" },

0 commit comments

Comments
 (0)