Skip to content

fix(site): renderer new link format #8787

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

Merged
merged 4 commits into from
Jun 22, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ The `<svelte:options>` element provides a place to specify per-component compile

## `<svelte:fragment>`

The `<svelte:fragment>` element allows you to place content in a [named slot](/docs/special-elements#slot-name-name) without wrapping it in a container DOM element. This keeps the flow layout of your document intact.
The `<svelte:fragment>` element allows you to place content in a [named slot](/docs/special-elements#slot-slot-name-name) without wrapping it in a container DOM element. This keeps the flow layout of your document intact.

```svelte
<!-- Widget.svelte -->
Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/03-runtime/02-svelte-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: 'svelte/store'

The `svelte/store` module exports functions for creating [readable](/docs/svelte-store#readable), [writable](/docs/svelte-store#writable) and [derived](/docs/svelte-store#derived) stores.

Keep in mind that you don't _have_ to use these functions to enjoy the [reactive `$store` syntax](/docs/svelte-components#4-prefix-stores-with-$-to-access-their-values) in your components. Any object that correctly implements `.subscribe`, unsubscribe, and (optionally) `.set` is a valid store, and will work both with the special syntax, and with Svelte's built-in [`derived` stores](/docs/svelte-store#derived).
Keep in mind that you don't _have_ to use these functions to enjoy the [reactive `$store` syntax](/docs/svelte-components#script-4-prefix-stores-with-$-to-access-their-values) in your components. Any object that correctly implements `.subscribe`, unsubscribe, and (optionally) `.set` is a valid store, and will work both with the special syntax, and with Svelte's built-in [`derived` stores](/docs/svelte-store#derived).

This makes it possible to wrap almost any other reactive state handling library for use in Svelte. Read more about the [store contract](/docs/svelte-components#4-prefix-stores-with-$-to-access-their-values) to see what a correct implementation looks like.
This makes it possible to wrap almost any other reactive state handling library for use in Svelte. Read more about the [store contract](/docs/svelte-components#script-4-prefix-stores-with-$-to-access-their-values) to see what a correct implementation looks like.

## `writable`

Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/04-compiler-and-api/01-svelte-compiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const result = compile(source, {
});
```

Refer to [CompileOptions](#type-compileoptions) for all the available options.
Refer to [CompileOptions](#types-compileoptions) for all the available options.

The returned `result` object contains the code for your component, along with useful bits of metadata.

Expand All @@ -47,7 +47,7 @@ import { compile } from 'svelte/compiler';
const { js, css, ast, warnings, vars, stats } = compile(source);
```

Refer to [CompileResult](#type-compileresult) for a full description of the compile result.
Refer to [CompileResult](#types-compileresult) for a full description of the compile result.

## parse

Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sites/svelte.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@resvg/resvg-js": "^2.4.1",
"@sveltejs/adapter-vercel": "^3.0.1",
"@sveltejs/kit": "^1.20.4",
"@sveltejs/site-kit": "6.0.0-next.11",
"@sveltejs/site-kit": "6.0.0-next.14",
"@sveltejs/vite-plugin-svelte": "^2.4.1",
"@types/marked": "^5.0.0",
"@types/node": "^20.3.1",
Expand Down
2 changes: 1 addition & 1 deletion sites/svelte.dev/src/lib/server/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const render_content = (filename, body) =>
resolveTypeLinks: (module_name, type_name) => {
return {
page: `/docs/${slugify(module_name)}`,
slug: `type-${slugify(type_name)}`
slug: `types-${slugify(type_name)}`
};
},

Expand Down
8 changes: 4 additions & 4 deletions sites/svelte.dev/src/routes/docs/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@

// component-format-
[/component-format-(script|style|script-context-module)$/i, 'svelte-components#$1'],
[/component-format-(?:script)(?:-?(.*))$/i, 'svelte-components#$1'],
[/component-format-(script)(?:-?(.*))$/i, 'svelte-components#$1-$2'],

// template-syntax
[/template-syntax-((?:element|component)-directives)-?(.*)/i, '$1#$2'],
[/template-syntax-slot$/i, 'special-elements#slot'],
[/template-syntax-(?:slot)-?(.*)/i, 'special-elements#$1'],
[/template-syntax-(slot)-?(.*)/i, 'special-elements#$1-$2'],
[/template-syntax-(if|each|await|key)$/i, 'logic-blocks#$1'],
[/template-syntax-(const|debug|html)$/i, 'special-tags#$1'],
[/template-syntax-(tags|attributes-and-props|text-expressions|comments)$/i, 'basic-markup#$1'],
Expand Down Expand Up @@ -196,7 +196,7 @@
return new_ids;
}

function getURlToRedirectTo() {
function get_url_to_redirect_to() {
const hash = $page.url.hash.replace(/^#/i, '');

if (!hash) return '/docs/introduction';
Expand All @@ -211,6 +211,6 @@

onMount(() => {
console.log(get_old_new_ids_map());
goto(getURlToRedirectTo(), { replaceState: true });
goto(get_url_to_redirect_to(), { replaceState: true });
});
</script>