Skip to content

Commit

Permalink
fix(contributor-spotlight): some old pages not building (#11679)
Browse files Browse the repository at this point in the history
as soon as we hit the featured contributor we were bailing

https://mozilla-hub.atlassian.net/browse/MP-1448
  • Loading branch information
LeoMcA authored Sep 5, 2024
1 parent 418da90 commit 5adb9eb
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions build/spas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ async function buildContributorSpotlight(
) {
const prefix = "community/spotlight";
const profileImg = "profile-image.jpg";
let featuredContributorFrontmatter: DocFrontmatter;

for (const contributor of fs.readdirSync(contributorSpotlightRoot)) {
const file = `${contributorSpotlightRoot}/${contributor}/index.md`;
Expand Down Expand Up @@ -118,14 +119,19 @@ async function buildContributorSpotlight(
if (options.verbose) {
console.log("Wrote", jsonFilePath);
}

if (frontMatter.attributes.is_featured) {
return {
contributorName: frontMatter.attributes.contributor_name,
url: `/${locale}/${prefix}/${frontMatter.attributes.folder_name}`,
quote: frontMatter.attributes.quote,
};
featuredContributorFrontmatter = frontMatter.attributes;
}
}

return featuredContributorFrontmatter
? {
contributorName: featuredContributorFrontmatter.contributor_name,
url: `/${locale}/${prefix}/${featuredContributorFrontmatter.folder_name}`,
quote: featuredContributorFrontmatter.quote,
}
: undefined;
}

export async function buildSPAs(options: {
Expand Down

0 comments on commit 5adb9eb

Please sign in to comment.