Skip to content

Commit

Permalink
fix(macros/APIRef): fall back to en-US to determine badges
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner committed Feb 29, 2024
1 parent 9d29d47 commit 55971dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kumascript/macros/APIRef.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ function getPageTitle(page) {
}
async function smartLinkWithBadges(url, content) {
const aPage = await wiki.getPage(url);
let aPage = await wiki.getPage(url);
if (!aPage.title && env.locale !== 'en-US') {
const originalUrl = url.replace(`/${env.locale}/`, "/en-US/");
aPage = await wiki.getPage(originalUrl);
}
const link = web.smartLink(url, null, content, APIHref, null, "APIRef");
const badges = (await page.badges(aPage)).join("");
return link + badges;
Expand Down

0 comments on commit 55971dd

Please sign in to comment.