Skip to content

Commit

Permalink
feat: add 404 redirecting
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Oct 19, 2023
1 parent b247697 commit 0929941
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/theme/NotFound.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react"
import NotFound from "@theme-original/NotFound"
import { useEffect } from "react"

export default function NotFoundWrapper(props) {
useEffect(() => {
if (location.href.includes("/docs/")) {
location.href = location.href.replace("/docs/", "/")
}
}, [])

return <NotFound {...props} />
}

0 comments on commit 0929941

Please sign in to comment.