more yak shaving

This commit is contained in:
2021-10-19 06:44:15 -07:00
parent af6b065de8
commit 481eac817e
5 changed files with 36 additions and 15 deletions

View File

@ -1,8 +1,8 @@
<script context="module">
export async function load({ fetch }) {
const resp = await fetch('/all.json');
const allPosts = (await resp.json());
const post = await import(`./_posts/${allPosts[0].slug}.svx`);
const resp = await fetch('/latest.json');
const metadata = (await resp.json());
const post = await import(`./_posts/${metadata.slug}.svx`);
return {
props: {
meta: post.metadata,
@ -13,8 +13,8 @@
</script>
<script>
import BlogPost from './[slug].svelte';
import Post from '$lib/Post.svelte';
export let meta, body;
</script>
<BlogPost {meta} {body}></BlogPost>
<Post {meta} {body}></Post>