Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (20 sloc) 515 Bytes
<script context="module">
export async function preload({ params, query }) {
// the `slug` parameter is available because
// this file is called [slug].html
const res = await this.fetch(`${params.slug}.json`);
const data = await res.json();
if (res.status === 200) {
return {
post: data,
};
} else {
this.error(res.status, data.message);
}
}
</script>
<script>
import Post from '../components/Post.svelte';
export let post;
</script>
<Post {post}/>
You can’t perform that action at this time.