Refactor for i18n, CMS integration, and project slugs; enhance admin & analytics

Co-authored-by: dennis <dennis@konkol.net>
This commit is contained in:
Cursor Agent
2026-01-12 14:36:10 +00:00
parent 0349c686fa
commit 12245eec8e
55 changed files with 4573 additions and 753 deletions

View File

@@ -1,4 +1,5 @@
import { PrismaClient } from "@prisma/client";
import { slugify } from "../lib/slug";
const prisma = new PrismaClient();
@@ -947,10 +948,21 @@ Visit any non-existent page on the site to see the terminal in action. Or click
},
];
const usedSlugs = new Set<string>();
for (const project of projects) {
const baseSlug = slugify(project.title);
let slug = baseSlug;
let counter = 2;
while (usedSlugs.has(slug) || !slug) {
slug = `${baseSlug || "project"}-${counter++}`;
}
usedSlugs.add(slug);
await prisma.project.create({
data: {
...project,
slug,
defaultLocale: "en",
difficulty: project.difficulty as
| "BEGINNER"
| "INTERMEDIATE"