mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
## Problem Dupe content and workflows when this content now all lives in the KB. ## Solution Removes various artifacts from the docs repo (content files, github workflows, etc.) from the docs app. These paths have already been redirected to /kb in #52095 and we haven't seen any meaningful 404 traffic indicating the redirects were done incorrectly. ## Preview links TBD
28 lines
771 B
TypeScript
28 lines
771 B
TypeScript
import path from 'node:path'
|
|
import { globby } from 'globby'
|
|
|
|
export type FrontmatterFormat = 'yaml' | 'toml'
|
|
|
|
export interface MarkdownSource {
|
|
sourceFile: string
|
|
slug: string
|
|
outPath: string
|
|
frontmatter: FrontmatterFormat
|
|
}
|
|
|
|
const OUTPUT_ROOT = 'public/markdown/guides'
|
|
const GUIDES_GLOB = 'content/guides/**/!(_)*.mdx'
|
|
|
|
export function guideSlug(sourceFile: string): string {
|
|
return sourceFile.replace(/^content\/guides\//, '').replace(/\.mdx$/, '')
|
|
}
|
|
|
|
export async function collectMarkdownSources(): Promise<MarkdownSource[]> {
|
|
const guideFiles = await globby([GUIDES_GLOB])
|
|
|
|
return guideFiles.map((sourceFile) => {
|
|
const slug = guideSlug(sourceFile)
|
|
return { sourceFile, slug, outPath: `${OUTPUT_ROOT}/${slug}.md`, frontmatter: 'yaml' }
|
|
})
|
|
}
|