Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix missed links to new multi-page docs #3815

Merged
merged 9 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/beige-months-obey.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@sveltejs/kit': patch
---

Breaking: Add disableScrollHandling function (see https://kit.svelte.dev/docs#modules-$app-navigation)
Breaking: Add disableScrollHandling function (see https://kit.svelte.dev/docs/modules#$app-navigation)
7 changes: 7 additions & 0 deletions .changeset/clever-shrimps-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@sveltejs/adapter-auto': patch
'create-svelte': patch
'@sveltejs/kit': patch
---

fix links pointing to multi-page docs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The SvelteKit community also makes additional [SvelteKit adapters available for

### Migrating from Sapper

Check out the [Migration Guide](https://kit.svelte.dev/migrating) if you are upgrading from Sapper.
Check out the [Migration Guide](https://kit.svelte.dev/docs/migrating) if you are upgrading from Sapper.

## Bug reporting

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/80-migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Migrating from Sapper

SvelteKit is the successor to Sapper and shares many elements of its design.

If you have an existing Sapper app that you plan to migrate to SvelteKit, there are a number of changes you will need to make. You may find it helpful to view [some examples](https://kit.svelte.dev/docs#additional-resources-examples) while migrating.
If you have an existing Sapper app that you plan to migrate to SvelteKit, there are a number of changes you will need to make. You may find it helpful to view [some examples](https://kit.svelte.dev/docs/additional-resources#examples) while migrating.

### package.json

Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-auto/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function () {
}

builder.log.warn(
'Could not detect a supported production environment. See https://kit.svelte.dev/docs#adapters to learn how to configure your app to run on the platform of your choosing'
'Could not detect a supported production environment. See https://kit.svelte.dev/docs/adapters to learn how to configure your app to run on the platform of your choosing'
);
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-cloudflare/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# adapter-cloudflare

[Adapter](https://kit.svelte.dev/docs#adapters) for building SvelteKit applications on [Cloudflare Pages](https://developers.cloudflare.com/pages/) with [Workers integration](https://developers.cloudflare.com/pages/platform/functions).
[Adapter](https://kit.svelte.dev/docs/adapters) for building SvelteKit applications on [Cloudflare Pages](https://developers.cloudflare.com/pages/) with [Workers integration](https://developers.cloudflare.com/pages/platform/functions).

If you're using [adapter-auto](../adapter-auto), you don't need to install this — it's already included.

Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-netlify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ During compilation, redirect rules are automatically appended to your `_redirect
### Using Netlify Forms

1. Create your Netlify HTML form as described [here](https://docs.netlify.com/forms/setup/#html-forms), e.g. as `/routes/contact.svelte`. (Don't forget to add the hidden `form-name` input element!)
2. Netlify's build bot parses your HTML files at deploy time, which means your form must be [prerendered](https://kit.svelte.dev/docs#page-options-prerender) as HTML. You can either add `export const prerender = true` to your `contact.svelte` to prerender just that page or set the `kit.prerender.force: true` option to prerender all pages.
2. Netlify's build bot parses your HTML files at deploy time, which means your form must be [prerendered](https://kit.svelte.dev/docs/page-options#prerender) as HTML. You can either add `export const prerender = true` to your `contact.svelte` to prerender just that page or set the `kit.prerender.force: true` option to prerender all pages.
3. If your Netlify form has a [custom success message](https://docs.netlify.com/forms/setup/#success-messages) like `<form netlify ... action="/success">` then ensure the corresponding `/routes/success.svelte` exists and is prerendered.

### Using Netlify Functions
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-node/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @sveltejs/adapter-node

[Adapter](https://kit.svelte.dev/docs#adapters) for SvelteKit apps that generates a standalone Node server.
[Adapter](https://kit.svelte.dev/docs/adapters) for SvelteKit apps that generates a standalone Node server.

## Usage

Expand Down
8 changes: 4 additions & 4 deletions packages/adapter-static/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @sveltejs/adapter-static

[Adapter](https://kit.svelte.dev/docs#adapters) for SvelteKit apps that prerenders your site as a collection of static files.
[Adapter](https://kit.svelte.dev/docs/adapters) for SvelteKit apps that prerenders your site as a collection of static files.

## Usage

Expand All @@ -23,7 +23,7 @@ export default {
};
```

Unless you're in [SPA mode](#spa-mode), the adapter will attempt to prerender every page of your app, regardless of whether the [`prerender`](https://kit.svelte.dev/docs#page-options-prerender) option is set.
Unless you're in [SPA mode](#spa-mode), the adapter will attempt to prerender every page of your app, regardless of whether the [`prerender`](https://kit.svelte.dev/docs/page-options#prerender) option is set.

## Options

Expand Down Expand Up @@ -64,11 +64,11 @@ export default {
};
```

When operating in SPA mode, only pages that have the [`prerender`](https://kit.svelte.dev/docs#page-options-prerender) option set will be prerendered.
When operating in SPA mode, only pages that have the [`prerender`](https://kit.svelte.dev/docs/page-options#prerender) option set will be prerendered.

## GitHub Pages

When building for GitHub Pages, make sure to update [`paths.base`](https://kit.svelte.dev/docs#configuration-paths) to match your repo name, since the site will be served from https://your-username.github.io/your-repo-name rather than from the root.
When building for GitHub Pages, make sure to update [`paths.base`](https://kit.svelte.dev/docs/configuration#paths) to match your repo name, since the site will be served from <https://your-username.github.io/your-repo-name> rather than from the root.

You will have to prevent GitHub's provided Jekyll from managing your site by putting an empty `.nojekyll` file in your static folder. If you do not want to disable Jekyll, change the kit's `appDir` configuration option to `'app_'` or anything not starting with an underscore. For more information, see GitHub's [Jekyll documentation](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll#configuring-jekyll-in-your-github-pages-site).

Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-static/test/apps/spa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ npm run dev -- --open

## Building

Before creating a production version of your app, install an [adapter](https://kit.svelte.dev/docs#adapters) for your target environment. Then:
Before creating a production version of your app, install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. Then:

```bash
npm run build
Expand Down
2 changes: 1 addition & 1 deletion packages/create-svelte/shared/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ npm run build

You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs#adapters) for your target environment.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
2 changes: 1 addition & 1 deletion packages/create-svelte/templates/default/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="@sveltejs/kit" />

// See https://kit.svelte.dev/docs#typescript
// See https://kit.svelte.dev/docs/typescript
// for information about these interfaces
declare namespace App {
interface Locals {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-svelte/templates/skeleton/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="@sveltejs/kit" />

// See https://kit.svelte.dev/docs#typescript
// See https://kit.svelte.dev/docs/typescript
// for information about these interfaces
declare namespace App {
interface Locals {}
Expand Down
6 changes: 3 additions & 3 deletions packages/kit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@

### Patch Changes

- Allow endpoints to return a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response), or an object with [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) ([docs](https://kit.svelte.dev/docs#routing-endpoints), [#3384](https://github.com/sveltejs/kit/pull/3384))
- Allow endpoints to return a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response), or an object with [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) ([docs](https://kit.svelte.dev/docs/routing#endpoints), [#3384](https://github.com/sveltejs/kit/pull/3384))

* [breaking] Expose standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object to endpoints and hooks. `method`, `headers`, and `body` now accessed through `request` field ([docs](https://kit.svelte.dev/docs#routing-endpoints), [#3384](https://github.com/sveltejs/kit/pull/3384))
* [breaking] Expose standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object to endpoints and hooks. `method`, `headers`, and `body` now accessed through `request` field ([docs](https://kit.svelte.dev/docs/routing#endpoints), [#3384](https://github.com/sveltejs/kit/pull/3384))

- [breaking] change `app.render` signature to (request: Request) => Promise<Response> ([#3384](https://github.com/sveltejs/kit/pull/3384))

Expand Down Expand Up @@ -370,7 +370,7 @@

### Patch Changes

- [breaking] Add `disableScrollHandling` function (see https://kit.svelte.dev/docs#modules-$app-navigation) ([#3182](https://github.com/sveltejs/kit/pull/3182))
- [breaking] Add `disableScrollHandling` function (see https://kit.svelte.dev/docs/modules#$app-navigation) ([#3182](https://github.com/sveltejs/kit/pull/3182))

## 1.0.0-next.213

Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ prog

// prettier-ignore
console.log(
`See ${colors.bold().cyan('https://kit.svelte.dev/docs#adapters')} to learn how to configure your app to run on the platform of your choosing`
`See ${colors.bold().cyan('https://kit.svelte.dev/docs/adapters')} to learn how to configure your app to run on the platform of your choosing`
);
} catch (error) {
handle_error(error);
Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/core/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function load_config({ cwd = process.cwd() } = {}) {

if (!fs.existsSync(config_file)) {
throw new Error(
'You need to create a svelte.config.js file. See https://kit.svelte.dev/docs#configuration'
'You need to create a svelte.config.js file. See https://kit.svelte.dev/docs/configuration'
);
}

Expand All @@ -57,7 +57,7 @@ export async function load_config({ cwd = process.cwd() } = {}) {
export function validate_config(config) {
if (typeof config !== 'object') {
throw new Error(
'svelte.config.js must have a configuration object as its default export. See https://kit.svelte.dev/docs#configuration'
'svelte.config.js must have a configuration object as its default export. See https://kit.svelte.dev/docs/configuration'
);
}

Expand Down
16 changes: 8 additions & 8 deletions packages/kit/src/core/config/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ test('fails if kit.appDir is only slash', () => {
appDir: '/'
}
});
}, /^config\.kit\.appDir cannot start or end with '\/'. See https:\/\/kit\.svelte\.dev\/docs#configuration$/);
}, /^config\.kit\.appDir cannot start or end with '\/'. See https:\/\/kit\.svelte\.dev\/docs\/configuration$/);
});

test('fails if kit.appDir starts with slash', () => {
Expand All @@ -214,7 +214,7 @@ test('fails if kit.appDir starts with slash', () => {
appDir: '/_app'
}
});
}, /^config\.kit\.appDir cannot start or end with '\/'. See https:\/\/kit\.svelte\.dev\/docs#configuration$/);
}, /^config\.kit\.appDir cannot start or end with '\/'. See https:\/\/kit\.svelte\.dev\/docs\/configuration$/);
});

test('fails if kit.appDir ends with slash', () => {
Expand All @@ -224,7 +224,7 @@ test('fails if kit.appDir ends with slash', () => {
appDir: '_app/'
}
});
}, /^config\.kit\.appDir cannot start or end with '\/'. See https:\/\/kit\.svelte\.dev\/docs#configuration$/);
}, /^config\.kit\.appDir cannot start or end with '\/'. See https:\/\/kit\.svelte\.dev\/docs\/configuration$/);
});

test('fails if paths.base is not root-relative', () => {
Expand All @@ -236,7 +236,7 @@ test('fails if paths.base is not root-relative', () => {
}
}
});
}, /^config\.kit\.paths\.base option must be a root-relative path that starts but doesn't end with '\/'. See https:\/\/kit\.svelte\.dev\/docs#configuration-paths$/);
}, /^config\.kit\.paths\.base option must be a root-relative path that starts but doesn't end with '\/'. See https:\/\/kit\.svelte\.dev\/docs\/configuration#paths$/);
});

test("fails if paths.base ends with '/'", () => {
Expand All @@ -248,7 +248,7 @@ test("fails if paths.base ends with '/'", () => {
}
}
});
}, /^config\.kit\.paths\.base option must be a root-relative path that starts but doesn't end with '\/'. See https:\/\/kit\.svelte\.dev\/docs#configuration-paths$/);
}, /^config\.kit\.paths\.base option must be a root-relative path that starts but doesn't end with '\/'. See https:\/\/kit\.svelte\.dev\/docs\/configuration#paths$/);
});

test('fails if paths.assets is relative', () => {
Expand All @@ -260,7 +260,7 @@ test('fails if paths.assets is relative', () => {
}
}
});
}, /^config\.kit\.paths\.assets option must be an absolute path, if specified. See https:\/\/kit\.svelte\.dev\/docs#configuration-paths$/);
}, /^config\.kit\.paths\.assets option must be an absolute path, if specified. See https:\/\/kit\.svelte\.dev\/docs\/configuration#paths$/);
});

