Skip to content

Commit

Permalink
feat(docs): Add dropdown to link to previous docs
Browse files Browse the repository at this point in the history
  • Loading branch information
clemyan committed Oct 25, 2023
1 parent 32d2b5f commit b62c1b7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions packages/docusaurus/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ require(`@yarnpkg/monorepo/scripts/setup-local-plugins`);

const fs = require(`fs`);

const {YarnVersion} = require(`@yarnpkg/core`);

const lightCodeTheme = require(`prism-react-renderer/themes/github`);
const darkCodeTheme = require(`prism-react-renderer/themes/dracula`);

Expand Down Expand Up @@ -73,6 +75,11 @@ const config = {
},
docs: {
routeBasePath: `/`,
versions: {
current: {
label: `master (${YarnVersion})`,
},
},
sidebarPath: require.resolve(`./sidebars.js`),
editUrl: `https://github.com/yarnpkg/berry/edit/master/packages/docusaurus/`,
remarkPlugins,
Expand Down Expand Up @@ -145,6 +152,21 @@ const config = {
label: `Blog`,
position: `left`,
},
{
type: `docsVersionDropdown`,
position: `right`,
dropdownActiveClassDisabled: true,
dropdownItemsAfter: [
{
label: `3.6.4`,
href: `https://v3.yarnpkg.com`,
},
{
label: `1.22.19`,
href: `https://classic.yarnpkg.com/en/docs`,
},
],
},
{
href: `https://discord.gg/yarnpkg`,
label: `Discord`,
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@primer/octicons-react": "^17.7.0",
"@types/three": "^0.144.0",
"@yarnpkg/cli": "workspace:^",
"@yarnpkg/core": "workspace:^",
"@yarnpkg/parsers": "workspace:^",
"algoliasearch": "^4.14.2",
"clipanion": "^4.0.0-rc.2",
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5137,6 +5137,7 @@ __metadata:
"@types/semver": "npm:^7.1.0"
"@types/three": "npm:^0.144.0"
"@yarnpkg/cli": "workspace:^"
"@yarnpkg/core": "workspace:^"
"@yarnpkg/fslib": "workspace:^"
"@yarnpkg/libzip": "workspace:^"
"@yarnpkg/monorepo": "workspace:^"
Expand Down

0 comments on commit b62c1b7

Please sign in to comment.