mirror of
https://github.com/supabase/supabase.git
synced 2026-09-10 20:10:31 +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.
24 lines
701 B
TypeScript
24 lines
701 B
TypeScript
import fs from 'fs'
|
|
import yaml from 'js-yaml'
|
|
|
|
import cliCommonSections from '../../spec/common-cli-sections.json'
|
|
import { flattenSections } from '../helpers'
|
|
|
|
const flatCLISections = flattenSections(cliCommonSections)
|
|
|
|
const cliSpec = yaml.load(fs.readFileSync(`spec/cli_v1_commands.yaml`, 'utf8')) as any
|
|
|
|
/**
|
|
* Generates the CLI page links for the CLI reference.
|
|
* @returns {Array<{link: string}>} - An array of CLI page links.
|
|
*/
|
|
export function generateCLIPages() {
|
|
let cliPages = []
|
|
|
|
cliSpec.commands.map((section) => {
|
|
const slug = flatCLISections.find((item) => item.id === section.id)?.slug
|
|
if (slug) cliPages.push({ link: `reference/cli/${slug}` })
|
|
})
|
|
return cliPages
|
|
}
|