Skip to content

Commit 2e73d64

Browse files
committed
feat(docs): Add dropdown to link to previous docs
1 parent 014b236 commit 2e73d64

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

.pnp.cjs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/docusaurus/docusaurus.config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ require(`@yarnpkg/monorepo/scripts/setup-local-plugins`);
66

77
const fs = require(`fs`);
88

9+
const {YarnVersion} = require(`@yarnpkg/core`);
10+
911
const lightCodeTheme = require(`prism-react-renderer/themes/github`);
1012
const darkCodeTheme = require(`prism-react-renderer/themes/dracula`);
1113

@@ -73,6 +75,11 @@ const config = {
7375
},
7476
docs: {
7577
routeBasePath: `/`,
78+
versions: {
79+
current: {
80+
label: `master (${YarnVersion})`,
81+
},
82+
},
7683
sidebarPath: require.resolve(`./sidebars.js`),
7784
editUrl: `https://github.com/yarnpkg/berry/edit/master/packages/docusaurus/`,
7885
remarkPlugins,
@@ -145,6 +152,21 @@ const config = {
145152
label: `Blog`,
146153
position: `left`,
147154
},
155+
{
156+
type: `docsVersionDropdown`,
157+
position: `right`,
158+
dropdownActiveClassDisabled: true,
159+
dropdownItemsAfter: [
160+
{
161+
label: `3.6.4`,
162+
href: `https://v3.yarnpkg.com`,
163+
},
164+
{
165+
label: `1.22.19`,
166+
href: `https://classic.yarnpkg.com/en/docs`,
167+
},
168+
],
169+
},
148170
{
149171
href: `https://discord.gg/yarnpkg`,
150172
label: `Discord`,

packages/docusaurus/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@primer/octicons-react": "^17.7.0",
2323
"@types/three": "^0.144.0",
2424
"@yarnpkg/cli": "workspace:^",
25+
"@yarnpkg/core": "workspace:^",
2526
"@yarnpkg/parsers": "workspace:^",
2627
"algoliasearch": "^4.14.2",
2728
"clipanion": "^4.0.0-rc.2",

yarn.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5137,6 +5137,7 @@ __metadata:
51375137
"@types/semver": "npm:^7.1.0"
51385138
"@types/three": "npm:^0.144.0"
51395139
"@yarnpkg/cli": "workspace:^"
5140+
"@yarnpkg/core": "workspace:^"
51405141
"@yarnpkg/fslib": "workspace:^"
51415142
"@yarnpkg/libzip": "workspace:^"
51425143
"@yarnpkg/monorepo": "workspace:^"

0 commit comments

Comments
 (0)