Skip to content
Open
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/theme/NotFound/Content/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import {useEffect} from "react";
import useBaseUrl from "@docusaurus/useBaseUrl";

export default function NotFound() {
const homeUrl = useBaseUrl("/");

useEffect(() => {
if (typeof window !== "undefined") {
// immediate redirect without adding to browser history
window.location.replace("/docs");
window.location.replace(homeUrl);
}
}, []);
}, [homeUrl]);

// render nothing (no content shown)
return null;
return (
<div className="flex h-screen flex-col items-center justify-center">
<h1 className="mb-4 text-6xl font-extrabold md:text-8xl">
<span className="bg-gradient-to-r from-orange-400 via-orange-500 to-red-500 bg-clip-text text-transparent">
404
</span>
</h1>
</div>
);
}