From 786fa524b9d486eb7cb1589a613c37d2bd60e29f Mon Sep 17 00:00:00 2001 From: YassinEldeeb Date: Tue, 2 Jan 2024 15:58:27 +0200 Subject: [PATCH 1/6] fix redirects --- gatsby-config.ts | 1 + package.json | 5 +++-- yarn.lock | 28 ++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/gatsby-config.ts b/gatsby-config.ts index a84f9f222d..a4b04dcfa3 100644 --- a/gatsby-config.ts +++ b/gatsby-config.ts @@ -11,6 +11,7 @@ const config: GatsbyConfig = { typesOutputPath: `src/__generated__/gatsby-types.d.ts`, }, plugins: [ + "gatsby-plugin-meta-redirect", "gatsby-plugin-postcss", "gatsby-plugin-svgr", "gatsby-plugin-anchor-links", diff --git a/package.json b/package.json index 29a217ff6c..db061f3aa9 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ }, "packageManager": "yarn@1.22.19", "dependencies": { - "react-medium-image-zoom": "5.1.8", "@graphql-tools/schema": "10.0.0", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", @@ -37,6 +36,7 @@ "gatsby-plugin-feed": "5.10.0", "gatsby-plugin-google-analytics": "5.10.0", "gatsby-plugin-less": "7.10.0", + "gatsby-plugin-meta-redirect": "^1.1.1", "gatsby-plugin-webfonts": "2.3.2", "gatsby-source-filesystem": "5.10.0", "gatsby-transformer-remark": "6.10.0", @@ -50,6 +50,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-markdown": "^8.0.7", + "react-medium-image-zoom": "5.1.8", "react-tooltip": "^5.18.1", "rehype-raw": "^6.1.1", "string-similarity": "^4.0.4", @@ -66,9 +67,9 @@ "autoprefixer": "10.4.14", "eslint": "8.42.0", "eslint-plugin-tailwindcss": "3.12.0", + "gatsby-plugin-canonical-urls": "5.12.0", "gatsby-plugin-postcss": "6.10.0", "gatsby-plugin-svgr": "^3.0.0-beta.0", - "gatsby-plugin-canonical-urls": "5.12.0", "postcss": "8.4.23", "prettier": "2.8.8", "tailwindcss": "3.3.2", diff --git a/yarn.lock b/yarn.lock index 52051c770a..5f8a8e9698 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6307,6 +6307,15 @@ fs-extra@^11.1.1: jsonfile "^6.0.1" universalify "^2.0.0" +fs-extra@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-extra@^9.0.0: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" @@ -6524,6 +6533,13 @@ gatsby-plugin-less@7.10.0: "@babel/runtime" "^7.20.13" less-loader "^6.2.0" +gatsby-plugin-meta-redirect@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/gatsby-plugin-meta-redirect/-/gatsby-plugin-meta-redirect-1.1.1.tgz#058e8e53edff38dc44d3bb6153109d01c910f863" + integrity sha512-Oc4qgU3SlDUM9qoxIMKO+re2bdMs3/a2KXrfL65gb8XMLsHylBbveWtXZRhgjd2QDL/49RX4S9SEykuadRju2w== + dependencies: + fs-extra "^7.0.0" + gatsby-plugin-page-creator@^5.10.0: version "5.10.0" resolved "https://registry.yarnpkg.com/gatsby-plugin-page-creator/-/gatsby-plugin-page-creator-5.10.0.tgz#bbbc2be56784e7f0e512dee5428ab6f299ef8084" @@ -8185,6 +8201,13 @@ json5@^2.2.2: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== + optionalDependencies: + graceful-fs "^4.1.6" + jsonfile@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" @@ -12472,6 +12495,11 @@ unist-util-visit@^4.0.0: unist-util-is "^5.0.0" unist-util-visit-parents "^5.1.1" +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + universalify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" From 2fd96cd02a92cbbb07d8887503b15707ab0e11ed Mon Sep 17 00:00:00 2001 From: YassinEldeeb Date: Tue, 2 Jan 2024 16:22:34 +0200 Subject: [PATCH 2/6] depend on vercel redirects --- gatsby-node.ts | 31 --------------- redirects.json | 66 ------------------------------ vercel.json | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+), 97 deletions(-) delete mode 100644 redirects.json create mode 100644 vercel.json diff --git a/gatsby-node.ts b/gatsby-node.ts index 1df1b425d5..a67fbdad2d 100644 --- a/gatsby-node.ts +++ b/gatsby-node.ts @@ -146,11 +146,6 @@ export const createPages: GatsbyNode["createPages"] = async ({ }) => { const { createPage, createRedirect } = actions - createRedirect({ - fromPath: `/conf/attendee/*`, - toPath: `https://graphql-conf-attendee-nextjs.vercel.app/*`, - statusCode: 200, - }) try { const schedAccessToken = process.env.SCHED_ACCESS_TOKEN @@ -294,32 +289,6 @@ export const createPages: GatsbyNode["createPages"] = async ({ console.log("CATCH ME:", error) } - createRedirect({ - fromPath: "/conf/program", - toPath: "/conf/schedule", - }) - - createRedirect({ - fromPath: "/conf/schedule/*", - toPath: "/conf/sessions/*", - }) - - // redirect swapi with 200 - createRedirect({ - fromPath: `/swapi-graphql/*`, - toPath: `https://graphql.github.io/swapi-graphql/*`, - statusCode: 200, - }) - - // legacy 301 redirects from previous iterations of the site - redirects.forEach(({ from, to }) => { - createRedirect({ - fromPath: from, - toPath: to, - statusCode: 301, - }) - }) - const result = await graphql(` query allMarkdownRemark { allMarkdownRemark { diff --git a/redirects.json b/redirects.json deleted file mode 100644 index 64c293d581..0000000000 --- a/redirects.json +++ /dev/null @@ -1,66 +0,0 @@ -[ - { - "from": "/docs/api-reference-errors", - "to": "/graphql-js/error/" - }, - { - "from": "/docs/api-reference-execution", - "to": "/graphql-js/execution/" - }, - { - "from": "/docs/api-reference-express-graphql", - "to": "/graphql-js/express-graphql/" - }, - { - "from": "/docs/api-reference-graphql", - "to": "/graphql-js/graphql/" - }, - { - "from": "/docs/api-reference-language", - "to": "/graphql-js/language/" - }, - { - "from": "/docs/api-reference-type-system", - "to": "/graphql-js/type/" - }, - { - "from": "/docs/api-reference-type-utilities", - "to": "/graphql-js/utilities/" - }, - { - "from": "/docs/api-reference-type-validation", - "to": "/graphql-js/validation/" - }, - { - "from": "/docs/getting-started", - "to": "/learn/" - }, - { - "from": "/docs/intro", - "to": "/learn/" - }, - { - "from": "/docs/introspection", - "to": "/learn/introspection/" - }, - { - "from": "/docs/queries", - "to": "/learn/queries/" - }, - { - "from": "/docs/typesystem", - "to": "/learn/schema/" - }, - { - "from": "/docs/validation", - "to": "/learn/validation/" - }, - { - "from": "/docs/videos", - "to": "/community/#videos/" - }, - { - "from": "/help", - "to": "/community/" - } -] diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000000..45db7ea928 --- /dev/null +++ b/vercel.json @@ -0,0 +1,106 @@ +{ + "redirects": [ + { + "source": "/conf/attendee/*", + "destination": "https://graphql-conf-attendee-nextjs.vercel.app/*", + "permanent": false, + "statusCode": 200 + }, + { + "source": "/conf/program", + "destination": "/conf/schedule", + "permanent": false + }, + { + "source": "/conf/schedule/*", + "destination": "/conf/sessions/*", + "permanent": false + }, + { + "source": "/swapi-graphql/*", + "destination": "https://graphql.github.io/swapi-graphql/*", + "permanent": false, + "statusCode": 200 + }, + { + "source": "/docs/api-reference-errors", + "destination": "/graphql-js/error/", + "permanent": true + }, + { + "source": "/docs/api-reference-execution", + "destination": "/graphql-js/execution/", + "permanent": true + }, + { + "source": "/docs/api-reference-express-graphql", + "destination": "/graphql-js/express-graphql/", + "permanent": true + }, + { + "source": "/docs/api-reference-graphql", + "destination": "/graphql-js/graphql/", + "permanent": true + }, + { + "source": "/docs/api-reference-language", + "destination": "/graphql-js/language/", + "permanent": true + }, + { + "source": "/docs/api-reference-type-system", + "destination": "/graphql-js/type/", + "permanent": true + }, + { + "source": "/docs/api-reference-type-utilities", + "destination": "/graphql-js/utilities/", + "permanent": true + }, + { + "source": "/docs/api-reference-type-validation", + "destination": "/graphql-js/validation/", + "permanent": true + }, + { + "source": "/docs/getting-started", + "destination": "/learn/", + "permanent": true + }, + { + "source": "/docs/intro", + "destination": "/learn/", + "permanent": true + }, + { + "source": "/docs/introspection", + "destination": "/learn/introspection/", + "permanent": true + }, + { + "source": "/docs/queries", + "destination": "/learn/queries/", + "permanent": true + }, + { + "source": "/docs/typesystem", + "destination": "/learn/schema/", + "permanent": true + }, + { + "source": "/docs/validation", + "destination": "/learn/validation/", + "permanent": true + }, + { + "source": "/docs/videos", + "destination": "/community/#videos/", + "permanent": true + }, + { + "source": "/help", + "destination": "/community/", + "permanent": true + } + ] +} From caf28ff8f10b5ee361d3b13732e8b000224613a1 Mon Sep 17 00:00:00 2001 From: YassinEldeeb Date: Tue, 2 Jan 2024 16:28:47 +0200 Subject: [PATCH 3/6] fix --- gatsby-config.ts | 1 - package.json | 1 - vercel.json | 12 ++++++------ yarn.lock | 28 ---------------------------- 4 files changed, 6 insertions(+), 36 deletions(-) diff --git a/gatsby-config.ts b/gatsby-config.ts index a4b04dcfa3..a84f9f222d 100644 --- a/gatsby-config.ts +++ b/gatsby-config.ts @@ -11,7 +11,6 @@ const config: GatsbyConfig = { typesOutputPath: `src/__generated__/gatsby-types.d.ts`, }, plugins: [ - "gatsby-plugin-meta-redirect", "gatsby-plugin-postcss", "gatsby-plugin-svgr", "gatsby-plugin-anchor-links", diff --git a/package.json b/package.json index db061f3aa9..8f89e4e57b 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "gatsby-plugin-feed": "5.10.0", "gatsby-plugin-google-analytics": "5.10.0", "gatsby-plugin-less": "7.10.0", - "gatsby-plugin-meta-redirect": "^1.1.1", "gatsby-plugin-webfonts": "2.3.2", "gatsby-source-filesystem": "5.10.0", "gatsby-transformer-remark": "6.10.0", diff --git a/vercel.json b/vercel.json index 45db7ea928..fee5044de2 100644 --- a/vercel.json +++ b/vercel.json @@ -1,8 +1,8 @@ { "redirects": [ { - "source": "/conf/attendee/*", - "destination": "https://graphql-conf-attendee-nextjs.vercel.app/*", + "source": "/conf/attendee/:path*", + "destination": "https://graphql-conf-attendee-nextjs.vercel.app/:path*", "permanent": false, "statusCode": 200 }, @@ -12,13 +12,13 @@ "permanent": false }, { - "source": "/conf/schedule/*", - "destination": "/conf/sessions/*", + "source": "/conf/schedule/:path*", + "destination": "/conf/sessions/:path*", "permanent": false }, { - "source": "/swapi-graphql/*", - "destination": "https://graphql.github.io/swapi-graphql/*", + "source": "/swapi-graphql/:path*", + "destination": "https://graphql.github.io/swapi-graphql/:path*", "permanent": false, "statusCode": 200 }, diff --git a/yarn.lock b/yarn.lock index 5f8a8e9698..52051c770a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6307,15 +6307,6 @@ fs-extra@^11.1.1: jsonfile "^6.0.1" universalify "^2.0.0" -fs-extra@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs-extra@^9.0.0: version "9.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" @@ -6533,13 +6524,6 @@ gatsby-plugin-less@7.10.0: "@babel/runtime" "^7.20.13" less-loader "^6.2.0" -gatsby-plugin-meta-redirect@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/gatsby-plugin-meta-redirect/-/gatsby-plugin-meta-redirect-1.1.1.tgz#058e8e53edff38dc44d3bb6153109d01c910f863" - integrity sha512-Oc4qgU3SlDUM9qoxIMKO+re2bdMs3/a2KXrfL65gb8XMLsHylBbveWtXZRhgjd2QDL/49RX4S9SEykuadRju2w== - dependencies: - fs-extra "^7.0.0" - gatsby-plugin-page-creator@^5.10.0: version "5.10.0" resolved "https://registry.yarnpkg.com/gatsby-plugin-page-creator/-/gatsby-plugin-page-creator-5.10.0.tgz#bbbc2be56784e7f0e512dee5428ab6f299ef8084" @@ -8201,13 +8185,6 @@ json5@^2.2.2: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== - optionalDependencies: - graceful-fs "^4.1.6" - jsonfile@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" @@ -12495,11 +12472,6 @@ unist-util-visit@^4.0.0: unist-util-is "^5.0.0" unist-util-visit-parents "^5.1.1" -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - universalify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" From 56d3c0362aef8b57a18f499d25f4db13b259ee93 Mon Sep 17 00:00:00 2001 From: YassinEldeeb Date: Tue, 2 Jan 2024 16:29:34 +0200 Subject: [PATCH 4/6] fix --- vercel.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/vercel.json b/vercel.json index fee5044de2..9b94586b49 100644 --- a/vercel.json +++ b/vercel.json @@ -3,7 +3,6 @@ { "source": "/conf/attendee/:path*", "destination": "https://graphql-conf-attendee-nextjs.vercel.app/:path*", - "permanent": false, "statusCode": 200 }, { @@ -19,7 +18,6 @@ { "source": "/swapi-graphql/:path*", "destination": "https://graphql.github.io/swapi-graphql/:path*", - "permanent": false, "statusCode": 200 }, { From c643010ed701ca2ff6e107b767d4cea14c3889d0 Mon Sep 17 00:00:00 2001 From: YassinEldeeb Date: Tue, 2 Jan 2024 16:41:07 +0200 Subject: [PATCH 5/6] add key --- src/templates/event.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/templates/event.tsx b/src/templates/event.tsx index 91c468bf89..f7434db013 100644 --- a/src/templates/event.tsx +++ b/src/templates/event.tsx @@ -142,13 +142,13 @@ export const EventComponent: FC<{
{event.files?.map(({ path }) => ( - <> +
View Full PDF{" "}