File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 16
16
const siteConfig = require ( `${ CWD } /siteConfig.js` ) ;
17
17
const versions = require ( `${ CWD } /versions.json` ) ;
18
18
19
+ const versionToReleaseTags = {
20
+ '5.x' : '5.0.0' ,
21
+ '6.x' : '6.0.0' ,
22
+ '7.x' : '7.0.0-beta.0'
23
+ }
24
+
19
25
function Versions ( ) {
20
26
const latestVersion = versions [ 0 ] ;
21
27
const repoUrl = `https://github.com/${ siteConfig . organizationName } /${
22
28
siteConfig . projectName
23
29
} `;
24
- const releaseTagUrl = version => `${ repoUrl } /releases/tag/v${ version } `
30
+ const releaseTagUrl = version => versionToReleaseTags . hasOwnProperty ( version ) ? ` ${ repoUrl } /releases/tag/v ${ versionToReleaseTags [ version ] } ` : `${ repoUrl } /releases/tag/v${ version } `
25
31
return (
26
32
< div className = "docMainWrapper wrapper" >
27
33
< Container className = "mainContainer versionsContainer" >
48
54
This is the version that is configured automatically when you first
49
55
install this project.
50
56
</ p >
51
- { /* uncomment here if we have pre-release notes
52
- <h3 id="rc">Pre-release versions</h3>
57
+ {
58
+ ! ! siteConfig . nextVersion && ( < React . Fragment >
59
+ < h3 id = "rc" > Pre-release versions</ h3 >
53
60
< table className = "versions" >
54
61
< tbody >
55
62
< tr >
62
69
</ td >
63
70
</ tr >
64
71
</ tbody >
65
- </table> */ }
72
+ </ table >
73
+ </ React . Fragment > )
74
+ }
66
75
< h3 id = "archive" > Past Versions</ h3 >
67
76
< table className = "versions" >
68
77
< tbody >
69
78
{ versions . map (
70
79
version =>
71
80
version !== latestVersion && (
72
- < tr >
81
+ < tr key = { `version- ${ version } ` } >
73
82
< th > { version } </ th >
74
83
< td >
75
84
< a href = { `${ version } /introduction/quick-start` } > Documentation</ a >
Original file line number Diff line number Diff line change @@ -98,7 +98,14 @@ const siteConfig = {
98
98
// template. For example, if you need your repo's URL...
99
99
repoUrl : "https://github.com/reduxjs/react-redux" ,
100
100
101
- // nextVersion: "6.0.0",
101
+ /**
102
+ * Note:
103
+ * This will generate a link on the versioned docs page for "pre-release versions"
104
+ * Once next version is released, run "yarn run version 7.x", and docusaurus will add 7.x to stable version
105
+ * After that, 7.x will no longer appear in "pre-release" versions and we should remove this line
106
+ * More info: https://docusaurus.io/docs/en/versioning
107
+ */
108
+ nextVersion : "7.x" ,
102
109
103
110
gaTrackingId : "UA-130598673-2" ,
104
111
} ;
You can’t perform that action at this time.
0 commit comments