@@ -174,7 +174,7 @@ export function libsPlugin(opts: LibsLoaderOptions): StarlightPlugin {
174
174
const id = name . startsWith ( '@' ) ? name . split ( '/' ) [ 1 ] : name ;
175
175
const outputRootDir = path . resolve ( outDir , id ) ;
176
176
const outputApiDir = path . resolve ( outputRootDir , 'api' ) ;
177
- const title = titleFromId ( id ) ;
177
+ const title = titleFromIdCapitalized ( id ) ;
178
178
179
179
await processMarkdown ( {
180
180
inputPath : path . resolve ( baseDir , id , 'README.md' ) ,
@@ -233,7 +233,7 @@ export function libsPlugin(opts: LibsLoaderOptions): StarlightPlugin {
233
233
for ( const file of opts . additionalFiles || [ ] ) {
234
234
const fileName = path . basename ( file . path ) . toLowerCase ( ) ;
235
235
const id = idFromFilename ( fileName ) ;
236
- const title = titleFromId ( id ) ;
236
+ const title = titleFromIdCapitalized ( id ) ;
237
237
238
238
await processMarkdown ( {
239
239
inputPath : path . resolve ( file . path ) ,
@@ -276,7 +276,11 @@ function titleFromFilename(fileName: string): string {
276
276
}
277
277
278
278
function titleFromId ( id : string ) : string {
279
- return id . replace ( / - / g, ' ' ) . replace ( / \b \w / g, char => char . toUpperCase ( ) ) ;
279
+ return id . replace ( / - / g, ' ' ) ;
280
+ }
281
+
282
+ function titleFromIdCapitalized ( id : string ) : string {
283
+ return titleFromId ( id ) . replace ( / \b \w / g, char => char . toUpperCase ( ) ) ;
280
284
}
281
285
282
286
interface ProcessMarkdownOpts {
0 commit comments