Web/make dpl redirect (#685)

This commit is contained in:
Corwin 2024-05-12 15:52:51 +01:00 committed by GitHub
commit bdc799af36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 35 additions and 2 deletions

View file

@ -8,7 +8,7 @@ export const metadata: Metadata = {
title: "Showcase - agb",
};
export default function ColourPickerPage() {
export default function ShowcasePage() {
return (
<>
<ContentBlock color="#9fa6db">

View file

@ -0,0 +1,29 @@
import { ContentBlock } from "@/components/contentBlock";
import { Metadata } from "next";
import { redirect } from "next/navigation";
export const metadata: Metadata = {
title: "Dungeon Puzzler Redirect",
};
const REDIRECT_TO = "/showcase/the-dungeon-puzzlers-lament";
export default function DplRedirectPage() {
redirect(REDIRECT_TO);
return (
<>
<ContentBlock>
<h1>This page is a redirect to the Dungeon Puzzler</h1>
</ContentBlock>
<ContentBlock>
<p>
You should be redirected automatically.{" "}
<a href={REDIRECT_TO}>
If you were not redirected automatically click here.
</a>
</p>
</ContentBlock>
</>
);
}

View file

@ -1,3 +1,7 @@
export function slugify(x: string) {
return x.toLowerCase().split(" ").join("-");
return x
.toLowerCase()
.split(" ")
.join("-")
.replace(/[^a-zA-Z0-9\-]/, "");
}