Skip to content

Commit

Permalink
redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
thejcannon committed Dec 22, 2023
1 parent 3242e2b commit 1b71bcf
Show file tree
Hide file tree
Showing 9 changed files with 18,725 additions and 52 deletions.
24 changes: 22 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import versions from "./versions.json";
import redirects from "./redirects.js";
import captionedCode from "./src/remark/captioned-code.js";

import { themes as prismThemes } from "prism-react-renderer";
Expand Down Expand Up @@ -42,13 +43,15 @@ const config = {
organizationName: "pantsbuild",
projectName: "pantsbuild.org",

onBrokenLinks: isDev ? "warn" : "throw",
onBrokenMarkdownLinks: isDev ? "warn" : "throw",
// @TODO: This should throw on prod
onBrokenLinks: isDev ? "warn" : "warn",
onBrokenMarkdownLinks: isDev ? "warn" : "warn",

presets: [
[
"@docusaurus/preset-classic",
{
debug: process.env.NODE_ENV !== "production",
docs: {
sidebarPath: require.resolve("./sidebars.js"),
routeBasePath: "/",
Expand Down Expand Up @@ -274,6 +277,23 @@ const config = {
darkTheme: prismThemes.nightOwl,
},
},
plugins: [
[
"@docusaurus/plugin-client-redirects",
{
redirects: [
{
from: "/v2.20/docs/welcome-to-pants",
to: "/2.20.x/docs/introduction/welcome-to-pants",
},
{
from: "/FOO",
to: "/2.20.x/docs",
},
],
},
],
],
};

module.exports = config;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"dependencies": {
"@docusaurus/core": "^3.0.0",
"@docusaurus/plugin-client-redirects": "^3.0.1",
"@docusaurus/preset-classic": "^3.0.0",
"@mdx-js/react": "^3.0.0",
"clsx": "^1.2.1",
Expand Down
Loading

0 comments on commit 1b71bcf

Please sign in to comment.