Skip to content

Commit 1f8062b

Browse files
committed
some demo sveltekit content
1 parent 66557a8 commit 1f8062b

File tree

12 files changed

+42
-20
lines changed

12 files changed

+42
-20
lines changed

content/tutorial/02-sveltekit/02-routing/01-filesystem-based-routing/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

content/tutorial/02-sveltekit/02-routing/01-filesystem-based-routing/app-a/src/routes/index.svelte

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Pages
3+
---
4+
5+
SvelteKit uses filesystem-based routing, which means that the _routes_ of your app — in other words, what the app should do when a user navigates to a particular URL — follow the same structure as your source code.
6+
7+
In this app we have two routes — `src/routes/index.svelte`, which maps to `/`, and `src/routes/about.svelte`, which maps to `/about`. Clicking the `about` link will take you from the home page to the about page.
8+
9+
> Unlike traditional multi-page apps, navigating to `/about` updates the contents of the current page, like a single-page app. This gives us the best of both worlds — fast server-rendered startup, then instant navigation.
10+
11+
Let's add a link in `src/routes/about.svelte` back to the homepage:
12+
13+
```svelte
14+
<p>This is the about page.</p>
15+
<p>Go to the +++<a href="/">+++home+++</a>+++ page</p>
16+
```
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<h1>About</h1>
22

33
<p>This is the about page.</p>
4-
5-
<a href="/">/</a>
4+
<p>Go to the home page</p>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<h1>Home</h1>
2+
3+
<p>This is the home page.</p>
4+
<p>Go to the <a href="/about">about</a> page.</p>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<h1>About</h1>
2+
3+
<p>This is the about page.</p>
4+
<p>Go to the <a href="/">home</a> page</p>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Endpoints
3+
---
4+
5+
TODO
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<h1>About</h1>
2+
3+
<p>This is the about page.</p>
4+
<p>Go to the home page</p>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<h1>Home</h1>
2+
3+
<p>This is the home page.</p>
4+
<p>Go to the <a href="/about">about</a> page.</p>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<h1>About</h1>
2+
3+
<p>This is the about page.</p>
4+
<p>Go to the <a href="/">home</a> page</p>

content/tutorial/02-sveltekit/02-routing/02-pages/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

content/tutorial/02-sveltekit/02-routing/02-pages/app-a/src/routes/index.svelte

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)