diff --git a/kumascript/macros/CSSRef.ejs b/kumascript/macros/CSSRef.ejs index 15840835696e..990404e32a5a 100644 --- a/kumascript/macros/CSSRef.ejs +++ b/kumascript/macros/CSSRef.ejs @@ -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 = []; @@ -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;