File tree Expand file tree Collapse file tree 4 files changed +17
-6
lines changed
packages/create/templates/demo/src/routes Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' sv ' : patch
3+ ---
4+
5+ feat(cli): wrap links with ` resolve() ` function to follow [ best practices] ( https://svelte.dev/docs/kit/$app-paths#resolve )
Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import { resolve } from ' $app/paths' ;
23 import { page } from ' $app/state' ;
34 import logo from ' $lib/images/svelte-logo.svg' ;
45 import github from ' $lib/images/github.svg' ;
1718 </svg >
1819 <ul >
1920 <li aria-current ={page .url .pathname === ' /' ? ' page' : undefined }>
20- <a href =" / " >Home</a >
21+ <a href ={ resolve ( ' / ' )} >Home</a >
2122 </li >
2223 <li aria-current ={page .url .pathname === ' /about' ? ' page' : undefined }>
23- <a href =" /about" >About</a >
24+ <a href ={ resolve ( ' /about' )} >About</a >
2425 </li >
2526 <li aria-current ={page .url .pathname .startsWith (' /sverdle' ) ? ' page' : undefined }>
26- <a href =" /sverdle" >Sverdle</a >
27+ <a href ={ resolve ( ' /sverdle' )} >Sverdle</a >
2728 </li >
2829 </ul >
2930 <svg viewBox =" 0 0 2 3" aria-hidden =" true" >
Original file line number Diff line number Diff line change 1+ <script lang =" ts" >
2+ import { resolve } from ' $app/paths' ;
3+ </script >
4+
15<svelte:head >
26 <title >About</title >
37 <meta name =" description" content =" About this app" />
2024 </p >
2125
2226 <p >
23- The <a href =" /sverdle" >Sverdle</a > page illustrates SvelteKit's data loading and form handling. Try
24- using it with JavaScript disabled!
27+ The <a href ={ resolve ( ' /sverdle' )} >Sverdle</a > page illustrates SvelteKit's data loading and form
28+ handling. Try using it with JavaScript disabled!
2529 </p >
2630</div >
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { enhance } from ' $app/forms' ;
3+ import { resolve } from ' $app/paths' ;
34 import { confetti } from ' @neoconfetti/svelte' ;
45 import type { ActionData , PageData } from ' ./$types' ;
56 import { MediaQuery } from ' svelte/reactivity' ;
117118 };
118119 }}
119120>
120- <a class =" how-to-play" href =" /sverdle/how-to-play" >How to play</a >
121+ <a class ="how-to-play" href ={ resolve ( ' /sverdle/how-to-play' )} >How to play</a >
121122
122123 <div class ="grid" class:playing ={! won } class:bad-guess ={form ?.badGuess }>
123124 {#each Array .from (Array (6 ).keys ()) as row (row )}
You can’t perform that action at this time.
0 commit comments