michalvankodev-site/src/routes/_layout.svelte

42 lines
725 B
Svelte
Raw Normal View History

<script context="module">
import { take } from 'ramda'
export function preload({ params, query }) {
return this.fetch(`blog.json`)
.then(r => r.json())
.then(posts => {
return { latestPosts: take(5, posts) }
})
}
</script>
2019-07-12 09:49:03 +02:00
<script>
2019-12-29 23:30:56 +01:00
import Nav from '../components/Nav.svelte'
import Footer from '../components/Footer.svelte'
export let segment
export let latestPosts
2019-07-12 09:49:03 +02:00
</script>
<style>
2019-09-10 21:23:50 +02:00
.app-content {
2019-12-29 23:30:56 +01:00
background: #f2f6f6;
2019-09-10 21:23:50 +02:00
}
2019-12-29 23:30:56 +01:00
main {
position: relative;
2020-02-28 17:08:51 +01:00
max-width: 30em;
2019-12-29 23:30:56 +01:00
padding: 2em;
margin: 0 auto;
box-sizing: border-box;
}
2019-07-12 09:49:03 +02:00
</style>
2019-09-10 21:23:50 +02:00
<div class="app-content">
2019-12-29 23:30:56 +01:00
<Nav {segment} />
2019-07-12 09:49:03 +02:00
2019-09-10 21:23:50 +02:00
<main>
2019-12-29 23:30:56 +01:00
<slot />
2019-09-10 21:23:50 +02:00
</main>
<Footer {latestPosts} />
2019-09-10 21:23:50 +02:00
</div>