Skip to content

Commit

Permalink
redirect requests for playground to svelte.dev (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomoam authored Nov 12, 2024
1 parent 60a83fd commit 11322d5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
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

0 comments on commit 11322d5

Please sign in to comment.