Skip to content

Commit

Permalink
follow up docs for #3578 (#3619)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb authored Jan 29, 2022
1 parent f4adea1 commit d0310c1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions documentation/docs/11-page-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If both are specified, per-page settings override per-app settings in case of co

SvelteKit includes a [client-side router](#appendix-routing) that intercepts navigations (from the user clicking on links, or interacting with the back/forward buttons) and updates the page contents, rather than letting the browser handle the navigation by reloading.

In certain circumstances you might need to disable [client-side routing](#appendix-routing) with the app-wide [`router` config option](#configuration-router) or the page-level `router` export:
In certain circumstances you might need to disable [client-side routing](#appendix-routing) with the app-wide [`browser.router` config option](#configuration-browser) or the page-level `router` export:

```html
<script context="module">
Expand All @@ -24,7 +24,7 @@ Note that this will disable client-side routing for any navigation from this pag

### hydrate

Ordinarily, SvelteKit [hydrates](#appendix-hydration) your server-rendered HTML into an interactive page. Some pages don't require JavaScript at all — many blog posts and 'about' pages fall into this category. In these cases you can skip hydration when the app boots up with the app-wide [`hydrate` config option](#configuration-hydrate) or the page-level `hydrate` export:
Ordinarily, SvelteKit [hydrates](#appendix-hydration) your server-rendered HTML into an interactive page. Some pages don't require JavaScript at all — many blog posts and 'about' pages fall into this category. In these cases you can skip hydration when the app boots up with the app-wide [`browser.hydrate` config option](#configuration-browser) or the page-level `hydrate` export:

```html
<script context="module">
Expand Down
21 changes: 11 additions & 10 deletions documentation/docs/14-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const config = {
adapter: null,
amp: false,
appDir: '_app',
browser: {
hydrate: true,
router: true
},
csp: {
mode: 'auto',
directives: {
Expand All @@ -33,7 +37,6 @@ const config = {
template: 'src/app.html'
},
floc: false,
hydrate: true,
inlineStyleThreshold: 0,
methodOverride: {
parameter: '_method',
Expand All @@ -58,7 +61,6 @@ const config = {
entries: ['*'],
onError: 'fail'
},
router: true,
routes: (filepath) => !/(?:(?:^_|\/_)|(?:^\.|\/\.)(?!well-known))/.test(filepath),
serviceWorker: {
register: true,
Expand Down Expand Up @@ -91,6 +93,13 @@ Enable [AMP](#amp) mode.

The directory relative to `paths.assets` where the built JS and CSS (and imported assets) are served from. (The filenames therein contain content-based hashes, meaning they can be cached indefinitely). Must not start or end with `/`.

### browser

An object containing zero or more of the following `boolean` values:

- `hydrate` — whether to [hydrate](#page-options-hydrate) the server-rendered HTML with a client-side app. (It's rare that you would set this to `false` on an app-wide basis.)
- `router` — enables or disables the client-side [router](#page-options-router) app-wide.

### csp

An object containing zero or more of the following values:
Expand Down Expand Up @@ -137,10 +146,6 @@ Permissions-Policy: interest-cohort=()

> This only applies to server-rendered responses — headers for prerendered pages (e.g. created with [adapter-static](https://github.com/sveltejs/kit/tree/master/packages/adapter-static)) are determined by the hosting platform.
### hydrate

Whether to [hydrate](#page-options-hydrate) the server-rendered HTML with a client-side app. (It's rare that you would set this to `false` on an app-wide basis.)

### inlineStyleThreshold

Inline CSS inside a `<style>` block at the head of the HTML. This option is a number that specifies the maximum length of a CSS file to be inlined. All CSS files needed for the page and smaller than this value are merged and inlined in a `<style>` block.
Expand Down Expand Up @@ -223,10 +228,6 @@ See [Prerendering](#page-options-prerender). An object containing zero or more o
};
```

### router

Enables or disables the client-side [router](#page-options-router) app-wide.

### routes

A `(filepath: string) => boolean` function that determines which files create routes and which are treated as [private modules](#routing-private-modules).
Expand Down

0 comments on commit d0310c1

Please sign in to comment.