Skip to content

Commit

Permalink
fix: prerendering
Browse files Browse the repository at this point in the history
  • Loading branch information
jouwdan committed May 4, 2024
1 parent 7835ed9 commit 3066398
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script>
export const prerender = true;
import '../app.pcss';
import '@fontsource-variable/bricolage-grotesque';
import { ModeWatcher, toggleMode } from 'mode-watcher';
Expand Down
4 changes: 3 additions & 1 deletion src/routes/blog/+page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const prerender = true;

export const load = async ({ fetch }) => {
const posts = await(await fetch('/api/posts/all')).json();
const posts = await (await fetch('/api/posts/all')).json();
return { posts };
};
2 changes: 2 additions & 0 deletions src/routes/blog/[slug]/+page.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const prerender = true;

export async function load({ params }) {
const { metadata, default: content } = await import(`../../../lib/blog/${params.slug}.md`);
const { title, date, cover } = metadata;
Expand Down

0 comments on commit 3066398

Please sign in to comment.