mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-14 03:04:40 +00:00
update to v2
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<:Head>
|
||||
<svelte:head>
|
||||
<title>Not found</title>
|
||||
</:Head>
|
||||
</svelte:head>
|
||||
|
||||
<Layout page='home'>
|
||||
<h1>Not found</h1>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<:Head>
|
||||
<svelte:head>
|
||||
<title>Internal server error</title>
|
||||
</:Head>
|
||||
</svelte:head>
|
||||
|
||||
<Layout page='home'>
|
||||
<h1>Internal server error</h1>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Nav page={{page}}/>
|
||||
<Nav page={page}/>
|
||||
|
||||
<main>
|
||||
<slot></slot>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<:Head>
|
||||
<svelte:head>
|
||||
<title>About</title>
|
||||
</:Head>
|
||||
</svelte:head>
|
||||
|
||||
<Layout page='about'>
|
||||
<h1>About this site</h1>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<:Head>
|
||||
<svelte:head>
|
||||
<title>Sapper project template</title>
|
||||
</:Head>
|
||||
</svelte:head>
|
||||
|
||||
<Layout page='home'>
|
||||
<h1>Great success!</h1>
|
||||
|
||||
@@ -19,8 +19,6 @@ module.exports = {
|
||||
loader: 'svelte-loader',
|
||||
options: {
|
||||
hydratable: true,
|
||||
cascade: false,
|
||||
store: true,
|
||||
hotReload: true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,6 @@ module.exports = {
|
||||
loader: 'svelte-loader',
|
||||
options: {
|
||||
css: false,
|
||||
cascade: false,
|
||||
store: true,
|
||||
generate: 'ssr'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user