mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-15 23:16:36 +00:00
Fix old /docs redirects
This commit is contained in:
@@ -1,43 +1,57 @@
|
|||||||
import nextMDX from '@next/mdx'
|
import nextMDX from '@next/mdx'
|
||||||
import { remarkPlugins } from './mdx/remark.mjs'
|
import {remarkPlugins} from './mdx/remark.mjs'
|
||||||
import { rehypePlugins } from './mdx/rehype.mjs'
|
import {rehypePlugins} from './mdx/rehype.mjs'
|
||||||
import { recmaPlugins } from './mdx/recma.mjs'
|
import {recmaPlugins} from './mdx/recma.mjs'
|
||||||
|
|
||||||
const withMDX = nextMDX({
|
const withMDX = nextMDX({
|
||||||
options: {
|
options: {
|
||||||
remarkPlugins,
|
remarkPlugins,
|
||||||
// rehypeSlug,
|
// rehypeSlug,
|
||||||
rehypePlugins,
|
rehypePlugins,
|
||||||
recmaPlugins,
|
recmaPlugins,
|
||||||
providerImportSource: '@mdx-js/react',
|
providerImportSource: '@mdx-js/react',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
assetPrefix: '/docs-static',
|
assetPrefix: '/docs-static',
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
|
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
|
||||||
experimental: {
|
experimental: {
|
||||||
scrollRestoration: true,
|
scrollRestoration: true,
|
||||||
},
|
},
|
||||||
rewrites: async () => {
|
redirects: async () => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
source: '/',
|
source: '/docs',
|
||||||
destination: '/introduction',
|
destination: '/',
|
||||||
},
|
permanent: true,
|
||||||
{
|
},
|
||||||
source: '/api',
|
{
|
||||||
destination: '/ipa/introduction',
|
source: '/docs/:path*',
|
||||||
},
|
destination: '/:path*',
|
||||||
{
|
permanent: true,
|
||||||
source: '/api/:path*',
|
}
|
||||||
destination: '/ipa/:path*',
|
]
|
||||||
}
|
},
|
||||||
]
|
rewrites: async () => {
|
||||||
}
|
return [
|
||||||
|
{
|
||||||
|
source: '/',
|
||||||
|
destination: '/introduction',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: '/api',
|
||||||
|
destination: '/ipa/introduction',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: '/api/:path*',
|
||||||
|
destination: '/ipa/:path*',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default withMDX(nextConfig)
|
export default withMDX(nextConfig)
|
||||||
|
|||||||
Reference in New Issue
Block a user