set up initial styling and structure
This commit is contained in:
34
src/routes/projects/index.svelte
Normal file
34
src/routes/projects/index.svelte
Normal file
@@ -0,0 +1,34 @@
|
||||
<script context="module">
|
||||
export function preload() {
|
||||
return this.fetch(`projects.json`).then(r => r.json()).then(posts => {
|
||||
return { posts };
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export let posts;
|
||||
</script>
|
||||
|
||||
<style>
|
||||
ul {
|
||||
margin: 0 0 1em 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
</style>
|
||||
|
||||
<svelte:head>
|
||||
<title>Projects</title>
|
||||
</svelte:head>
|
||||
|
||||
<h1>Past Projects</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="projects/{post.slug}">{post.title}</a></li>
|
||||
{/each}
|
||||
</ul>
|
||||
Reference in New Issue
Block a user