Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/new-about-page' into test-next
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoMcA committed Nov 28, 2024
2 parents 68e047f + c914636 commit 8c92b8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
20 changes: 6 additions & 14 deletions build/spas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export async function buildSPAs(options: {
async function buildStaticPages(
dirpath: string,
slugPrefix?: string,
title = "MDN"
title?: string
) {
const crawler = new fdir()
.withFullPaths()
Expand All @@ -287,7 +287,7 @@ export async function buildSPAs(options: {

for (const filepath of filepaths) {
const file = filepath.replace(dirpath, "");
const page = file.split(".")[0];
const page = file.split(".")[0].slice(1);

const locale = DEFAULT_LOCALE;
const pathLocale = locale.toLowerCase();
Expand Down Expand Up @@ -327,9 +327,9 @@ export async function buildSPAs(options: {
};
const context: HydrationData = {
hyData,
pageTitle: frontMatter.attributes.title
pageTitle: title
? `${frontMatter.attributes.title} | ${title}`
: title,
: frontMatter.attributes.title,
url,
};

Expand Down Expand Up @@ -361,16 +361,8 @@ export async function buildSPAs(options: {
"observatory/docs",
OBSERVATORY_TITLE
);
await buildStaticPages(
path.join(GENERIC_CONTENT_ROOT, "community"),
"",
"Contribute to MDN"
);
await buildStaticPages(
path.join(GENERIC_CONTENT_ROOT, "about"),
"",
"About MDN"
);
await buildStaticPages(path.join(GENERIC_CONTENT_ROOT, "community"));
await buildStaticPages(path.join(GENERIC_CONTENT_ROOT, "about"));
}

// Build all the home pages in all locales.
Expand Down
6 changes: 3 additions & 3 deletions cloud-function/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8c92b8f

Please sign in to comment.