From d9f6d2270ac013b7e956cbd8c9cadfb176bc02e0 Mon Sep 17 00:00:00 2001 From: Daniele Guido <1181642+danieleguido@users.noreply.github.com> Date: Fri, 13 Dec 2024 08:40:14 +0100 Subject: [PATCH] add levels to Notebook schema --- src/constants.ts | 8 ++++++++ src/content/config.ts | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index 56c92d2..bba5f5d 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -252,3 +252,11 @@ export const ModelLanguagesLabels: Record = { it: "Italian", "en-fr-de": "English, French, German", } + +export const NotebookLevels = [ + "beginner", + "expert-in-methods", + "skilled-in-methods", + "expert-in-domain", + "skilled-in-domain", +] diff --git a/src/content/config.ts b/src/content/config.ts index a421952..c358ff0 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -12,6 +12,7 @@ import { PlanImpressoUser, PlanNone, PlanEducational, + NotebookLevels, } from "../constants" const CorpusAccessUserPlansToPlan: Record = { @@ -164,8 +165,10 @@ const notebooks = defineCollection({ .optional(), showLinks: z.boolean().optional(), authors: z.array(reference("authors")).optional(), - // this gives circular reference + // note: this prevents circular reference + // BEFORE: seealso: z.array(z.lazy(() => reference("notebooks"))).optional(), seealso: z.array(z.string()).optional(), + level: z.enum(NotebookLevels as any).default("beginner"), // seealso: z.array(z.lazy(() => reference("notebooks"))).optional(), }), })