Skip to content

Commit ba78cbb

Browse files
authored
fix: Correct paths in layout-data tutorial (sveltejs#218)
Paths are like `src/blog/...` and they should be like `src/routes/blog/...`
1 parent 10b0691 commit ba78cbb

File tree

1 file changed

+2
-2
lines changed
  • content/tutorial/02-sveltekit/03-loading-data/02-layout-data

1 file changed

+2
-2
lines changed

content/tutorial/02-sveltekit/03-loading-data/02-layout-data/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ path: /blog
55

66
Just as `+layout.svelte` files create UI for every child route, `+layout.server.js` files load data for every child route.
77

8-
Suppose we'd like to add a 'more posts' sidebar to our blog post page. We _could_ return `summaries` from the `load` function in `src/blog/[slug]/+page.server.js`, like we do in `src/blog/+page.server.js`, but that would be repetitive.
8+
Suppose we'd like to add a 'more posts' sidebar to our blog post page. We _could_ return `summaries` from the `load` function in `src/routes/blog/[slug]/+page.server.js`, like we do in `src/routes/blog/+page.server.js`, but that would be repetitive.
99

10-
Instead, let's rename `src/blog/+page.server.js` to `src/blog/+layout.server.js`. Notice that the `/blog` route continues to work — `data.summaries` is still available to the page.
10+
Instead, let's rename `src/routes/blog/+page.server.js` to `src/routes/blog/+layout.server.js`. Notice that the `/blog` route continues to work — `data.summaries` is still available to the page.
1111

1212
Now, create a layout for the post page:
1313

0 commit comments

Comments
 (0)