Skip to content

Commit a940812

Browse files
authored
docs: use root-relative links instead of https://svelte.dev (#1061)
1 parent 3eaa4b9 commit a940812

File tree

9 files changed

+44
-44
lines changed

9 files changed

+44
-44
lines changed

apps/svelte.dev/content/blog/2024-12-01-whats-new-in-svelte-december-2024.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The features since last month can be found below:
4343
- [PixelAttack](https://jason1610.github.io/PixelAttack/) takes an image, pixelizes it and makes the pixels fight each other
4444
- [NeoHtop](https://github.com/Abdenasser/neohtop) is a modern, process monitoring tool that combines the power of terminal-based system monitors with a clean, desktop-native UI
4545
- [WebVM](https://github.com/leaningtech/webvm) is a Linux virtual machine that runs in your browser
46-
- [Sveltris](https://svelte.dev/playground/8594eea15c6244908c3efad284fe2aa4?version=5.2.1) is Tetris built entirely in the Svelte REPL
46+
- [Sveltris](/playground/8594eea15c6244908c3efad284fe2aa4?version=5.2.1) is Tetris built entirely in the Svelte REPL
4747

4848
### Learning Resources
4949

apps/svelte.dev/content/docs/kit/10-getting-started/10-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Introduction
77

88
> [!NOTE] If you're new to Svelte or SvelteKit we recommend checking out the [interactive tutorial](/tutorial/kit).
99
>
10-
> If you get stuck, reach out for help in the [Discord chatroom](https://svelte.dev/chat).
10+
> If you get stuck, reach out for help in the [Discord chatroom](/chat).
1111
1212
## What is SvelteKit?
1313

apps/svelte.dev/content/docs/kit/20-core-concepts/50-state-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ You might wonder how we're able to use `page.data` and other [app state]($app-st
111111
<p>Welcome {user().name}</p>
112112
```
113113

114-
> [!NOTE] We're passing a function into `setContext` to keep reactivity across boundaries. Read more about it [here](https://svelte.dev/docs/svelte/$state#Passing-state-into-functions)
114+
> [!NOTE] We're passing a function into `setContext` to keep reactivity across boundaries. Read more about it [here](/docs/svelte/$state#Passing-state-into-functions)
115115
116116
> [!LEGACY]
117117
> You also use stores from `svelte/store` for this, but when using Svelte 5 it is recommended to make use of universal reactivity instead.

apps/svelte.dev/content/docs/kit/60-appendix/50-additional-resources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ SvelteKit users have also published plenty of examples on GitHub, under the [#sv
2121

2222
## Support
2323

24-
You can ask for help on [Discord](https://svelte.dev/chat) and [StackOverflow](https://stackoverflow.com/questions/tagged/sveltekit). Please first search for information related to your issue in the FAQ, Google or another search engine, issue tracker, and Discord chat history in order to be respectful of others' time. There are many more people asking questions than answering them, so this will help in allowing the community to grow in a scalable fashion.
24+
You can ask for help on [Discord](/chat) and [StackOverflow](https://stackoverflow.com/questions/tagged/sveltekit). Please first search for information related to your issue in the FAQ, Google or another search engine, issue tracker, and Discord chat history in order to be respectful of others' time. There are many more people asking questions than answering them, so this will help in allowing the community to grow in a scalable fashion.

apps/svelte.dev/content/docs/kit/98-reference/[email protected]

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ generateManifest(opts: { relativePath: string; routes?: RouteDefinition[] }): st
680680

681681
</div>
682682

683-
Generate a server-side manifest to initialise the SvelteKit [server](https://svelte.dev/docs/kit/@sveltejs-kit#Server) with.
683+
Generate a server-side manifest to initialise the SvelteKit [server](/docs/kit/@sveltejs-kit#Server) with.
684684

685685
</div>
686686
</div>
@@ -1226,10 +1226,10 @@ fetch: typeof fetch;
12261226
- It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request.
12271227
- It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context).
12281228
- Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call.
1229-
- During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle)
1229+
- During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](/docs/kit/hooks#Server-hooks-handle)
12301230
- During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request.
12311231

1232-
You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies)
1232+
You can learn more about making credentialed requests with cookies [here](/docs/kit/load#Cookies)
12331233

12341234
</div>
12351235
</div>
@@ -1275,7 +1275,7 @@ export async function load({ fetch, setHeaders }) {
12751275

12761276
Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once.
12771277

1278-
You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/@sveltejs-kit#Cookies) API in a server-only `load` function instead.
1278+
You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](/docs/kit/@sveltejs-kit#Cookies) API in a server-only `load` function instead.
12791279

12801280
`setHeaders` has no effect when a `load` function runs in the browser.
12811281

@@ -1306,7 +1306,7 @@ depends(...deps: Array<`${string}:${string}`>): void;
13061306

13071307
<div class="ts-block-property-details">
13081308

1309-
This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](https://svelte.dev/docs/kit/$app-navigation#invalidate) to cause `load` to rerun.
1309+
This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](/docs/kit/$app-navigation#invalidate) to cause `load` to rerun.
13101310

13111311
Most of the time you won't need this, as `fetch` calls `depends` on your behalf — it's only necessary if you're using a custom API client that bypasses `fetch`.
13121312

@@ -1784,7 +1784,7 @@ state: App.PageState;
17841784

17851785
<div class="ts-block-property-details">
17861786

1787-
The page state, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/$app-navigation#pushState) and [`replaceState`](https://svelte.dev/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`.
1787+
The page state, which can be manipulated using the [`pushState`](/docs/kit/$app-navigation#pushState) and [`replaceState`](/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`.
17881788

17891789
</div>
17901790
</div>
@@ -1797,7 +1797,7 @@ form: any;
17971797

17981798
<div class="ts-block-property-details">
17991799

1800-
Filled only after a form submission. See [form actions](https://svelte.dev/docs/kit/form-actions) for more info.
1800+
Filled only after a form submission. See [form actions](/docs/kit/form-actions) for more info.
18011801

18021802
</div>
18031803
</div></div>
@@ -1899,10 +1899,10 @@ fetch: typeof fetch;
18991899
- It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request.
19001900
- It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context).
19011901
- Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call.
1902-
- During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle)
1902+
- During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included via [`filterSerializedResponseHeaders`](/docs/kit/hooks#Server-hooks-handle)
19031903
- During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request.
19041904

1905-
You can learn more about making credentialed requests with cookies [here](https://svelte.dev/docs/kit/load#Cookies)
1905+
You can learn more about making credentialed requests with cookies [here](/docs/kit/load#Cookies)
19061906

19071907
</div>
19081908
</div>
@@ -1928,7 +1928,7 @@ locals: App.Locals;
19281928

19291929
<div class="ts-block-property-details">
19301930

1931-
Contains custom data that was added to the request within the [`server handle hook`](https://svelte.dev/docs/kit/hooks#Server-hooks-handle).
1931+
Contains custom data that was added to the request within the [`server handle hook`](/docs/kit/hooks#Server-hooks-handle).
19321932

19331933
</div>
19341934
</div>
@@ -2026,7 +2026,7 @@ export async function load({ fetch, setHeaders }) {
20262026

20272027
Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once.
20282028

2029-
You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](https://svelte.dev/docs/kit/@sveltejs-kit#Cookies) API instead.
2029+
You cannot add a `set-cookie` header with `setHeaders` — use the [`cookies`](/docs/kit/@sveltejs-kit#Cookies) API instead.
20302030

20312031
</div>
20322032
</div>
@@ -2486,7 +2486,7 @@ depends(...deps: string[]): void;
24862486

24872487
<div class="ts-block-property-details">
24882488

2489-
This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](https://svelte.dev/docs/kit/$app-navigation#invalidate) to cause `load` to rerun.
2489+
This function declares that the `load` function has a _dependency_ on one or more URLs or custom identifiers, which can subsequently be used with [`invalidate()`](/docs/kit/$app-navigation#invalidate) to cause `load` to rerun.
24902490

24912491
Most of the time you won't need this, as `fetch` calls `depends` on your behalf — it's only necessary if you're using a custom API client that bypasses `fetch`.
24922492

@@ -3072,7 +3072,7 @@ sandbox?: Array<
30723072

30733073
<div class="ts-block-property-bullets">
30743074

3075-
- <span class="tag deprecated">deprecated</span>
3075+
- <span class="tag deprecated">deprecated</span>
30763076

30773077
</div>
30783078

@@ -3089,7 +3089,7 @@ sandbox?: Array<
30893089

30903090
<div class="ts-block-property-bullets">
30913091

3092-
- <span class="tag deprecated">deprecated</span>
3092+
- <span class="tag deprecated">deprecated</span>
30933093

30943094
</div>
30953095

@@ -3106,7 +3106,7 @@ sandbox?: Array<
31063106

31073107
<div class="ts-block-property-bullets">
31083108

3109-
- <span class="tag deprecated">deprecated</span>
3109+
- <span class="tag deprecated">deprecated</span>
31103110

31113111
</div>
31123112

@@ -3133,7 +3133,7 @@ referrer?: Array<
31333133

31343134
<div class="ts-block-property-bullets">
31353135

3136-
- <span class="tag deprecated">deprecated</span>
3136+
- <span class="tag deprecated">deprecated</span>
31373137

31383138
</div>
31393139

apps/svelte.dev/content/docs/kit/98-reference/50-configuration.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ compilerOptions?: CompileOptions;
4949

5050
</div>
5151

52-
Options passed to [`svelte.compile`](https://svelte.dev/docs/svelte/svelte-compiler#CompileOptions).
52+
Options passed to [`svelte.compile`](/docs/svelte/svelte-compiler#CompileOptions).
5353

5454
</div>
5555
</div>
@@ -139,7 +139,7 @@ The `kit` property configures SvelteKit, and can have the following properties:
139139

140140
</div>
141141

142-
Your [adapter](https://svelte.dev/docs/kit/adapters) is run when executing `vite build`. It determines how the output is converted for different platforms.
142+
Your [adapter](/docs/kit/adapters) is run when executing `vite build`. It determines how the output is converted for different platforms.
143143

144144
<div class="ts-block-property-children">
145145

@@ -247,9 +247,9 @@ When pages are prerendered, the CSP header is added via a `<meta http-equiv>` ta
247247

248248
> [!NOTE] When `mode` is `'auto'`, SvelteKit will use nonces for dynamically rendered pages and hashes for prerendered pages. Using nonces with prerendered pages is insecure and therefore forbidden.
249249
250-
> [!NOTE] Note that most [Svelte transitions](https://svelte.dev/tutorial/svelte/transition) work by creating an inline `<style>` element. If you use these in your app, you must either leave the `style-src` directive unspecified or add `unsafe-inline`.
250+
> [!NOTE] Note that most [Svelte transitions](/tutorial/svelte/transition) work by creating an inline `<style>` element. If you use these in your app, you must either leave the `style-src` directive unspecified or add `unsafe-inline`.
251251
252-
If this level of configuration is insufficient and you have more dynamic requirements, you can use the [`handle` hook](https://svelte.dev/docs/kit/hooks#Server-hooks-handle) to roll your own CSP.
252+
If this level of configuration is insufficient and you have more dynamic requirements, you can use the [`handle` hook](/docs/kit/hooks#Server-hooks-handle) to roll your own CSP.
253253

254254
<div class="ts-block-property-children">
255255

@@ -394,7 +394,7 @@ publicPrefix?: string;
394394

395395
</div>
396396

397-
A prefix that signals that an environment variable is safe to expose to client-side code. See [`$env/static/public`](https://svelte.dev/docs/kit/$env-static-public) and [`$env/dynamic/public`](https://svelte.dev/docs/kit/$env-dynamic-public). Note that Vite's [`envPrefix`](https://vitejs.dev/config/shared-options.html#envprefix) must be set separately if you are using Vite's environment variable handling - though use of that feature should generally be unnecessary.
397+
A prefix that signals that an environment variable is safe to expose to client-side code. See [`$env/static/public`](/docs/kit/$env-static-public) and [`$env/dynamic/public`](/docs/kit/$env-dynamic-public). Note that Vite's [`envPrefix`](https://vitejs.dev/config/shared-options.html#envprefix) must be set separately if you are using Vite's environment variable handling - though use of that feature should generally be unnecessary.
398398

399399
</div>
400400
</div>
@@ -414,7 +414,7 @@ privatePrefix?: string;
414414

415415
</div>
416416

417-
A prefix that signals that an environment variable is unsafe to expose to client-side code. Environment variables matching neither the public nor the private prefix will be discarded completely. See [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private) and [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private).
417+
A prefix that signals that an environment variable is unsafe to expose to client-side code. Environment variables matching neither the public nor the private prefix will be discarded completely. See [`$env/static/private`](/docs/kit/$env-static-private) and [`$env/dynamic/private`](/docs/kit/$env-dynamic-private).
418418

419419
</div>
420420
</div>
@@ -476,7 +476,7 @@ client?: string;
476476

477477
</div>
478478

479-
The location of your client [hooks](https://svelte.dev/docs/kit/hooks).
479+
The location of your client [hooks](/docs/kit/hooks).
480480

481481
</div>
482482
</div>
@@ -495,7 +495,7 @@ server?: string;
495495

496496
</div>
497497

498-
The location of your server [hooks](https://svelte.dev/docs/kit/hooks).
498+
The location of your server [hooks](/docs/kit/hooks).
499499

500500
</div>
501501
</div>
@@ -515,7 +515,7 @@ universal?: string;
515515

516516
</div>
517517

518-
The location of your universal [hooks](https://svelte.dev/docs/kit/hooks).
518+
The location of your universal [hooks](/docs/kit/hooks).
519519

520520
</div>
521521
</div></div>
@@ -556,7 +556,7 @@ params?: string;
556556

557557
</div>
558558

559-
a directory containing [parameter matchers](https://svelte.dev/docs/kit/advanced-routing#Matching)
559+
a directory containing [parameter matchers](/docs/kit/advanced-routing#Matching)
560560

561561
</div>
562562
</div>
@@ -575,7 +575,7 @@ routes?: string;
575575

576576
</div>
577577

578-
the files that define the structure of your app (see [Routing](https://svelte.dev/docs/kit/routing))
578+
the files that define the structure of your app (see [Routing](/docs/kit/routing))
579579

580580
</div>
581581
</div>
@@ -594,7 +594,7 @@ serviceWorker?: string;
594594

595595
</div>
596596

597-
the location of your service worker's entry point (see [Service workers](https://svelte.dev/docs/kit/service-workers))
597+
the location of your service worker's entry point (see [Service workers](/docs/kit/service-workers))
598598

599599
</div>
600600
</div>
@@ -798,7 +798,7 @@ base?: '' | `/${string}`;
798798

799799
</div>
800800

801-
A root-relative path that must start, but not end with `/` (e.g. `/base-path`), unless it is the empty string. This specifies where your app is served from and allows the app to live on a non-root path. Note that you need to prepend all your root-relative links with the base value or they will point to the root of your domain, not your `base` (this is how the browser works). You can use [`base` from `$app/paths`](https://svelte.dev/docs/kit/$app-paths#base) for that: `<a href="{base}/your-page">Link</a>`. If you find yourself writing this often, it may make sense to extract this into a reusable component.
801+
A root-relative path that must start, but not end with `/` (e.g. `/base-path`), unless it is the empty string. This specifies where your app is served from and allows the app to live on a non-root path. Note that you need to prepend all your root-relative links with the base value or they will point to the root of your domain, not your `base` (this is how the browser works). You can use [`base` from `$app/paths`](/docs/kit/$app-paths#base) for that: `<a href="{base}/your-page">Link</a>`. If you find yourself writing this often, it may make sense to extract this into a reusable component.
802802

803803
</div>
804804
</div>
@@ -823,7 +823,7 @@ Whether to use relative asset paths.
823823
If `true`, `base` and `assets` imported from `$app/paths` will be replaced with relative asset paths during server-side rendering, resulting in more portable HTML.
824824
If `false`, `%sveltekit.assets%` and references to build artifacts will always be root-relative paths, unless `paths.assets` is an external URL
825825

826-
[Single-page app](https://svelte.dev/docs/kit/single-page-apps) fallback pages will always use absolute paths, regardless of this setting.
826+
[Single-page app](/docs/kit/single-page-apps) fallback pages will always use absolute paths, regardless of this setting.
827827

828828
If your app uses a `<base>` element, you should set this to `false`, otherwise asset URLs will incorrectly be resolved against the `<base>` URL rather than the current page.
829829

@@ -842,7 +842,7 @@ In 1.0, `undefined` was a valid value, which was set by default. In that case, i
842842

843843
</div>
844844

845-
See [Prerendering](https://svelte.dev/docs/kit/page-options#prerender).
845+
See [Prerendering](/docs/kit/page-options#prerender).
846846

847847
<div class="ts-block-property-children">
848848

@@ -1174,7 +1174,7 @@ Not all navigations will result in an error though, for example if the JavaScrip
11741174
</script>
11751175
```
11761176
1177-
If you set `pollInterval` to a non-zero value, SvelteKit will poll for new versions in the background and set the value of [`updated.current`](https://svelte.dev/docs/kit/$app-state#updated) `true` when it detects one.
1177+
If you set `pollInterval` to a non-zero value, SvelteKit will poll for new versions in the background and set the value of [`updated.current`](/docs/kit/$app-state#updated) `true` when it detects one.
11781178
11791179
<div class="ts-block-property-children">
11801180

0 commit comments

Comments
 (0)