@@ -60,7 +60,12 @@ const config = {
6060 [
6161 './component-docs-plugin' ,
6262 {
63- docsRootDir : path . join ( __dirname , 'docs' , 'components' ) ,
63+ docsRootDir : path . join (
64+ __dirname ,
65+ 'versioned_docs' ,
66+ 'version-6.x' ,
67+ 'components'
68+ ) ,
6469 libsRootDir : path . join ( __dirname , '..' , 'src' , 'components' ) ,
6570 pages : {
6671 ActivityIndicator : 'ActivityIndicator' ,
@@ -195,12 +200,24 @@ const config = {
195200 ( {
196201 docs : {
197202 sidebarPath : require . resolve ( './sidebars.js' ) ,
203+ includeCurrentVersion : false ,
204+ lastVersion : '5.x' ,
205+ versions : {
206+ '6.x' : {
207+ label : '6.x' ,
208+ banner : 'unreleased' ,
209+ } ,
210+ '5.x' : {
211+ label : '5.x' ,
212+ banner : 'none' ,
213+ } ,
214+ } ,
198215 editUrl : ( params ) => {
199216 const urlToMain =
200217 'https://github.com/callstack/react-native-paper/tree/main' ;
201218
202219 if ( params . docPath . includes ( 'guides' ) ) {
203- return `${ urlToMain } /docs/docs /${ params . docPath } ` ;
220+ return `${ urlToMain } /docs/${ params . versionDocsDirPath } /${ params . docPath } ` ;
204221 }
205222
206223 const customUrls = {
@@ -260,24 +277,23 @@ const config = {
260277 label : 'Showcase' ,
261278 } ,
262279 {
263- type : 'dropdown' ,
264- label : 'v5.x' ,
280+ type : 'docsVersionDropdown' ,
265281 position : 'right' ,
266- items : [
282+ dropdownItemsAfter : [
267283 {
268- label : 'v4 .x' ,
284+ label : '4 .x' ,
269285 href : `${ publicUrl } 4.0/` ,
270286 } ,
271287 {
272- label : 'v3 .x' ,
288+ label : '3 .x' ,
273289 href : `${ publicUrl } 3.0/` ,
274290 } ,
275291 {
276- label : 'v2 .x' ,
292+ label : '2 .x' ,
277293 href : `${ publicUrl } 2.0/` ,
278294 } ,
279295 {
280- label : 'v1 .x' ,
296+ label : '1 .x' ,
281297 href : `${ publicUrl } 1.0/` ,
282298 } ,
283299 ] ,
0 commit comments