mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-15 12:24:47 +00:00
21 lines
351 B
HTML
21 lines
351 B
HTML
<script context="module">
|
|
export function preload({ params }) {
|
|
const { slug } = params;
|
|
|
|
return this.fetch(`blog/${slug}.json`).then(r => {
|
|
return r.json().then(data => {
|
|
if (r.status !== 200) {
|
|
this.error(r.status, data);
|
|
}
|
|
|
|
return data;
|
|
});
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<script>
|
|
export let post;
|
|
</script>
|
|
|
|
<h1>{post.title}</h1> |