Skip to content

Commit db41751

Browse files
authored
Merge pull request #271 from wpengine/chore-add-old-site-redirects
chore: Add redirects
2 parents 90f71fe + ee8b87b commit db41751

File tree

3 files changed

+616
-130
lines changed

3 files changed

+616
-130
lines changed

next.config.mjs

Lines changed: 17 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,23 @@ import rehypeMdxImportMedia from "rehype-mdx-import-media";
99
import { rehypePrettyCode } from "rehype-pretty-code";
1010
import rehypeSlug from "rehype-slug";
1111
import remarkGfm from "remark-gfm";
12+
import redirectsOldSite from "./redirects-old-site.js";
1213
import smartSearchPlugin from "./src/lib/smart-search-plugin.mjs";
14+
15+
const newRedirects = [
16+
{
17+
source: "/discord",
18+
destination: "https://discord.gg/headless-wordpress-836253505944813629",
19+
permanent: false,
20+
},
21+
{
22+
source: "/community-meeting",
23+
destination:
24+
"https://discord.gg/headless-wordpress-836253505944813629?event=1336404483013480588",
25+
permanent: false,
26+
},
27+
];
28+
1329
/**
1430
* @type {import('next').NextConfig}
1531
*/
@@ -24,135 +40,7 @@ const nextConfig = {
2440
ignoreDuringBuilds: true,
2541
},
2642
redirects() {
27-
return [
28-
{
29-
source: "/guide/how-to-create-a-block-from-a-third-party-plugin",
30-
destination: "/docs/how-to/custom-blocks/",
31-
permanent: true,
32-
},
33-
{
34-
source: "/guide/how-to-create-a-block-from-the-wordpress-blocks-list",
35-
destination: "/docs/how-to/custom-blocks/",
36-
permanent: true,
37-
},
38-
{
39-
source: "/guide/how-to-migrate-from-legacy-faust",
40-
destination: "/docs/how-to/migrate-from-legacy-faust/",
41-
permanent: true,
42-
},
43-
{
44-
source: "/tutorial/get-started-with-wp-graphql-content-blocks",
45-
destination: "/docs/how-to/rendering-blocks/",
46-
permanent: true,
47-
},
48-
{
49-
source: "/tutorial/react-components-to-gutenberg-blocks",
50-
destination: "/docs/how-to/react-components-to-blocks/",
51-
permanent: true,
52-
},
53-
{
54-
source: "/guide/how-to-use-sitemaps",
55-
destination: "/docs/how-to/sitemaps/",
56-
permanent: true,
57-
},
58-
{
59-
source: "/guide/how-to-customize-the-toolbar",
60-
destination: "/docs/how-to/customize-the-toolbar/",
61-
permanent: true,
62-
},
63-
{
64-
source: "/guide/setting-up-custom-post-types-cpts-in-faust",
65-
destination: "/docs/how-to/setup-cpt-in-faustjs/",
66-
permanent: true,
67-
},
68-
{
69-
source: "/guide/how-to-create-a-plugin",
70-
destination: "/docs/how-to/create-a-plugin/",
71-
permanent: true,
72-
},
73-
{
74-
source: "/guide/how-to-use-apollo-in-faust",
75-
destination: "/docs/how-to/use-wpgraphql-smart-cache/",
76-
permanent: true,
77-
},
78-
{
79-
source: "/guide/how-to-migrate-from-wp-graphql-gutenberg",
80-
destination: "/docs/explanation/migrate-from-wp-graphql-gutenberg/",
81-
permanent: true,
82-
},
83-
{
84-
source: "/guide/how-to-setup-post-and-page-previews",
85-
destination: "/docs/how-to/post-previews/",
86-
permanent: true,
87-
},
88-
{
89-
source: "/guide/how-to-handle-authentication",
90-
destination: "/docs/how-to/authentication/",
91-
permanent: true,
92-
},
93-
{
94-
source: "/guide/how-to-implement-typescript",
95-
destination: "/docs/how-to/generate-types-with-graphql-codegen/",
96-
permanent: true,
97-
},
98-
{
99-
source: "/guide/how-to-register-decoupled-blocks",
100-
destination: "/docs/reference/blockset/",
101-
permanent: true,
102-
},
103-
{
104-
source: "/tutorial/get-started-with-wp-graphql-content-blocks",
105-
destination: "/docs/how-to/rendering-blocks/",
106-
permanent: true,
107-
},
108-
{
109-
source: "/tutorial/getting-started-with-the-experimental-app-router",
110-
destination:
111-
"https://github.com/wpengine/faustjs/blob/archive-experimental-app-router/packages/experimental-app-router/docs/getting-started.md",
112-
permanent: true,
113-
},
114-
{
115-
source: "/reference/faustroutehandler",
116-
destination:
117-
"https://github.com/wpengine/faustjs/blob/archive-experimental-app-router/packages/experimental-app-router/docs/faustroutehandler.md",
118-
permanent: true,
119-
},
120-
{
121-
source: "/reference/getauthclient",
122-
destination:
123-
"https://github.com/wpengine/faustjs/blob/archive-experimental-app-router/packages/experimental-app-router/docs/getauthclient.md",
124-
permanent: true,
125-
},
126-
{
127-
source: "/reference/getclient",
128-
destination:
129-
"https://github.com/wpengine/faustjs/blob/archive-experimental-app-router/packages/experimental-app-router/docs/getclient.md",
130-
permanent: true,
131-
},
132-
{
133-
source: "/reference/onlogin-server-action",
134-
destination:
135-
"https://github.com/wpengine/faustjs/blob/archive-experimental-app-router/packages/experimental-app-router/docs/onlogin-server-action.md",
136-
permanent: true,
137-
},
138-
{
139-
source: "/reference/onlogout-server-action",
140-
destination:
141-
"https://github.com/wpengine/faustjs/blob/archive-experimental-app-router/packages/experimental-app-router/docs/onlogout-server-action.md",
142-
permanent: true,
143-
},
144-
{
145-
source: "/discord",
146-
destination: "https://discord.gg/headless-wordpress-836253505944813629",
147-
permanent: false,
148-
},
149-
{
150-
source: "/community-meeting",
151-
destination:
152-
"https://discord.gg/headless-wordpress-836253505944813629?event=1336404483013480588",
153-
permanent: false,
154-
},
155-
];
43+
return [...redirectsOldSite, ...newRedirects];
15644
},
15745
images: {
15846
remotePatterns: [

0 commit comments

Comments
 (0)