Skip to content

Commit

Permalink
Merge pull request #37 from vim-jp-radio/feature/fix-adapter-options
Browse files Browse the repository at this point in the history
svelte.config.tsにあったfallback optionを修正し、代わりにエラーページを追加
  • Loading branch information
ryoppippi authored Jun 28, 2024
2 parents 506d041 + 5572c1a commit fa6d4eb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
Binary file added src/assets/404.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/routes/+error.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script>
import { page } from '$app/stores';
</script>

<!-- eslint-disable svelte/valid-compile -->
<!-- svelte-ignore element_invalid_self_closing_tag -->

{#if $page.error != null}
<div class='grid place-content-center place-items-center'>
<enhanced:img alt='some alt text' src='$/assets/404.png' />
<h1>{$page.error.message}</h1>
</div>
{/if}
5 changes: 5 additions & 0 deletions src/routes/404/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script lang='ts'>
import ErrorPage from '$/routes/+error.svelte';
</script>

<ErrorPage />
4 changes: 1 addition & 3 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ const config = {
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter({
// default options are shown. On some platforms
// these options are set automatically — see below
fallback: 'index.html',
fallback: '404.html',
}),

typescript: {
Expand Down

0 comments on commit fa6d4eb

Please sign in to comment.