Skip to content

Commit

Permalink
Add about page and configuration for SvelteKit
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Mar 3, 2024
1 parent bdb6165 commit e763c17
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
26 changes: 26 additions & 0 deletions examples/svelte/src/routes/about/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<svelte:head>
<title>About</title>
<meta name="description" content="About this app" />
</svelte:head>

<div class="text-column">
<h1>About this app</h1>

<p>
This is a <a href="https://kit.svelte.dev">SvelteKit</a> app. You can make your own by typing the
following into your command line and following the prompts:
</p>

<pre>npm create svelte@latest</pre>

<p>
The page you're looking at is purely static HTML, with no client-side interactivity needed.
Because of that, we don't need to load any JavaScript. Try viewing the page's source, or opening
the devtools network panel and reloading.
</p>

<p>
The <a href="/sverdle">Sverdle</a> page illustrates SvelteKit's data loading and form handling. Try
using it with JavaScript disabled!
</p>
</div>
9 changes: 9 additions & 0 deletions examples/svelte/src/routes/about/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { dev } from '$app/environment';

// we don't need any JS on this page, though we'll load
// it in dev so that we get hot module replacement
export const csr = dev;

// since there's no dynamic data here, we can prerender
// it so that it gets served as a static asset in production
export const prerender = true;

0 comments on commit e763c17

Please sign in to comment.