Skip to content

Commit

Permalink
fix(macros/CSSRef): include level two functions (#10679)
Browse files Browse the repository at this point in the history
For example, https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsl
was no longer shown in the sidebar, since it moved into `Web/CSS/color_value`.

Co-authored-by: Claas Augner <caugner@mozilla.com>
  • Loading branch information
OnkarRuikar and caugner committed Apr 16, 2024
1 parent 0b6e2ae commit cd7458c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion kumascript/macros/CSSRef.ejs
Expand Up @@ -941,6 +941,11 @@ const hasTag = page.hasTag;
const rtlLocales = ['ar', 'he', 'fa'];
const pageList = await page.subpagesExpand('/en-US/docs/Web/CSS');
// Some functions are at depth two.
// Example: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsl
pageList.push(...pageList.map((page) => page.subpages).flat());
const standardPages = pageList.filter(page => !hasTag(page, "Non-standard"));
const groups = [];
Expand Down Expand Up @@ -986,7 +991,9 @@ for (const page of standardPages) {
}
}
properties = properties.sort((a, b) => a.title.localeCompare(b.title));
const sortByTitle = (a, b) => a.title.localeCompare(b.title);
properties.sort(sortByTitle);
functions.sort(sortByTitle);
function smartLink(href, title, content, subpath) {
let basepath = subpath;
Expand Down

0 comments on commit cd7458c

Please sign in to comment.