question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

%layout.svelte and [param].svelte

See original GitHub issue

Adding my suggestion for what special filenames should look like, re #1149

%layout.svelte

@Rich-Harris suggested % for params, which I feel strongly would rather be the ideal option for the prefix. Can’t see any downside with this.

  • Unsafe for URL pathname
  • Safe for filenames and terminal link click
  • No interference with Twitter/Discord
  • Looks better than $ and @ imo

[param].svelte

  • Conventional
  • Has an opening and closing, which is easier to read: [one]-[two] vs %one%-%two%
  • Unsafe for URL pathname
  • Safe for filenames, but not terminal link click, but I agree with @arxpoetica that it should rather be considered a terminal/IDE bug.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
rmunncommented, Apr 28, 2021

Or you could use backslash-escaping and write touch \$layout.svelte, that works too.

1reaction
Kapsonfire-DEcommented, Apr 28, 2021

ehm is that a problem to put the filename in singlequotes?

touch ‘$layout.svelte’

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced routing • Docs • SvelteKit
Make sure you check that the value of the rest parameter is valid, ... If the pathname doesn't match, SvelteKit will try to...
Read more >
Change $layout.svelte to @layout.svelte and [param ... - GitHub
It's awkward to type src/routes/$layout.svelte on the command line — you get to the $ and either have to reach for the backslash,...
Read more >
Loading data in layout and stuff in SvelteKit - YouTube
Loading data in layout and stuff in SvelteKit. Watch later. Share. Copy link. Info. Shopping. Tap to unmute.
Read more >
Build a single-page application in Svelte with svelte-spa-router
npx degit sveltejs/template svelte-spa-router-app ... components/NotFound.svelte"; export let params = {}; let article; blogs.
Read more >
SvelteKit Path Based Navigation - JumpWire
queryParam =queryValue , and can be extended to include subpages. ... The site uses a standard SvelteKit src/routes/+layout.svelte for each ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found