Skip to content

Commit

Permalink
chore: redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
raae committed Mar 6, 2024
1 parent b86435e commit abcc987
Show file tree
Hide file tree
Showing 13 changed files with 1,535 additions and 855 deletions.
18 changes: 18 additions & 0 deletions _redirects
@@ -0,0 +1,18 @@
/posts/2021-12-02-conference-buddy-2.0/ /posts/2021-12-02-conference-buddy-v2/
/posts/2022-03-30-determenistic/ /posts/2022-03-30-deterministic/
/posts/2022-05-18-this-week/ /posts/2022-05-18-dynamic-serverless/
/posts/2022-09-06-this-week/ /posts/2022-09-05-this-week/
/posts/2022-09-29-croco-clock/ /posts/2022-10-13-croco-clock/
/react-norway/ /speaker/2022-06-24-react-norway/
/gatsby-fall-camp-2021/ /speaker/2021-09-16-gatsby-fall-camp/
/mpya/ /speaker/2021-12-15-mpya/
/jam/ /speaker/2022-11-08-jamstackconf/
/modern/ /speaker/2022-12-17-modern-frontends/
/posts/2023-02-01-netlify+gatsby/ /posts/2023-02-01-netlify-gatsby/

/emails/ /posts/
/emails/lillylabs /subs/
/emails/reminders /subs/reminders/
/emails/welcome /subs/welcome/
/emails/* /posts/:splat

15 changes: 5 additions & 10 deletions gatsby-config.js
@@ -1,9 +1,12 @@
const adapter = require("gatsby-adapter-netlify").default;
const path = require("path");

require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
});

module.exports = {
adapter: adapter(),
siteMetadata: {
siteUrl: `https://queen.raae.codes`,
siteName: `Queen Raae`,
Expand Down Expand Up @@ -84,12 +87,6 @@ module.exports = {
`@raae/gatsby-plugin-let-it-snow`,
`local-extension-og-images`,
`local-plugin-feed`,
{
resolve: "local-plugin-redirects",
options: {
path: path.join(__dirname, "redirects.json"),
},
},
{
resolve: `@raae/gatsby-plugin-fathom`,
options: {
Expand All @@ -107,11 +104,9 @@ module.exports = {
},
},
{
resolve: `gatsby-plugin-gatsby-cloud`,
resolve: "local-plugin-redirects",
options: {
headers: {
"/*": ["Referrer-Policy: strict-origin-when-cross-origin"],
},
path: path.join(__dirname, "redirects.json"),
},
},
{
Expand Down
30 changes: 15 additions & 15 deletions package.json
Expand Up @@ -29,23 +29,23 @@
"date-fns": "2.29.3",
"dotenv": "16.0.3",
"fuse.js": "6.6.2",
"gatsby": "5.9.0",
"gatsby": "5.13.3",
"gatsby-adapter-netlify": "^1.1.3",
"gatsby-mdx": "1.0.0",
"gatsby-plugin-feed": "5.9.0",
"gatsby-plugin-gatsby-cloud": "5.9.0",
"gatsby-plugin-image": "3.9.0",
"gatsby-plugin-postcss": "6.9.0",
"gatsby-plugin-feed": "5.13.1",
"gatsby-plugin-image": "3.13.1",
"gatsby-plugin-postcss": "6.13.1",
"gatsby-plugin-react-svg": "3.3.0",
"gatsby-plugin-sharp": "5.9.0",
"gatsby-plugin-sitemap": "6.9.0",
"gatsby-remark-copy-linked-files": "6.9.0",
"gatsby-remark-images": "7.9.0",
"gatsby-remark-prismjs": "7.9.0",
"gatsby-remark-responsive-iframe": "6.9.0",
"gatsby-source-filesystem": "5.9.0",
"gatsby-transformer-remark": "6.9.0",
"gatsby-transformer-sharp": "5.9.0",
"gatsby-transformer-yaml": "5.9.0",
"gatsby-plugin-sharp": "5.13.1",
"gatsby-plugin-sitemap": "6.13.1",
"gatsby-remark-copy-linked-files": "6.13.1",
"gatsby-remark-images": "7.13.1",
"gatsby-remark-prismjs": "7.13.1",
"gatsby-remark-responsive-iframe": "6.13.1",
"gatsby-source-filesystem": "5.13.1",
"gatsby-transformer-remark": "6.13.1",
"gatsby-transformer-sharp": "5.13.1",
"gatsby-transformer-yaml": "5.13.1",
"html-react-parser": "3.0.4",
"lodash": "4.17.21",
"postcss": "8.4.18",
Expand Down
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions plugins/local-plugin-redirects/gatsby-node.js
Expand Up @@ -12,6 +12,8 @@ exports.createPages = async (gatsbyUtils, pluginOptions) => {
createRedirect({
fromPath: redirect.fromPath,
toPath: redirect.toPath,
isPermanent: true,
redirectInBrowser: true,
});
reporter.info(
`Redirect created from ${redirect.fromPath} to ${redirect.toPath}`
Expand Down
44 changes: 26 additions & 18 deletions redirects.json
@@ -1,32 +1,44 @@
[
{
"fromPath": "/react/",
"toPath": "/react-gotchas/"
"fromPath": "/emails/2021-12-02-conference-buddy-2.0/",
"toPath": "/posts/2021-12-02-conference-buddy-v2/"
},
{
"fromPath": "/posts/2021-12-02-conference-buddy-2.0/",
"toPath": "/emapostsils/2021-12-02-conference-buddy-v2/"
},
{
"fromPath": "/gatsby-v4-bootcamp/",
"toPath": "/gatsby-bootcamps/v4/"
},
{
"fromPath": "/posts/2022-03-30-determenistic/",
"fromPath": "/emails/2022-03-30-determenistic/",
"toPath": "/posts/2022-03-30-deterministic/"
},
{
"fromPath": "/posts/2022-05-18-this-week/",
"fromPath": "/emails/2022-05-18-this-week/",
"toPath": "/posts/2022-05-18-dynamic-serverless/"
},
{
"fromPath": "/posts/2022-09-06-this-week/",
"fromPath": "/emails/2022-09-06-this-week/",
"toPath": "/posts/2022-09-05-this-week/"
},
{
"fromPath": "/posts/2022-09-29-croco-clock/",
"fromPath": "/emails/2022-09-29-croco-clock/",
"toPath": "/posts/2022-10-13-croco-clock/"
},
{
"fromPath": "/emails/2023-02-01-netlify+gatsby/",
"toPath": "/posts/2023-02-01-netlify-gatsby/"
},
{
"fromPath": "/emails/welcome/",
"toPath": "/subs/welcome/"
},
{
"fromPath": "/emails/reminders/",
"toPath": "/subs/reminders/"
},
{
"fromPath": "/emails/preferences/",
"toPath": "/subs/preferences/"
},
{
"fromPath": "/emails/*",
"toPath": "/posts/"
},
{
"fromPath": "/react-norway/",
"toPath": "/speaker/2022-06-24-react-norway/"
Expand All @@ -46,9 +58,5 @@
{
"fromPath": "/modern/",
"toPath": "/speaker/2022-12-17-modern-frontends/"
},
{
"fromPath": "/posts/2023-02-01-netlify+gatsby/",
"toPath": "/posts/2023-02-01-netlify-gatsby/"
}
]
39 changes: 0 additions & 39 deletions src/pages/emails/lillylabs.js

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit abcc987

Please sign in to comment.