Repository navigation
Expand file tree
/
Copy pathnext.config.mjs
More file actions
48 lines (44 loc) · 1.67 KB
/
Copy pathnext.config.mjs
File metadata and controls
48 lines (44 loc) · 1.67 KB
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
import { createMDX } from 'fumadocs-mdx/next';
const withMDX = createMDX();
// Preserve bookmarks to retired Platform features in both supported languages.
const retiredPlatformPages = [
['/apis/platform-api/reference/devnet/:path*', 'https://docs.stacks.co/reference'],
['/apis/platform-api/:path*', '/apis/chainhooks-api'],
['/tools/contract-monitoring/:path*', '/tools/chainhooks'],
['/contract-monitoring/:path*', '/tools/chainhooks'],
['/tools/chainhooks/platform-usage', '/tools/chainhooks/introduction'],
['/tools/chainhooks/platform-quickstart', '/tools/chainhooks/create'],
['/tools/chainhooks/create-enable-chainhooks', '/tools/chainhooks/create'],
['/tools/chainhooks/view-chainhooks', '/tools/chainhooks/fetch'],
['/tools/chainhooks/manage-api-keys', '/resources/guides/api-keys'],
];
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
// Remove Webpack customization – not supported in Turbopack
turbopack: {
// Add any Turbopack-specific options here (currently optional)
},
redirects: async () => {
return [
...retiredPlatformPages.flatMap(([source, destination]) =>
['', '/en', '/es'].map((locale) => ({
source: `${locale}${source}`,
destination: destination.startsWith('/') ? `${locale}${destination}` : destination,
permanent: true,
})),
),
{
source: '/start',
destination: '/',
permanent: false,
},
{
source: '/.well-known/llms.txt',
destination: '/llms.txt',
permanent: true, // 301 redirect - tells crawlers this is the canonical location
},
];
},
};
export default withMDX(config);