mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-21 22:15:00 +00:00
update to v2
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
"polka": "^0.3.4",
|
"polka": "^0.3.4",
|
||||||
"sapper": "^0.10.0",
|
"sapper": "^0.10.0",
|
||||||
"serve-static": "^1.13.1",
|
"serve-static": "^1.13.1",
|
||||||
"svelte": "^1.57.3",
|
"svelte": "^2.0.0",
|
||||||
"svelte-loader": "^2.3.3",
|
"svelte-loader": "^2.3.3",
|
||||||
"webpack": "^4.1.0"
|
"webpack": "^4.1.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<:Head>
|
<svelte:head>
|
||||||
<title>Not found</title>
|
<title>Not found</title>
|
||||||
</:Head>
|
</svelte:head>
|
||||||
|
|
||||||
<Layout page='home'>
|
<Layout page='home'>
|
||||||
<h1>Not found</h1>
|
<h1>Not found</h1>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<:Head>
|
<svelte:head>
|
||||||
<title>Internal server error</title>
|
<title>Internal server error</title>
|
||||||
</:Head>
|
</svelte:head>
|
||||||
|
|
||||||
<Layout page='home'>
|
<Layout page='home'>
|
||||||
<h1>Internal server error</h1>
|
<h1>Internal server error</h1>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<Nav page={{page}}/>
|
<Nav page={page}/>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a class='{{page === "home" ? "selected" : ""}}' href='.'>home</a></li>
|
<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 === "about" ? "selected" : ""}' href='about'>about</a></li>
|
||||||
|
|
||||||
<!-- for the blog link, we're using rel=prefetch so that Sapper prefetches
|
<!-- 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 -->
|
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>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<:Head>
|
<svelte:head>
|
||||||
<title>About</title>
|
<title>About</title>
|
||||||
</:Head>
|
</svelte:head>
|
||||||
|
|
||||||
<Layout page='about'>
|
<Layout page='about'>
|
||||||
<h1>About this site</h1>
|
<h1>About this site</h1>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<:Head>
|
<svelte:head>
|
||||||
<title>{{post.title}}</title>
|
<title>{post.title}</title>
|
||||||
</:Head>
|
</svelte:head>
|
||||||
|
|
||||||
<Layout page='blog'>
|
<Layout page='blog'>
|
||||||
<h1>{{post.title}}</h1>
|
<h1>{post.title}</h1>
|
||||||
|
|
||||||
<div class='content'>
|
<div class='content'>
|
||||||
{{{post.html}}}
|
{@html post.html}
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<:Head>
|
<svelte:head>
|
||||||
<title>Blog</title>
|
<title>Blog</title>
|
||||||
</:Head>
|
</svelte:head>
|
||||||
|
|
||||||
<Layout page='blog'>
|
<Layout page='blog'>
|
||||||
<h1>Recent posts</h1>
|
<h1>Recent posts</h1>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{{#each posts as post}}
|
{#each posts as post}
|
||||||
<!-- we're using the non-standard `rel=prefetch` attribute to
|
<!-- we're using the non-standard `rel=prefetch` attribute to
|
||||||
tell Sapper to load the data for the page as soon as
|
tell Sapper to load the data for the page as soon as
|
||||||
the user hovers over the link or taps it, instead of
|
the user hovers over the link or taps it, instead of
|
||||||
waiting for the 'click' event -->
|
waiting for the 'click' event -->
|
||||||
<li><a rel='prefetch' href='blog/{{post.slug}}'>{{post.title}}</a></li>
|
<li><a rel='prefetch' href='blog/{post.slug}'>{post.title}</a></li>
|
||||||
{{/each}}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<:Head>
|
<svelte:head>
|
||||||
<title>Sapper project template</title>
|
<title>Sapper project template</title>
|
||||||
</:Head>
|
</svelte:head>
|
||||||
|
|
||||||
<Layout page='home'>
|
<Layout page='home'>
|
||||||
<h1>Great success!</h1>
|
<h1>Great success!</h1>
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ module.exports = {
|
|||||||
loader: 'svelte-loader',
|
loader: 'svelte-loader',
|
||||||
options: {
|
options: {
|
||||||
hydratable: true,
|
hydratable: true,
|
||||||
cascade: false,
|
|
||||||
store: true,
|
|
||||||
hotReload: true
|
hotReload: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ module.exports = {
|
|||||||
loader: 'svelte-loader',
|
loader: 'svelte-loader',
|
||||||
options: {
|
options: {
|
||||||
css: false,
|
css: false,
|
||||||
cascade: false,
|
|
||||||
store: true,
|
|
||||||
generate: 'ssr'
|
generate: 'ssr'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user