update to v2

This commit is contained in:
Rich Harris
2018-04-19 11:05:29 -04:00
parent 247c3c2dbd
commit a7cb019102
11 changed files with 23 additions and 27 deletions

View File

@@ -17,7 +17,7 @@
"polka": "^0.3.4",
"sapper": "^0.10.0",
"serve-static": "^1.13.1",
"svelte": "^1.57.3",
"svelte": "^2.0.0",
"svelte-loader": "^2.3.3",
"webpack": "^4.1.0"
}

View File

@@ -1,6 +1,6 @@
<:Head>
<svelte:head>
<title>Not found</title>
</:Head>
</svelte:head>
<Layout page='home'>
<h1>Not found</h1>

View File

@@ -1,6 +1,6 @@
<:Head>
<svelte:head>
<title>Internal server error</title>
</:Head>
</svelte:head>
<Layout page='home'>
<h1>Internal server error</h1>

View File

@@ -1,4 +1,4 @@
<Nav page={{page}}/>
<Nav page={page}/>
<main>
<slot></slot>

View File

@@ -1,11 +1,11 @@
<nav>
<ul>
<li><a class='{{page === "home" ? "selected" : ""}}' href='.'>home</a></li>
<li><a class='{{page === "about" ? "selected" : ""}}' href='about'>about</a></li>
<li><a class='{page === "home" ? "selected" : ""}' href='.'>home</a></li>
<li><a class='{page === "about" ? "selected" : ""}' href='about'>about</a></li>
<!-- for the blog link, we're using rel=prefetch so that Sapper prefetches
the blog data when we hover over the link or tap it on a touchscreen -->
<li><a rel=prefetch class='{{page === "blog" ? "selected" : ""}}' href='blog'>blog</a></li>
<li><a rel=prefetch class='{page === "blog" ? "selected" : ""}' href='blog'>blog</a></li>
</ul>
</nav>

View File

@@ -1,6 +1,6 @@
<:Head>
<svelte:head>
<title>About</title>
</:Head>
</svelte:head>
<Layout page='about'>
<h1>About this site</h1>

View File

@@ -1,12 +1,12 @@
<:Head>
<title>{{post.title}}</title>
</:Head>
<svelte:head>
<title>{post.title}</title>
</svelte:head>
<Layout page='blog'>
<h1>{{post.title}}</h1>
<h1>{post.title}</h1>
<div class='content'>
{{{post.html}}}
{@html post.html}
</div>
</Layout>

View File

@@ -1,18 +1,18 @@
<:Head>
<svelte:head>
<title>Blog</title>
</:Head>
</svelte:head>
<Layout page='blog'>
<h1>Recent posts</h1>
<ul>
{{#each posts as post}}
{#each posts as post}
<!-- we're using the non-standard `rel=prefetch` attribute to
tell Sapper to load the data for the page as soon as
the user hovers over the link or taps it, instead of
waiting for the 'click' event -->
<li><a rel='prefetch' href='blog/{{post.slug}}'>{{post.title}}</a></li>
{{/each}}
<li><a rel='prefetch' href='blog/{post.slug}'>{post.title}</a></li>
{/each}
</ul>
</Layout>

View File

@@ -1,6 +1,6 @@
<:Head>
<svelte:head>
<title>Sapper project template</title>
</:Head>
</svelte:head>
<Layout page='home'>
<h1>Great success!</h1>

View File

@@ -19,8 +19,6 @@ module.exports = {
loader: 'svelte-loader',
options: {
hydratable: true,
cascade: false,
store: true,
hotReload: true
}
}

View File

@@ -18,8 +18,6 @@ module.exports = {
loader: 'svelte-loader',
options: {
css: false,
cascade: false,
store: true,
generate: 'ssr'
}
}