upadting lock, and blog post load function

This commit is contained in:
Luke Hagar
2025-05-27 17:27:36 -05:00
parent fbe9e5c1f7
commit 1cbb98123b
2 changed files with 600 additions and 1881 deletions

2476
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,10 @@
// src/routes/blog/[slug]/+page.server.ts // src/routes/blog/[slug]/+page.server.ts
import { getAllPosts } from '$lib/blog'; import { getAllPosts, getPostBySlug } from '$lib/blog';
import { error } from '@sveltejs/kit'; import { error } from '@sveltejs/kit';
export const load = async ({ params }) => { export const load = async ({ params }) => {
// Get only the metadata for the post // Get only the metadata for the post
const posts = await getAllPosts(); const post = await getPostBySlug(params.slug);
const post = posts.find(p => p.slug === params.slug);
if (!post) { if (!post) {
throw error(404, 'Blog post not found'); throw error(404, 'Blog post not found');