mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 10:55:06 +03: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.
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
import { REFERENCES } from '../../content/navigation.references'
|
|
import { getFlattenedSections } from '../../features/docs/Reference.generated.singleton'
|
|
|
|
export async function generateReferencePages() {
|
|
return (
|
|
await Promise.all(
|
|
Object.keys(REFERENCES)
|
|
.flatMap((key) => {
|
|
return REFERENCES[key].versions.map((version) => {
|
|
return {
|
|
sdkId: key,
|
|
version: version,
|
|
isLatestVersion: version === REFERENCES[key].versions[0],
|
|
libPath: REFERENCES[key].libPath,
|
|
}
|
|
})
|
|
})
|
|
.map(async ({ sdkId, version, libPath, isLatestVersion }) => {
|
|
const flattenedSections = await getFlattenedSections(sdkId, version)
|
|
return (
|
|
flattenedSections?.map((section) => ({
|
|
link: isLatestVersion
|
|
? `reference/${libPath}/${section.slug}`
|
|
: `reference/${libPath}/${version}/${section.slug}`,
|
|
})) ?? []
|
|
)
|
|
})
|
|
)
|
|
).flat()
|
|
}
|