// Client-safe lesson types (lib/lessons.ts reads the filesystem) export type Level = "Beginner" | "Intermediate" | "Advanced"; export type LessonMeta = { area: string; field: string; slug: string; title: string; description: string; level: Level; minutes: number; // The day the lesson was last checked or revised (front matter `updated`) updated: string; order: number; }; export function lessonPath(l: Pick): string { return `/${l.area}/${l.field}/${l.slug}`; } // Saved lessons are stored in the database by this key (field slugs are unique across the site) export function lessonKey(l: Pick): string { return `${l.field}/${l.slug}`; } export function formatDate(iso: string): string { return new Date(`${iso}T12:00:00Z`).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", timeZone: "UTC" }); }