File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
docs/dokka-presets/scripts Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,15 @@ function extractModulePath(href) {
1616
1717 // the URL pattern is always ".../kotlin/api/<version>/..."
1818 const apiIndex = segments . indexOf ( 'api' ) ;
19- if ( apiIndex === - 1 ) return null ;
2019
21- // segment after "api" is the version ("latest", "1.4.109", etc.)
22- // segment after _that_ is the module name (or "index.html" if we're at the root)
23- return segments [ apiIndex + 2 ] ?? 'index.html' ;
20+ if ( apiIndex !== - 1 ) {
21+ // segment after "api" is the version ("latest", "1.4.109", etc.)
22+ // segment after _that_ is the module name (or "index.html" if we're at the root)
23+ return segments [ apiIndex + 2 ] ?? 'index.html' ;
24+ }
25+
26+ // locally-hosted docs don't have /kotlin/api segment
27+ return segments [ 0 ] ?? 'index.html' ;
2428 } catch {
2529 return null ;
2630 }
You can’t perform that action at this time.
0 commit comments