cleanup markdown

This commit is contained in:
2026-06-18 01:32:05 +02:00
parent c1fe73dbd0
commit 73ba2b573d
11 changed files with 137 additions and 26 deletions

View File

@@ -305,6 +305,25 @@ export const blogRouter = router({
};
}),
metadataBySlug: publicProcedure.input(z.string()).query(async ({ input: slug }) => {
const post = await db.query.blogPost.findFirst({
where(fields, operators) {
return operators.eq(fields.slug, slug);
},
});
if (!post) throw new TRPCError({ code: "NOT_FOUND", message: `Post "${slug}" not found` });
return {
slug: post.slug,
title: post.title,
date: post.date,
description: post.description,
tags: post.tags ?? [],
fileUrl: post.fileUrl,
};
}),
syncFromUploadThing: publicProcedure.mutation(async () => {
await assertAdmin();