Files
supabase/apps/docs/internals/markdown-sources.ts
Kody Jackson 051d5f79da chore(docs) - remove troubleshooting guides and rendering logic (#52339)
## 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
2026-10-27 12:32:33 -05:00

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' }
})
}