Skip to content

Commit 0a06001

Browse files
committed
Align blog SEO with complete prose candidates
1 parent b4d0136 commit 0a06001

4 files changed

Lines changed: 35 additions & 21 deletions

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ export async function generateMetadata({ params }: { params: Promise<{ locale: s
1616
locale,
1717
t,
1818
siteMeta,
19-
["title", "intro"],
19+
{
20+
complete: ["intro"],
21+
context: ["title"],
22+
},
2023
);
2124
return {
2225
title,

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ export async function generateMetadata({
1717
locale,
1818
t,
1919
siteMeta,
20-
["title", "description", "subtitle"],
20+
{
21+
complete: ["description", "subtitle"],
22+
context: ["title"],
23+
},
2124
);
2225
return {
2326
title,

web/i18n/audited-seo.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ const blogDescriptionCandidateKeys: Record<
3434
sessionRestore: ["summary", "p1", "p2", "agentP2", "limitsP"],
3535
cmuxHome: ["summary", "p2", "p3", "p4"],
3636
introducingCmux: ["summary", "p1", "whyP"],
37-
claudeCodeBestWorktreeManager: [
38-
"summary",
39-
"p1",
40-
],
37+
claudeCodeBestWorktreeManager: ["summary", "p1"],
4138
zenOfCmux: ["summary", "p1", "p2", "p3", "p4"],
4239
cmdShiftU: ["summary", "p1"],
4340
unreadShortcuts: ["summary", "p1", "p2", "p3", "p4", "p5"],
@@ -195,28 +192,33 @@ export function blogPostSeoCopy(
195192
);
196193
return {
197194
title: selectTitle(locale, metadata("metaTitle"), siteMeta, [title]),
198-
description: selectDescription(locale, metadata("metaDescription"), [
199-
post("summary"),
200-
`${title}. ${post("summary")}`,
201-
...authoredDescriptions,
202-
]),
195+
description: selectDescription(locale, metadata("metaDescription"), {
196+
completeCandidates: authoredDescriptions,
197+
contextFragments: [title],
198+
}),
203199
};
204200
}
205201

206202
export function landingPageSeoCopy(
207203
locale: string,
208204
t: SeoMessageLookup,
209205
siteMeta: SeoMessageLookup,
210-
candidateKeys: readonly string[],
206+
candidateKeys: {
207+
complete: readonly string[];
208+
context: readonly string[];
209+
},
211210
) {
212-
const authoredCandidates = candidateKeys.map((key) => t(key));
211+
const completeCandidates = candidateKeys.complete.map((key) => t(key));
212+
const contextFragments = candidateKeys.context.map((key) => t(key));
213213
return {
214-
title: selectTitle(locale, t("metaTitle"), siteMeta, authoredCandidates),
215-
description: selectDescription(
216-
locale,
217-
t("metaDescription"),
218-
authoredCandidates,
219-
),
214+
title: selectTitle(locale, t("metaTitle"), siteMeta, [
215+
...contextFragments,
216+
...completeCandidates,
217+
]),
218+
description: selectDescription(locale, t("metaDescription"), {
219+
completeCandidates,
220+
contextFragments,
221+
}),
220222
};
221223
}
222224

web/tests/seo.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,10 @@ describe("SEO metadata helpers", () => {
365365
locale,
366366
messageLookup(messages.nightly),
367367
siteMeta,
368-
["title", "description", "subtitle"],
368+
{
369+
complete: ["description", "subtitle"],
370+
context: ["title"],
371+
},
369372
),
370373
[
371374
messages.nightly.metaDescription,
@@ -381,7 +384,10 @@ describe("SEO metadata helpers", () => {
381384
locale,
382385
messageLookup(messages.landing.guides),
383386
siteMeta,
384-
["title", "intro"],
387+
{
388+
complete: ["intro"],
389+
context: ["title"],
390+
},
385391
),
386392
[
387393
messages.landing.guides.metaDescription,

0 commit comments

Comments
 (0)