File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { PfeConfig } from '../config.js' ;
2+ import { getPfeConfig } from '../config.js' ;
23import { Manifest } from '../custom-elements-manifest/lib/Manifest.js' ;
34
45import slugify from 'slugify' ;
@@ -20,12 +21,14 @@ export class DocsPage {
2021 summary ?: string | null ;
2122 docsTemplatePath ?: string ;
2223 constructor ( public manifest : Manifest , options ?: DocsPageOptions ) {
24+ const config = getPfeConfig ( options ?. rootDir ) ;
2325 this . tagName = options ?. tagName ?? '' ;
2426 this . title = options ?. title ?? Manifest . prettyTag ( this . tagName ) ;
2527 this . docsTemplatePath = options ?. docsTemplatePath ;
2628 this . summary = this . manifest . getSummary ( this . tagName ) ;
2729 this . description = this . manifest . getDescription ( this . tagName ) ;
28- const aliased = options ?. aliases ?. [ this . tagName ] ?? this . tagName . replace ( / ^ \w + - / , '' ) ;
30+ const prefix = `${ config . tagPrefix . replace ( / - $ / , '' ) } -` ;
31+ const aliased = config . aliases [ this . tagName ] ?? this . tagName . replace ( prefix , '' ) ;
2932 this . slug = slugify ( aliased , { strict : true , lower : true } ) ;
3033 }
3134}
You can’t perform that action at this time.
0 commit comments