diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-03-09 22:43:12 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-03-09 22:43:12 +0100 |
| commit | bd8e98d7e24c4dbaee7db6ec7955f7c2f6d396a6 (patch) | |
| tree | e5f0dcbc14d3009c17e5f562404fe19f6aceab73 /src/routes | |
| parent | 862a5f9cdbbda522c608ea63c1e296e81f44de10 (diff) | |
Update to SvelteKit
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/$error.svelte | 5 | ||||
| -rw-r--r-- | src/routes/$layout.svelte | 39 | ||||
| -rw-r--r-- | src/routes/a/[id].svelte | 10 | ||||
| -rw-r--r-- | src/routes/f/[id].svelte | 9 | ||||
| -rw-r--r-- | src/routes/g/[id].svelte | 9 | ||||
| -rw-r--r-- | src/routes/index.svelte | 6 | ||||
| -rw-r--r-- | src/routes/p/[id].svelte | 11 | ||||
| -rw-r--r-- | src/routes/t/[id].svelte | 10 |
8 files changed, 99 insertions, 0 deletions
diff --git a/src/routes/$error.svelte b/src/routes/$error.svelte new file mode 100644 index 0000000..df7da3c --- /dev/null +++ b/src/routes/$error.svelte @@ -0,0 +1,5 @@ +<script> + import InvalidRoute from '$components/invalid_route/invalid_route.svelte'; +</script> + +<InvalidRoute /> diff --git a/src/routes/$layout.svelte b/src/routes/$layout.svelte new file mode 100644 index 0000000..a848a59 --- /dev/null +++ b/src/routes/$layout.svelte @@ -0,0 +1,39 @@ +<script> + import '$config/i18n'; + import { isLoading, waitLocale } from 'svelte-i18n'; + + export const load = function load() { + + return waitLocale; + }; + + import ForumList from '$components/forum_list/forum_list.svelte'; + import Header from '$components/header/header.svelte'; + import Footer from '$components/footer/footer.svelte'; +</script> + +{#if $isLoading} + <h1>Loading.</h1> + <p>Please wait.</p> +{:else} + <Header /> + <main> + <slot></slot> + </main> + <ForumList /> + <Footer /> +{/if} + +<style> + main { + grid-column: col-start 2 / span 11; + } + + :global(#forum) { + display: grid; + font-family : 'ヒラギノ明朝 ProN' , 'Hiragino Mincho ProN' , '游明朝','游明朝体',YuMincho,'Yu Mincho' , 'MS 明朝' , 'MS Mincho' , HiraMinProN-W3 , 'TakaoEx明朝' , TakaoExMincho , 'MotoyaLCedar' , 'Droid Sans Japanese' , serif; + grid-template-columns: repeat(12, [col-start] 1fr); + grid-gap: 20px; + grid-auto-rows: minmax(24px, auto); + } +</style> diff --git a/src/routes/a/[id].svelte b/src/routes/a/[id].svelte new file mode 100644 index 0000000..1b6c705 --- /dev/null +++ b/src/routes/a/[id].svelte @@ -0,0 +1,10 @@ +<script> + export async function load(ctx) { + let id = ctx.page.params.id + return { props: { id }} + } + + import Author from '$components/author/author.svelte'; +</script> + +<Author/> diff --git a/src/routes/f/[id].svelte b/src/routes/f/[id].svelte new file mode 100644 index 0000000..d1fae4c --- /dev/null +++ b/src/routes/f/[id].svelte @@ -0,0 +1,9 @@ +<script> + export async function load(ctx) { + let id = ctx.page.params.id + return { props: { id }} + } +</script> + +<h1>Forum Index.</h1> +<p>This component lists topics for forum with id: {id}</p> diff --git a/src/routes/g/[id].svelte b/src/routes/g/[id].svelte new file mode 100644 index 0000000..d036c36 --- /dev/null +++ b/src/routes/g/[id].svelte @@ -0,0 +1,9 @@ +<script> + export async function load(ctx) { + let id = ctx.page.params.id + return { props: { id }} + } +</script> + +<h1>Tag Index.</h1> +<p>This component lists topics for tag with id: {id}</p> diff --git a/src/routes/index.svelte b/src/routes/index.svelte new file mode 100644 index 0000000..7000137 --- /dev/null +++ b/src/routes/index.svelte @@ -0,0 +1,6 @@ +<script> + import { _ } from 'svelte-i18n'; +</script> + +<h1>{$_('home.title')}</h1> +<p>{$_('home.content')}</p> diff --git a/src/routes/p/[id].svelte b/src/routes/p/[id].svelte new file mode 100644 index 0000000..b8a8165 --- /dev/null +++ b/src/routes/p/[id].svelte @@ -0,0 +1,11 @@ +<script> + export const load = function load(ctx) { + + const id = ctx.page.params.id; + return { props: { id } }; + }; + + import Post from '$components/post/post.svelte'; +</script> + +<Post/> diff --git a/src/routes/t/[id].svelte b/src/routes/t/[id].svelte new file mode 100644 index 0000000..8775cec --- /dev/null +++ b/src/routes/t/[id].svelte @@ -0,0 +1,10 @@ +<script> + export async function load(ctx) { + let id = ctx.page.params.id + return { props: { id }} + } + + import Topic from '$components/topic/topic.svelte'; +</script> + +<Topic/> |