File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
packages/nimiq-vitepress-theme/src/composables Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,14 @@ export function useCurrentModule() {
77
88 const route = useRoute ( )
99
10- const baseUrl = withBase ( '/' ) . slice ( 0 , - 1 )
11- const currentPageNoBase = computed ( ( ) => route . path . slice ( baseUrl . length ) )
12-
1310 const currentDocModule = computed < NimiqVitepressThemeNav > ( ( ) => {
14- return theme . value . modules . find ( module => currentPageNoBase . value . startsWith ( module . subpath ) ) || theme . value . modules [ 0 ]
11+ const module = theme . value . modules . find ( module => route . path . startsWith ( withBase ( `/${ module . subpath } ` ) ) ) || theme . value . modules [ 0 ] ;
12+ return module ;
1513 } )
1614
1715 return {
1816 currentDocModule,
19- text : computed ( ( ) => currentDocModule . value . text ) ,
20- fullPath : computed ( ( ) => withBase ( currentDocModule . value . subpath ) ) ,
17+ text : computed ( ( ) => currentDocModule . value ? .text ) ,
18+ fullPath : computed ( ( ) => currentDocModule . value ? withBase ( currentDocModule . value . subpath ) : '' ) ,
2119 }
2220}
You can’t perform that action at this time.
0 commit comments