test('fails if paths.assets has trailing slash', () => {
Expand All @@ -272,7 +272,7 @@ test('fails if paths.assets has trailing slash', () => {
}
}
});
}, /^config\.kit\.paths\.assets option must not end with '\/'. See https:\/\/kit\.svelte\.dev\/docs#configuration-paths$/);
}, /^config\.kit\.paths\.assets option must not end with '\/'. See https:\/\/kit\.svelte\.dev\/docs\/configuration#paths$/);
});

test('fails if prerender.entries are invalid', () => {
Expand Down Expand Up @@ -363,7 +363,7 @@ test('errors on loading config with incorrect default export', async () => {

assert.equal(
message,
'svelte.config.js must have a configuration object as its default export. See https://kit.svelte.dev/docs#configuration'
'svelte.config.js must have a configuration object as its default export. See https://kit.svelte.dev/docs/configuration'
);
});

Expand Down
12 changes: 6 additions & 6 deletions packages/kit/src/core/config/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const options = object(
message += ', rather than the name of an adapter';
}

throw new Error(`${message}. See https://kit.svelte.dev/docs#adapters`);
throw new Error(`${message}. See https://kit.svelte.dev/docs/adapters`);
}

return input;
Expand All @@ -47,7 +47,7 @@ const options = object(
if (input) {
if (input.startsWith('/') || input.endsWith('/')) {
throw new Error(
"config.kit.appDir cannot start or end with '/'. See https://kit.svelte.dev/docs#configuration"
"config.kit.appDir cannot start or end with '/'. See https://kit.svelte.dev/docs/configuration"
);
}
} else {
Expand Down Expand Up @@ -156,7 +156,7 @@ const options = object(

if (input !== '' && (input.endsWith('/') || !input.startsWith('/'))) {
throw new Error(
`${keypath} option must be a root-relative path that starts but doesn't end with '/'. See https://kit.svelte.dev/docs#configuration-paths`
`${keypath} option must be a root-relative path that starts but doesn't end with '/'. See https://kit.svelte.dev/docs/configuration#paths`
);
}

Expand All @@ -168,13 +168,13 @@ const options = object(
if (input) {
if (!/^[a-z]+:\/\//.test(input)) {
throw new Error(
`${keypath} option must be an absolute path, if specified. See https://kit.svelte.dev/docs#configuration-paths`
`${keypath} option must be an absolute path, if specified. See https://kit.svelte.dev/docs/configuration#paths`
);
}

if (input.endsWith('/')) {
throw new Error(
`${keypath} option must not end with '/'. See https://kit.svelte.dev/docs#configuration-paths`
`${keypath} option must not end with '/'. See https://kit.svelte.dev/docs/configuration#paths`
);
}
}
Expand Down Expand Up @@ -248,7 +248,7 @@ const options = object(
// TODO remove this for 1.0
ssr: error(
(keypath) =>
`${keypath} has been removed — use the handle hook instead: https://kit.svelte.dev/docs#hooks-handle'`
`${keypath} has been removed — use the handle hook instead: https://kit.svelte.dev/docs/hooks#handle'`
),

// TODO remove this for 1.0
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/core/dev/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export async function create_plugin(config, cwd) {
if (/** @type {any} */ (hooks).getContext) {
// TODO remove this for 1.0
throw new Error(
'The getContext hook has been removed. See https://kit.svelte.dev/docs#hooks'
'The getContext hook has been removed. See https://kit.svelte.dev/docs/hooks'
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/packaging/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ async function try_load_svelte2tsx() {
return await import('svelte2tsx');
} catch (e) {
throw new Error(
'You need svelte2tsx and typescript if you want to generate type definitions. Install it through your package manager, or disable generation which is highly discouraged. See https://kit.svelte.dev/docs#packaging'
'You need svelte2tsx and typescript if you want to generate type definitions. Install it through your package manager, or disable generation which is highly discouraged. See https://kit.svelte.dev/docs/packaging'
);
}
}
Expand Down
4 changes: 0 additions & 4 deletions packages/kit/src/runtime/client/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ import { set_paths } from '../paths.js';
* }} opts
*/
export async function start({ paths, target, session, route, spa, trailing_slash, hydrate }) {
if (import.meta.env.DEV && !target) {
throw new Error('Missing target element. See https://kit.svelte.dev/docs#configuration-target');
}

const renderer = new Renderer({
Root,
fallback,
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/runtime/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function respond(request, options, state = {}) {
});
} else {
const verb = allowed.length === 0 ? 'enabled' : 'allowed';
const body = `${parameter}=${method_override} is not ${verb}. See https://kit.svelte.dev/docs#configuration-methodoverride`;
const body = `${parameter}=${method_override} is not ${verb}. See https://kit.svelte.dev/docs/configuration#methodoverride`;

return new Response(body, {
status: 400
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/runtime/server/page/respond.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function get_page_config(leaf, options) {
// TODO remove for 1.0
if ('ssr' in leaf) {
throw new Error(
'`export const ssr` has been removed — use the handle hook instead: https://kit.svelte.dev/docs#hooks-handle'
'`export const ssr` has been removed — use the handle hook instead: https://kit.svelte.dev/docs/hooks#handle'
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/kit/test/apps/basics/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ test.describe.parallel('Method overrides', () => {
await page.click('"No Override To GET"');

expect(await page.innerHTML('pre')).toBe(
'_method=GET is not allowed. See https://kit.svelte.dev/docs#configuration-methodoverride'
'_method=GET is not allowed. See https://kit.svelte.dev/docs/configuration#methodoverride'
);
});

Expand All @@ -1142,7 +1142,7 @@ test.describe.parallel('Method overrides', () => {
await page.click('"No Override To CONNECT"');

expect(await page.innerHTML('pre')).toBe(
'_method=CONNECT is not allowed. See https://kit.svelte.dev/docs#configuration-methodoverride'
'_method=CONNECT is not allowed. See https://kit.svelte.dev/docs/configuration#methodoverride'
);
});
});
Expand Down