tldraw/apps/docs/next.config.js
Mime Čuvalo 63e3d6dfc9
docs: more cleanup following restructure (#2702)
- add TOC for Reference section
- make external links use _blank to open a new tab
- fix some more /gen links spots I missed, oops
- add a general redirect from old /gen links → /reference
- some more stylistic touchups

### Change Type

- [x] `documentation` — Changes to the documentation only[^2]

### Release Notes

- Docs: further cleanup following restructure.
2024-02-01 14:16:17 +00:00

70 lines
1.7 KiB
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
experimental: {
scrollRestoration: true,
},
transpilePackages: [],
async redirects() {
return [
{
// For reverse compatibility with old links
source: '/:sectionId/ucg/:articleId',
destination: '/:sectionId/:articleId',
permanent: true,
},
{
// For reverse compatibility with old links
source: '/docs/introduction',
destination: '/quick-start',
permanent: true,
},
{
// For reverse compatibility with old links
source: '/introduction',
destination: '/quick-start',
permanent: true,
},
{
// For reverse compatibility with old links
source: '/docs/installation',
destination: '/installation',
permanent: true,
},
{
// For reverse compatibility with old links
source: '/docs/usage',
destination: '/usage',
permanent: true,
},
{
// To reflect that these are at the top level of the sidebar
source: '/getting-started/:childId',
destination: '/:childId',
permanent: true,
},
{
// For reverse compatibility with old links
// (This is a page that we referred people to quite often)
source: '/gen/editor/Editor-class',
destination: '/reference/editor/Editor',
permanent: true,
},
{
// For reverse compatibility with old links
// (This is a page that we referred people to quite often)
source: '/gen/editor/ShapeUtil-class',
destination: '/reference/editor/ShapeUtil',
permanent: true,
},
{
// For reverse compatibility with old links
source: '/gen/:slug*',
destination: '/reference/:slug*',
permanent: true,
},
]
},
}
module.exports = nextConfig