| 1 | import path from "node:path"; |
| 2 | |
| 3 | import { createMDX } |
| 4 | import type { NextConfig |
| 5 | |
| 6 | /** Pages that moved into section folders, so links to the old flat URLs keep working. */ |
| 7 | const MOVED: [ |
| 8 | ["/self-hosting-configuration", "/self-hosting/configuration" |
| 9 | ["/about-ssh", "/ssh" |
| 10 | ["/generating-an-ssh-key", "/ssh/generating-a-key" |
| 11 | ["/adding-an-ssh-key-to-your-account", "/ssh/adding-a-key" |
| 12 | ["/testing-your-ssh-connection", "/ssh/testing-your-connection" |
| 13 | ["/using-ssh-with-a-repository", "/ssh/using-with-a-repository" |
| 14 | ["/troubleshooting-ssh", "/ssh/troubleshooting" |
| 15 | ["/about-commit-signature-verification", "/signing" |
| 16 | ["/generating-a-gpg-key", "/signing/generating-a-gpg-key" |
| 17 | ["/adding-a-gpg-key-to-your-account", "/signing/adding-a-gpg-key" |
| 18 | ["/telling-git-about-your-key", "/signing/telling-git-about-your-key" |
| 19 | ["/signing-commits-and-tags", "/signing/signing-commits-and-tags" |
| 20 | ["/email-addresses-and-keys", "/signing/email-addresses-and-keys" |
| 21 | ["/expiration-and-revocation", "/signing/expiration-and-revocation" |
| 22 | ["/troubleshooting", "/signing/troubleshooting" |
| 23 | [ |
| 24 | "/checking-out-pull-requests-locally", |
| 25 | "/pull-requests/checking-out-locally", |
| 26 | ], |
| 27 | ["/github-compatibility", "/github-cli" |
| 28 | ]; |
| 29 | |
| 30 | const nextConfig: NextConfig |
| 31 | // Emits `.next/standalone` with only the server and its used dependencies. |
| 32 | output: "standalone", |
| 33 | // The app lives in a workspace, so tracing has to start at the repo root. |
| 34 | outputFileTracingRoot: path.join |
| 35 | redirects: async () |
| 36 | MOVED.map(([ |
| 37 | source, |
| 38 | destination, |
| 39 | permanent: true, |
| 40 | })), |
| 41 | }; |
| 42 | |
| 43 | export default createMDX()(nextConfig |