Skip to content

Commit 5c69109

Browse files
authored
fix redirects (#1602)
* fix redirects * depend on vercel redirects * fix * fix * add key * prettier
1 parent 0bad5d0 commit 5c69109

File tree

5 files changed

+109
-103
lines changed

5 files changed

+109
-103
lines changed

gatsby-node.ts

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,7 @@ export const createPages: GatsbyNode["createPages"] = async ({
144144
actions,
145145
graphql,
146146
}) => {
147-
const { createPage, createRedirect } = actions
148-
149-
createRedirect({
150-
fromPath: `/conf/attendee/*`,
151-
toPath: `https://graphql-conf-attendee-nextjs.vercel.app/*`,
152-
statusCode: 200,
153-
})
147+
const { createPage } = actions
154148

155149
try {
156150
const schedAccessToken = process.env.SCHED_ACCESS_TOKEN
@@ -294,32 +288,6 @@ export const createPages: GatsbyNode["createPages"] = async ({
294288
console.log("CATCH ME:", error)
295289
}
296290

297-
createRedirect({
298-
fromPath: "/conf/program",
299-
toPath: "/conf/schedule",
300-
})
301-
302-
createRedirect({
303-
fromPath: "/conf/schedule/*",
304-
toPath: "/conf/sessions/*",
305-
})
306-
307-
// redirect swapi with 200
308-
createRedirect({
309-
fromPath: `/swapi-graphql/*`,
310-
toPath: `https://graphql.github.io/swapi-graphql/*`,
311-
statusCode: 200,
312-
})
313-
314-
// legacy 301 redirects from previous iterations of the site
315-
redirects.forEach(({ from, to }) => {
316-
createRedirect({
317-
fromPath: from,
318-
toPath: to,
319-
statusCode: 301,
320-
})
321-
})
322-
323291
const result = await graphql(`
324292
query allMarkdownRemark {
325293
allMarkdownRemark {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
},
1919
"packageManager": "yarn@1.22.19",
2020
"dependencies": {
21-
"react-medium-image-zoom": "5.1.8",
2221
"@graphql-tools/schema": "10.0.0",
2322
"@headlessui/react": "^1.7.17",
2423
"@heroicons/react": "^2.0.18",
@@ -50,6 +49,7 @@
5049
"react": "18.2.0",
5150
"react-dom": "18.2.0",
5251
"react-markdown": "^8.0.7",
52+
"react-medium-image-zoom": "5.1.8",
5353
"react-tooltip": "^5.18.1",
5454
"rehype-raw": "^6.1.1",
5555
"string-similarity": "^4.0.4",
@@ -66,9 +66,9 @@
6666
"autoprefixer": "10.4.14",
6767
"eslint": "8.42.0",
6868
"eslint-plugin-tailwindcss": "3.12.0",
69+
"gatsby-plugin-canonical-urls": "5.12.0",
6970
"gatsby-plugin-postcss": "6.10.0",
7071
"gatsby-plugin-svgr": "^3.0.0-beta.0",
71-
"gatsby-plugin-canonical-urls": "5.12.0",
7272
"postcss": "8.4.23",
7373
"prettier": "2.8.8",
7474
"tailwindcss": "3.3.2",

redirects.json

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/templates/event.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@ export const EventComponent: FC<{
142142

143143
<div className="py-8">
144144
{event.files?.map(({ path }) => (
145-
<>
145+
<div key={path}>
146146
<a href={path} target="_blank">
147147
View Full PDF{" "}
148148
<span className="font-sans font-light text-2xl"></span>
149149
</a>
150150
<iframe src={path} className="aspect-video w-full h-full" />
151-
</>
151+
</div>
152152
))}
153153
</div>
154154
</div>

vercel.json

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"redirects": [
3+
{
4+
"source": "/conf/attendee/:path*",
5+
"destination": "https://graphql-conf-attendee-nextjs.vercel.app/:path*",
6+
"statusCode": 200
7+
},
8+
{
9+
"source": "/conf/program",
10+
"destination": "/conf/schedule",
11+
"permanent": false
12+
},
13+
{
14+
"source": "/conf/schedule/:path*",
15+
"destination": "/conf/sessions/:path*",
16+
"permanent": false
17+
},
18+
{
19+
"source": "/swapi-graphql/:path*",
20+
"destination": "https://graphql.github.io/swapi-graphql/:path*",
21+
"statusCode": 200
22+
},
23+
{
24+
"source": "/docs/api-reference-errors",
25+
"destination": "/graphql-js/error/",
26+
"permanent": true
27+
},
28+
{
29+
"source": "/docs/api-reference-execution",
30+
"destination": "/graphql-js/execution/",
31+
"permanent": true
32+
},
33+
{
34+
"source": "/docs/api-reference-express-graphql",
35+
"destination": "/graphql-js/express-graphql/",
36+
"permanent": true
37+
},
38+
{
39+
"source": "/docs/api-reference-graphql",
40+
"destination": "/graphql-js/graphql/",
41+
"permanent": true
42+
},
43+
{
44+
"source": "/docs/api-reference-language",
45+
"destination": "/graphql-js/language/",
46+
"permanent": true
47+
},
48+
{
49+
"source": "/docs/api-reference-type-system",
50+
"destination": "/graphql-js/type/",
51+
"permanent": true
52+
},
53+
{
54+
"source": "/docs/api-reference-type-utilities",
55+
"destination": "/graphql-js/utilities/",
56+
"permanent": true
57+
},
58+
{
59+
"source": "/docs/api-reference-type-validation",
60+
"destination": "/graphql-js/validation/",
61+
"permanent": true
62+
},
63+
{
64+
"source": "/docs/getting-started",
65+
"destination": "/learn/",
66+
"permanent": true
67+
},
68+
{
69+
"source": "/docs/intro",
70+
"destination": "/learn/",
71+
"permanent": true
72+
},
73+
{
74+
"source": "/docs/introspection",
75+
"destination": "/learn/introspection/",
76+
"permanent": true
77+
},
78+
{
79+
"source": "/docs/queries",
80+
"destination": "/learn/queries/",
81+
"permanent": true
82+
},
83+
{
84+
"source": "/docs/typesystem",
85+
"destination": "/learn/schema/",
86+
"permanent": true
87+
},
88+
{
89+
"source": "/docs/validation",
90+
"destination": "/learn/validation/",
91+
"permanent": true
92+
},
93+
{
94+
"source": "/docs/videos",
95+
"destination": "/community/#videos/",
96+
"permanent": true
97+
},
98+
{
99+
"source": "/help",
100+
"destination": "/community/",
101+
"permanent": true
102+
}
103+
]
104+
}

0 commit comments

Comments
 (0)