fix: add null checks to parsers and fix docs path
This commit is contained in:
@@ -5,12 +5,13 @@ import { parseMarkdown, buildFileTree } from '@/lib/parser'
|
||||
import type { DocFile, ParsedDoc } from '@/lib/types'
|
||||
import { config } from '@/config'
|
||||
|
||||
const modules = import.meta.glob('../docs/**/*.md', { as: 'raw', eager: true })
|
||||
const modules = import.meta.glob('../docs/api/**/*.md', { as: 'raw', eager: true })
|
||||
|
||||
const DOCS_FILES: Record<string, string> = Object.fromEntries(
|
||||
Object.entries(modules).map(([path, content]) => {
|
||||
const relativePath = path.replace('../docs/', '')
|
||||
return [relativePath, content as string]
|
||||
const relativePath = path.replace('../docs/api/', '')
|
||||
const fileContent = typeof content === 'string' ? content : ''
|
||||
return [relativePath, fileContent]
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user