mirror of
https://github.com/supabase/supabase.git
synced 2026-06-21 07:46:01 +08:00
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.
16 lines
407 B
TypeScript
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
|
|
}
|