Skip to content

Commit 8dee4ec

Browse files
docs(nx-dev): add redirects for astro docs (#32372)
add new redirects file redirect root to the intro page redirect legacy showcase projects to quickstart until those projects get updated closes: DOC-94 closes: DOC-114
1 parent b5439b9 commit 8dee4ec

4 files changed

Lines changed: 43 additions & 0 deletions

File tree

astro-docs/astro.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ import react from '@astrojs/react';
77
import markdoc from '@astrojs/markdoc';
88
import tailwindcss from '@tailwindcss/vite';
99
import { sidebar } from './sidebar.mts';
10+
import { redirects } from './redirects.mts';
1011

1112
// https://astro.build/config
1213
export default defineConfig({
1314
vite: { plugins: [tailwindcss()] },
1415
site: 'https://docs.nx.dev',
1516
adapter: netlify(),
17+
redirects,
1618
integrations: [
1719
markdoc(),
1820
starlight({

astro-docs/project.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,23 @@
2222
"target": "build"
2323
}
2424
],
25+
"outputs": [
26+
"{projectRoot}/dist",
27+
"{projectRoot}/.astro",
28+
"{projectRoot}/.netlify"
29+
],
2530
"command": "astro build",
2631
"options": {
2732
"cwd": "astro-docs"
2833
}
2934
},
35+
"preview": {
36+
"dependsOn": ["build"],
37+
"command": "astro preview",
38+
"options": {
39+
"cwd": "astro-docs"
40+
}
41+
},
3042
"astro": {
3143
"command": "astro",
3244
"options": {

astro-docs/redirects.mts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
export const redirects = {
2+
'/': '/getting-started/intro',
3+
'/showcase': '/quickstart',
4+
// astro doesn't seem to allow configuing catch all redirect routes
5+
// so hard code each previous route to the redirect for now
6+
// '/showcase/[...slug]': '/quickstart',
7+
'/showcase/example-repos': '/quickstart',
8+
'/showcase/example-repos/add-express': '/quickstart',
9+
'/showcase/example-repos/add-lit': '/quickstart',
10+
'/showcase/example-repos/add-solid': '/quickstart',
11+
'/showcase/example-repos/add-qwik': '/quickstart',
12+
'/showcase/example-repos/add-rust': '/quickstart',
13+
'/showcase/example-repos/add-dotnet': '/quickstart',
14+
'/showcase/example-repos/add-astro': '/quickstart',
15+
'/showcase/example-repos/add-svelte': '/quickstart',
16+
'/showcase/example-repos/add-fastify': '/quickstart',
17+
'/showcase/example-repos/apollo-react': '/quickstart',
18+
'/showcase/example-repos/nestjs-prisma': '/quickstart',
19+
'/showcase/example-repos/mongo-fastify': '/quickstart',
20+
'/showcase/example-repos/redis-fastify': '/quickstart',
21+
'/showcase/example-repos/postgres-fastify': '/quickstart',
22+
'/showcase/example-repos/serverless-fastify-planetscale': '/quickstart',
23+
'/showcase/example-repos/mfe': '/quickstart',
24+
'/showcase/benchmarks': '/references/benchmarks',
25+
'/showcase/benchmarks/tsc-batch-mode':
26+
'/references/benchmarks/tsc-batch-mode',
27+
'/showcase/benchmarks/caching': '/references/benchmarks/caching',
28+
'/showcase/benchmarks/nx-agents': '/references/benchmarks/nx-agents',
29+
};
File renamed without changes.

0 commit comments

Comments
 (0)