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 3066398 commit 1c70af8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 6 deletions.
1 change: 1 addition & 0 deletions src/routes/+layout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const prerender = true;
2 changes: 0 additions & 2 deletions src/routes/api/posts/[amount]/+server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { json } from '@sveltejs/kit';

export const prerender = true;

const fetchPosts = async () => {
const allPostFiles = import.meta.glob('$lib/blog/*.md');

Expand Down
2 changes: 0 additions & 2 deletions src/routes/blog/+page.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export const prerender = true;

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

Please sign in to comment.