File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -73,12 +73,18 @@ function generatePreviewPath(filepath) {
7373 . replace ( / \/ R E A D M E \. m d $ / , '' ) // READMEの場合はディレクトリのみ
7474 . replace ( / \. m d $ / , '' ) ;
7575
76- // reference 配下の特殊なパス変換
77- if ( basePath === 'reference/press-kit' ) {
78- return 'press-kit' ;
79- }
80- if ( basePath === 'reference/roadmap' ) {
81- return 'roadmap' ;
76+ // reference 配下の特殊なパス変換: reference/ プレフィックスを削除
77+ const referenceTopLevelPaths = [ 'press-kit' , 'roadmap' , 'cli' ] ;
78+ if ( basePath . startsWith ( 'reference/' ) ) {
79+ const subPath = basePath . replace ( 'reference/' , '' ) ;
80+ // トップレベルパス(press-kit, roadmap, cli)
81+ if ( referenceTopLevelPaths . includes ( subPath ) ) {
82+ return subPath ;
83+ }
84+ // サブディレクトリパス(errors/*, extended-diagnostics/*)
85+ if ( subPath . startsWith ( 'errors/' ) || subPath . startsWith ( 'extended-diagnostics/' ) ) {
86+ return subPath ;
87+ }
8288 }
8389
8490 // チュートリアルの特殊なパス変換
You can’t perform that action at this time.
0 commit comments