File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
src/components/versionSelector Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,10 @@ export default async function Page({params}: {params: {path?: string[]}}) {
109109 }
110110 const { mdxSource, frontMatter} = doc ;
111111
112+ // collect versioned files
112113 const versions = ( await getDocsFrontMatter ( ) )
113- . filter ( docc => {
114- return docc . slug . includes ( '__v' ) && docc . slug . includes ( pageNode . path ) ;
114+ . filter ( ( { slug } ) => {
115+ return slug . includes ( '__v' ) && slug . includes ( pageNode . path . split ( '__v' ) [ 0 ] ) ;
115116 } )
116117 . map ( ( { slug} ) => {
117118 const segments = slug . split ( '__v' ) ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export function VersionSelector({versions}: {versions: string[]}) {
3434 return pathname ?. split ( VERSION_INDICATOR ) [ 0 ] ;
3535 }
3636
37- return `${ stripTrailingSlash ( pathname ) } ${ VERSION_INDICATOR } ${ version } ` ;
37+ return `${ stripTrailingSlash ( pathname . split ( VERSION_INDICATOR ) [ 0 ] ) } ${ VERSION_INDICATOR } ${ version } ` ;
3838 }
3939
4040 return '' ;
You can’t perform that action at this time.
0 commit comments