Skip to content

redirect requests for playground to svelte.dev #8

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 1 commit into from
Nov 12, 2024
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
5 changes: 5 additions & 0 deletions apps/svelte.dev/src/routes/(authed)/apps/+page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { redirect } from '@sveltejs/kit';

export function load({ url }) {
redirect(301, `https://svelte.dev${url.pathname}`);
}
2 changes: 1 addition & 1 deletion apps/svelte.dev/src/routes/(authed)/playground/+page.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export function load({ url }) {
const q = new URLSearchParams();
if (version) q.set('version', version);
if (vim) q.set('vim', vim);
redirect(301, `/playground/${id}?${q}`);
redirect(301, `https://svelte.dev/playground/${id}?${q}`);
}
4 changes: 2 additions & 2 deletions apps/svelte.dev/src/routes/docs/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@
</p>
</a>

<a href="/playground">
<a href="https://svelte.dev/playground" class="external" target="_blank">
<h2>とりあえず試してみたい方</h2>
<p>
Playground に移動し、example を確認したり、Svelte アプリをブラウザ上で作ったり、
それを他の人にシェアすることができます。
</p>
</a>

<a href="/chat" class="external">
<a href="/chat" class="external" target="_blank">
<h2>助けて!行き詰まった!という方</h2>
<p>
私たちの Discord サーバーで他の Svelte ユーザーたちと一緒に過ごしたり、質問したりしましょう。
Expand Down
16 changes: 10 additions & 6 deletions packages/site-kit/src/lib/nav/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ Top navigation bar for the application. It provides a slot for the left side, th
{/snippet}
</Dropdown>
{:else}
<a
href="/{link.slug}"
aria-current={$page.url.pathname.startsWith(`/${link.slug}`) ? 'page' : null}
>
{link.title}
</a>
{#if link.slug === 'playground'}
<a href="https://svelte.dev/playground" target="_blank">{link.title}</a>
{:else}
<a
href="/{link.slug}"
aria-current={$page.url.pathname.startsWith(`/${link.slug}`) ? 'page' : null}
>
{link.title}
</a>
{/if}
{/if}
{/each}
</div>
Expand Down
Loading