-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathnext.config.mjs
50 lines (40 loc) · 1.97 KB
/
next.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import nextMDX from '@next/mdx'
import { recmaPlugins } from './src/mdx/recma.mjs'
import { rehypePlugins } from './src/mdx/rehype.mjs'
import { remarkPlugins } from './src/mdx/remark.mjs'
import withSearch from './src/mdx/search.mjs'
const withMDX = nextMDX({
options: {
remarkPlugins,
rehypePlugins,
recmaPlugins,
},
})
const redirects = async () => {
return [
// LETS GO DISCORD WAHOO
{ source: '/discord', destination: 'https://discord.gg/DpmJgtU7cW', basePath: false, permanent: false, },
// transition from protocols in docs section to protocols registry
{ source: '/docs/protocols/docs', destination: '/proto/iroh-docs', permanent: true, },
{ source: '/docs/protocols/blobs', destination: '/proto/iroh-blobs', permanent: true, },
{ source: '/docs/protocols/gossip', destination: '/proto/iroh-gossip', permanent: true, },
{ source: '/docs/protocols/net', destination: '/docs/overview', permanent: true, },
{ source: '/docs/api', destination: '/docs/sdks', permanent: true, },
{ source: '/docs/api/:slug', destination: '/docs/sdks', permanent: true, },
// there's no more CLI to install. Instead, lead people towards general iroh docs
{ source: '/docs/install', destination: '/docs', permanent: true, },
// Reported at https://github.com/n0-computer/iroh.computer/issues/222
// Some redirects
{ source: '/docs/components/networking', destination: '/docs/overview', permanent: true },
{ source: '/docs/components/net', destination: '/docs/overview', permanent: true },
{ source: '/docs/layers/blobs', destination: '/proto/iroh-blobs', permanent: true },
{ source: '/docs/layers/gossip', destination: '/proto/iroh-gossip', permanent: true },
{ source: '/docs/layers/documents', destination: '/proto/iroh-docs', permanent: true },
]
}
/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
redirects,
}
export default withSearch(withMDX(nextConfig))