@skwasha
I have updated the repo and replaced segment with $page.path and updated also the tutorial to reflect this change. Let me know if this works for you.
Hey, that's great! Thanks for the update. Where did you happen to find the location for the page stores? I tried searching and checking old messages on the Discord but never saw any mention of it. Do you know if that's going to be where these "built in" stores will be located moving forward with Svelte Kit?
@skwasha
I started digging in the sveltekit node_modules/sveltejs/kit/assets/runtime/app/stores.js code looking for $page.path mentioned in the github.com/sveltejs/sapper/issues/824 and found it. Perhaps the import import { page } from '@sveltejs/kit/assets/runtime/app/stores.js'; will get more elegant when sveltekit gets released (or I might be missing the correct way to do it) but this will be the way to use it again according to the issue/824.
@skwasha I have updated the repo and replaced
segment
with$page.path
and updated also the tutorial to reflect this change. Let me know if this works for you.Hey, that's great! Thanks for the update. Where did you happen to find the location for the page stores? I tried searching and checking old messages on the Discord but never saw any mention of it. Do you know if that's going to be where these "built in" stores will be located moving forward with Svelte Kit?
thanks again.
@skwasha I started digging in the sveltekit
node_modules/sveltejs/kit/assets/runtime/app/stores.js
code looking for$page.path
mentioned in the github.com/sveltejs/sapper/issues/824 and found it. Perhaps the importimport { page } from '@sveltejs/kit/assets/runtime/app/stores.js';
will get more elegant when sveltekit gets released (or I might be missing the correct way to do it) but this will be the way to use it again according to the issue/824.I searched the discord and found the right way to do it:
import { page } from '$app/stores';
Thanks for this article, by the way, it's helping me get off the ground with svelte/kit.
Another idea for a change, you can set the
class="current"
like this, it's a bit shorter:<a href="/" class:current={segment==="/"}>Home</a>
<a href="/about" class:current={segment==="/about"}>About</a>
Hi @giorgosk, Great tutorial although my page fades are not ideal.
P.S:
$page.path
seems to have changed to$page.route.id
?