Files
supabase/apps/docs/internals/helpers.ts
Charis c757fcab20 fix,feat(sitemap): add all pages + priority (#29083)
Pages were missing from the sitemap after the reorganization. Added them
back in.

Also added an optional priority that can be specified by including
`sitemapPriority` in content metadata. Used on the deprecated Auth
Helpers pages to see if we can tweak the relative SEO ranking for them.
2024-09-04 11:16:51 -04:00

16 lines
407 B
TypeScript

export function flattenSections(sections) {
let a = []
for (let i = 0; i < sections.length; i++) {
if (sections[i].id) {
// only push a section that has an id
// these are reserved for sidebar subtitles
a.push(sections[i])
}
if (sections[i].items) {
// if there are subitems, loop through
a = a.concat(flattenSections(sections[i].items))
}
}
return a
}