Skip to content

Commit

Permalink
fix(macros/APIRef): skip duplicate entries in Related pages (#10973)
Browse files Browse the repository at this point in the history
fix(macro): fix duplicate entries in APIRef

fixes #10864
  • Loading branch information
fiji-flo committed Apr 23, 2024
1 parent 37379ec commit 92baf4e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kumascript/macros/APIRef.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ async function buildSublist(pages, title) {
const title = getPageTitle(aPage);
result += '<li>';
const pageBadges = (await page.badges(aPage)).join("");
if (rtlLocales.indexOf(locale) != -1) {
Expand Down Expand Up @@ -205,8 +205,10 @@ function buildIFList(interfaces, title) {
var result = '<li class="toggle"><details open><summary>' + title + '</summary><ol>';
for (var i = 0; i < interfaces.length; i++) {
var url = interfaces[i].replace('()', '').replace('.', '/');
result += `<li>${web.smartLink(APIHref + '/' + url, null, `<code>${interfaces[i]}</code>`, APIHref, null, "APIRef")}</li>`;
var url = APIHref + '/' + interfaces[i].replace('()', '').replace('.', '/');
if (!url.endsWith(slug)) {
result += `<li>${web.smartLink(url, null, `<code>${interfaces[i]}</code>`, APIHref, null, "APIRef")}</li>`;
}
}
result += '</ol></details></li>';
Expand Down

0 comments on commit 92baf4e

Please sign in to comment.