Skip to content

Commit 14ffdc7

Browse files
committed
Add Setting Up Torrust with Claude Code blog post
1 parent 884fd68 commit 14ffdc7

File tree

6 files changed

+508
-44
lines changed

6 files changed

+508
-44
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { getMetadata } from '$lib/data/metadata';
2+
import type { PageServerLoad } from './$types';
3+
4+
export const load: PageServerLoad = async ({ url }) => {
5+
const slug = url.pathname.split('/').filter(Boolean).pop();
6+
if (!slug) throw new Error('Slug could not be determined.');
7+
8+
const metadata = await getMetadata();
9+
const currentPost = metadata.find((post) => post.slug === slug);
10+
11+
if (!currentPost) throw new Error(`Post not found: ${slug}`);
12+
13+
return { currentPost, allPosts: metadata };
14+
};

0 commit comments

Comments
 (0)