Skip to content

Commit

Permalink
feat(project): add not found pages and 404.html for github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jwpradm committed Dec 15, 2021
1 parent ec9bc60 commit 3249d63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/deploy-github.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function build() {
if (customDomain) {
fs.writeFileSync('./build/CNAME', customDomain);
}
shPrint('cp ./build/index.html ./build/404.html');
}

function deploy() {
Expand Down
5 changes: 5 additions & 0 deletions src/components/Root/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ const Root: FC<Props> = ({ error }: Props) => {
<Route path="/q/:query?" component={Search} />
<Route path="/u/:page?" component={User} />
<Route path="/o/about" component={About} />
<Route>
<ErrorPage title={t('notfound_error_heading', 'Not found')}>
<p>{t('notfound_error_description', "This page doesn't exist.")}</p>
</ErrorPage>
</Route>
</Switch>
<AccountModal />
</Layout>
Expand Down

0 comments on commit 3249d63

Please sign in to comment.