Skip to content

Commit

Permalink
add uniffied location for common errors
Browse files Browse the repository at this point in the history
  • Loading branch information
brody192 committed Dec 19, 2024
1 parent 211aac5 commit fe0630a
Show file tree
Hide file tree
Showing 15 changed files with 477 additions and 247 deletions.
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/basic-features/typescript for more information.
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { withContentlayer } = require("next-contentlayer");
const redirects = require("./redirects");
const { redirects } = require("./redirects");

/** @type {import('next').NextConfig} */
const nextConfig = withContentlayer({
Expand Down
214 changes: 117 additions & 97 deletions redirects.js
Original file line number Diff line number Diff line change
@@ -1,100 +1,120 @@
const redirects = [
{
source: "/reference/s",
destination: "/reference/templates",
permanent: true,
},
{
source: "/getting-started",
destination: "/quick-start",
permanent: true,
},
{
source: "/develop/:slug*",
destination: "/guides/:slug*",
permanent: true,
},
{
source: "/deploy/exposing-your-app",
destination: "/guides/public-networking",
permanent: true,
},
{
source: "/deploy/logging",
destination: "/guides/logs",
permanent: true,
},
{
source: "/deploy/deploy-on-railway-button",
destination: "/guides/templates",
permanent: true,
},
{
source: "/deploy/healthchecks",
destination: "/reference/healthchecks",
permanent: true,
},
{
source: "/deploy/integrations",
destination: "/reference/integrations",
permanent: true,
},
{
source: "/deploy/railway-up",
destination: "/guides/services",
permanent: true,
},
{
source: "/deploy/:slug*",
destination: "/guides/:slug*",
permanent: true,
},
{
source: "/databases/bring-your-own-database",
destination: "/guides/build-a-database-service",
permanent: true,
},
{
source: "/databases/:slug*",
destination: "/guides/:slug*",
permanent: true,
},
{
source: "/diagnose/project-usage",
destination: "/reference/project-usage",
permanent: true,
},
{
source: "/diagnose/:slug*",
destination: "/guides/:slug*",
permanent: true,
},
{
source: "/guides/migrate-from-heroku",
destination: "/tutorials/migrate-from-heroku",
permanent: true
},
{
source: "/reference/compare-to-heroku",
destination: "/maturity/compare-to-heroku",
permanent: true
},
{
source: "/troubleshoot/fixing-common-errors",
destination: "/guides/fixing-common-errors",
permanent: true,
},
{
source: "/reference/guides",
destination: "/tutorials/getting-started",
permanent: true,
},
{
source: "/reference/pricing",
destination: "/reference/pricing/plans",
permanent: true,
},
];
{
source: "/reference/s",
destination: "/reference/templates",
permanent: true,
},
{
source: "/getting-started",
destination: "/quick-start",
permanent: true,
},
{
source: "/develop/:slug*",
destination: "/guides/:slug*",
permanent: true,
},
{
source: "/deploy/exposing-your-app",
destination: "/guides/public-networking",
permanent: true,
},
{
source: "/deploy/logging",
destination: "/guides/logs",
permanent: true,
},
{
source: "/deploy/deploy-on-railway-button",
destination: "/guides/templates",
permanent: true,
},
{
source: "/deploy/healthchecks",
destination: "/reference/healthchecks",
permanent: true,
},
{
source: "/deploy/integrations",
destination: "/reference/integrations",
permanent: true,
},
{
source: "/deploy/railway-up",
destination: "/guides/services",
permanent: true,
},
{
source: "/deploy/:slug*",
destination: "/guides/:slug*",
permanent: true,
},
{
source: "/databases/bring-your-own-database",
destination: "/guides/build-a-database-service",
permanent: true,
},
{
source: "/databases/:slug*",
destination: "/guides/:slug*",
permanent: true,
},
{
source: "/diagnose/project-usage",
destination: "/reference/project-usage",
permanent: true,
},
{
source: "/diagnose/:slug*",
destination: "/guides/:slug*",
permanent: true,
},
{
source: "/guides/migrate-from-heroku",
destination: "/tutorials/migrate-from-heroku",
permanent: true,
},
{
source: "/reference/compare-to-heroku",
destination: "/maturity/compare-to-heroku",
permanent: true,
},
{
source: "/troubleshoot/fixing-common-errors",
destination: "/guides/fixing-common-errors",
permanent: true,
},
{
source: "/reference/guides",
destination: "/tutorials/getting-started",
permanent: true,
},
{
source: "/reference/pricing",
destination: "/reference/pricing/plans",
permanent: true,
},
{
source: "/guides/fixing-common-errors",
destination: "/reference/errors",
permanent: true,
},
];

module.exports = redirects;
const hashRedirects = [
{
source: "#application-failed-to-respond",
destination: "/reference/errors/application-failed-to-respond",
permanent: true,
},
{
source: "#post-requests-turn-into-get-requests",
destination: "/reference/errors/405-method-not-allowed",
permanent: true,
},
];

module.exports = {
redirects,
hashRedirects,
};
2 changes: 1 addition & 1 deletion src/components/CodeBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export const CodeBlock: React.FC<Props> = ({
<SyntaxHighlighter
language={lang}
style={theme}
data-colorMode={colorMode}
data-colormode={colorMode}
>
{content}
</SyntaxHighlighter>
Expand Down
2 changes: 1 addition & 1 deletion src/components/InlineCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const InlineCode: React.FC<Props> = ({ children, colorModeSSR }) => {
backgroundColor: String(theme['pre[class*="language-"]'].background),
color: theme['code[class*="language-"]'].color,
}}
data-colorMode={colorMode}
data-colormode={colorMode}
>
{children}
</code>
Expand Down
9 changes: 8 additions & 1 deletion src/data/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export const sidebarContent: ISidebarContent = [
pages: [
makePage("Public Networking", "guides"),
makePage("Private Networking", "guides"),
makePage("Fixing Common Errors", "guides"),
],
},
{
Expand Down Expand Up @@ -202,6 +201,14 @@ export const sidebarContent: ISidebarContent = [
{
title: "Reference",
content: [
{
subTitle: makePage("Errors", "/reference/errors", "/reference/errors"),
pages: [
makePage("Application Failed to Respond", "reference/errors"),
makePage("No Start Command Could Be Found", "reference/errors"),
makePage("405 Method Not Allowed", "reference/errors"),
],
},
{
subTitle: "Develop",
pages: [
Expand Down
Loading

0 comments on commit fe0630a

Please sign in to comment.