starlight-auto-sidebar
Version:
Starlight plugin to tweak autogenerated sidebar entries.
16 lines (13 loc) • 385 B
text/typescript
import { glob, type Loader } from 'astro/loaders'
import { getRelativeSrcDir } from './libs/astro'
export function autoSidebarLoader(): Loader {
return {
name: 'starlight-auto-sidebar-loader',
load: (context) => {
return glob({
base: `${getRelativeSrcDir(context.config)}content/docs`,
pattern: `**/_meta.y?(a)ml`,
}).load(context)
},
}
}