Skip to content

Commit

Permalink
add gatsby prefix to redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
coinmoles committed Jul 18, 2024
1 parent 2dfc3ec commit f982abc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Redirect } from "@reach/router";
import { formatDate } from "date-fns";
import { toZonedTime } from "date-fns-tz";
import { PageProps } from "gatsby";
import { PageProps, withPrefix } from "gatsby";
import React from "react";
import { Helmet } from "react-helmet";

Expand All @@ -16,7 +16,7 @@ const IndexPage: React.FC<PageProps<null>> = () => {
<Helmet>
<meta httpEquiv="refresh" content={`0; /runs/${currentDate}`} />
</Helmet>
<Redirect noThrow to={`/runs/${currentDate}`} />
<Redirect noThrow to={withPrefix(`/runs/${currentDate}`)} />
</div>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/pages/runs.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Redirect } from "@reach/router";
import { formatDate } from "date-fns";
import { toZonedTime } from "date-fns-tz";
import { PageProps } from "gatsby";
import { PageProps, withPrefix } from "gatsby";
import React from "react";
import { Helmet } from "react-helmet";

Expand All @@ -16,7 +16,7 @@ const RunsPage: React.FC<PageProps<null>> = () => {
<Helmet>
<meta httpEquiv="refresh" content={`0; /runs/${currentDate}`} />
</Helmet>
<Redirect noThrow to={`/runs/${currentDate}`} />
<Redirect noThrow to={withPrefix(`/runs/${currentDate}`)} />
</div>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/pages/runs/[date].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "@/components/ui/card";
import { Redirect } from "@reach/router";
import { isMatch } from "date-fns";
import { graphql, Link, PageProps } from "gatsby";
import { graphql, Link, PageProps, withPrefix } from "gatsby";
import * as React from "react";
import { Helmet } from "react-helmet";

Expand Down Expand Up @@ -60,7 +60,7 @@ const RunsPage: React.FC<PageProps<Queries.RunsPageQuery>> = ({
<Helmet>
<meta httpEquiv="refresh" content={`0; /`} />
</Helmet>
<Redirect noThrow to={`/`} />
<Redirect noThrow to={withPrefix(`/`)} />
</div>
);
};
Expand Down

0 comments on commit f982abc

Please sign in to comment.