mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-22 22:45:19 +00:00
update for 0.15
This commit is contained in:
26
app/App.html
26
app/App.html
@@ -1,26 +0,0 @@
|
|||||||
<Nav path={props.path}/>
|
|
||||||
|
|
||||||
<main>
|
|
||||||
<svelte:component this={Page} {...props}/>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
main {
|
|
||||||
position: relative;
|
|
||||||
max-width: 56em;
|
|
||||||
background-color: white;
|
|
||||||
padding: 2em;
|
|
||||||
margin: 0 auto;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import Nav from '../components/Nav.html';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
Nav
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
46
routes/_default.html
Normal file
46
routes/_default.html
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<svelte:head>
|
||||||
|
<title>Sapper project template</title>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<h1>Great success!</h1>
|
||||||
|
|
||||||
|
<figure>
|
||||||
|
<img alt='Borat' src='great-success.png'>
|
||||||
|
<figcaption>HIGH FIVE!</figcaption>
|
||||||
|
</figure>
|
||||||
|
|
||||||
|
<p><strong>Try editing this file (routes/index.html) to test hot module reloading.</strong></p>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
h1, figure, p {
|
||||||
|
text-align: center;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2.8em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: 700;
|
||||||
|
margin: 0 0 0.5em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
figure {
|
||||||
|
margin: 0 0 1em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 400px;
|
||||||
|
margin: 0 0 1em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 1em auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 480px) {
|
||||||
|
h1 {
|
||||||
|
font-size: 4em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
32
routes/blog/_default.html
Normal file
32
routes/blog/_default.html
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<svelte:head>
|
||||||
|
<title>Blog</title>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<h1>Recent posts</h1>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{#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}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
ul {
|
||||||
|
margin: 0 0 1em 0;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
preload({ params, query }) {
|
||||||
|
return this.fetch(`blog.json`).then(r => r.json()).then(posts => {
|
||||||
|
return { posts };
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,32 +1 @@
|
|||||||
<svelte:head>
|
<svelte:component this={sapper.child} {...sapper.props}/>
|
||||||
<title>Blog</title>
|
|
||||||
</svelte:head>
|
|
||||||
|
|
||||||
<h1>Recent posts</h1>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
{#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}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
ul {
|
|
||||||
margin: 0 0 1em 0;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
preload({ params, query }) {
|
|
||||||
return this.fetch(`blog.json`).then(r => r.json()).then(posts => {
|
|
||||||
return { posts };
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,46 +1,24 @@
|
|||||||
<svelte:head>
|
<Nav {path}/>
|
||||||
<title>Sapper project template</title>
|
|
||||||
</svelte:head>
|
|
||||||
|
|
||||||
<h1>Great success!</h1>
|
<main>
|
||||||
|
<svelte:component this={sapper.child} {...sapper.props}/>
|
||||||
<figure>
|
</main>
|
||||||
<img alt='Borat' src='great-success.png'>
|
|
||||||
<figcaption>HIGH FIVE!</figcaption>
|
|
||||||
</figure>
|
|
||||||
|
|
||||||
<p><strong>Try editing this file (routes/index.html) to test hot module reloading.</strong></p>
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
h1, figure, p {
|
main {
|
||||||
text-align: center;
|
position: relative;
|
||||||
|
max-width: 56em;
|
||||||
|
background-color: white;
|
||||||
|
padding: 2em;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
box-sizing: border-box;
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 2.8em;
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-weight: 700;
|
|
||||||
margin: 0 0 0.5em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
figure {
|
|
||||||
margin: 0 0 1em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 400px;
|
|
||||||
margin: 0 0 1em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin: 1em auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 480px) {
|
|
||||||
h1 {
|
|
||||||
font-size: 4em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
Nav: '../components/Nav.html'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user