Skip to content

Commit 125e1df

Browse files
author
Rich Harris
committed
tweak
1 parent 7333703 commit 125e1df

File tree

1 file changed

+4
-6
lines changed
  • content/tutorial/02-sveltekit/02-routing/01-pages

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ title: Pages
44

55
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 — are defined by the directories in your codebase.
66

7-
The routes are located within `src/routes`. Every directory within which contains a `+page.svelte` file creates a route in your app.
7+
Every `+page.svelte` file inside `src/routes` creates a page in your app. In this app we currently have one page — `src/routes/+page.svelte`, which maps to `/`. If we navigate to `/about`, we'll see a 404 Not Found error.
88

9-
In this app we currently have one route — `src/routes/+page.svelte`, which maps to `/`.
10-
11-
Let's add a second route, `src/routes/about/+page.svelte`, which maps to `/about`:
9+
Let's fix that. Add a second page, `src/routes/about/+page.svelte`, copy the contents of `src/routes/+page.svelte`, and update it:
1210

1311
```svelte
1412
/// file: src/routes/about/+page.svelte
@@ -17,8 +15,8 @@ Let's add a second route, `src/routes/about/+page.svelte`, which maps to `/about
1715
<a href="/about">about</a>
1816
</nav>
1917
20-
<h1>about</h1>
21-
<p>this is the about page.</p>
18+
<h1>+++about+++</h1>
19+
<p>this is the +++about+++ page.</p>
2220
```
2321

2422
We can now navigate between `/` and `/about`.

0 commit comments

Comments
 (0)