Skip to content

Commit

Permalink
Merge branch 'MP-1054-rewrite-page-titles-for-seo' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner committed Apr 17, 2024
2 parents cf67c28 + 52f9003 commit 5b90230
Show file tree
Hide file tree
Showing 2 changed files with 529 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
postProcessSmallerHeadingIDs,
} from "./utils.js";
import { getWebFeatureStatus } from "./web-features.js";
import { rewritePageTitleForSEO } from "./seo.js";
export { default as SearchIndex } from "./search-index.js";
export { gather as gatherGitHistory } from "./git-history.js";
export { buildSPAs } from "./spas.js";
Expand Down Expand Up @@ -536,7 +537,8 @@ export async function buildDocument(
// a breadcrumb in the React component.
addBreadcrumbData(document.url, doc);

doc.pageTitle = getPageTitle(doc);
const pageTitle = getPageTitle(doc);
doc.pageTitle = rewritePageTitleForSEO(doc.mdn_url, pageTitle);

// Decide whether it should be indexed (sitemaps, robots meta tag, search-index)
doc.noIndexing =
Expand Down
Loading

0 comments on commit 5b90230

Please sign in to comment.