first commit
This commit is contained in:
28
src/content/schemas/experiences.ts
Normal file
28
src/content/schemas/experiences.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const ExperienceSchema = z.object({
|
||||
id: z.string(),
|
||||
company: z.string(),
|
||||
logo: z.string().optional(),
|
||||
role: z.string(),
|
||||
period: z.string(),
|
||||
duration: z.string(),
|
||||
description: z.string(),
|
||||
missions: z.array(z.string()).default([]),
|
||||
stack: z.array(z.string()).default([]),
|
||||
type: z.enum(['cdi', 'cdd', 'stage', 'alternance', 'freelance']).default('cdi'),
|
||||
current: z.boolean().default(false),
|
||||
});
|
||||
|
||||
export const ExperiencesSchema = z.object({
|
||||
items: z.array(ExperienceSchema),
|
||||
skills: z
|
||||
.object({
|
||||
technical: z.array(z.string()).default([]),
|
||||
soft: z.array(z.string()).default([]),
|
||||
})
|
||||
.default({ technical: [], soft: [] }),
|
||||
});
|
||||
|
||||
export type Experience = z.infer<typeof ExperienceSchema>;
|
||||
export type Experiences = z.infer<typeof ExperiencesSchema>;
|
||||
17
src/content/schemas/formations.ts
Normal file
17
src/content/schemas/formations.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const FormationSchema = z.object({
|
||||
id: z.string(),
|
||||
title: z.string(),
|
||||
school: z.string(),
|
||||
schoolUrl: z.string().url().optional(),
|
||||
period: z.string(),
|
||||
description: z.string().optional(),
|
||||
});
|
||||
|
||||
export const FormationsSchema = z.object({
|
||||
items: z.array(FormationSchema),
|
||||
});
|
||||
|
||||
export type Formation = z.infer<typeof FormationSchema>;
|
||||
export type Formations = z.infer<typeof FormationsSchema>;
|
||||
27
src/content/schemas/index.ts
Normal file
27
src/content/schemas/index.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
export * from './profile';
|
||||
export * from './skills';
|
||||
export * from './experiences';
|
||||
export * from './formations';
|
||||
export * from './projects';
|
||||
export * from './interests';
|
||||
export * from './site';
|
||||
|
||||
import { ProfileSchema } from './profile';
|
||||
import { SkillsSchema } from './skills';
|
||||
import { ExperiencesSchema } from './experiences';
|
||||
import { FormationsSchema } from './formations';
|
||||
import { ProjectsSchema } from './projects';
|
||||
import { InterestsSchema } from './interests';
|
||||
import { SiteSchema } from './site';
|
||||
|
||||
export const CONTENT_SCHEMAS = {
|
||||
profile: ProfileSchema,
|
||||
skills: SkillsSchema,
|
||||
experiences: ExperiencesSchema,
|
||||
formations: FormationsSchema,
|
||||
projects: ProjectsSchema,
|
||||
interests: InterestsSchema,
|
||||
site: SiteSchema,
|
||||
} as const;
|
||||
|
||||
export type ContentKey = keyof typeof CONTENT_SCHEMAS;
|
||||
15
src/content/schemas/interests.ts
Normal file
15
src/content/schemas/interests.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const InterestSchema = z.object({
|
||||
id: z.string(),
|
||||
label: z.string(),
|
||||
icon: z.string(),
|
||||
color: z.enum(['cyan', 'magenta', 'violet', 'ice']).default('cyan'),
|
||||
});
|
||||
|
||||
export const InterestsSchema = z.object({
|
||||
items: z.array(InterestSchema),
|
||||
});
|
||||
|
||||
export type Interest = z.infer<typeof InterestSchema>;
|
||||
export type Interests = z.infer<typeof InterestsSchema>;
|
||||
35
src/content/schemas/profile.ts
Normal file
35
src/content/schemas/profile.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const ProfileSchema = z.object({
|
||||
name: z.string(),
|
||||
title: z.string(),
|
||||
tagline: z.string(),
|
||||
bio: z.string(),
|
||||
available: z.boolean().default(false),
|
||||
availableLabel: z.string().optional(),
|
||||
hero: z.object({
|
||||
photo: z.string(),
|
||||
photos: z.array(z.string()).default([]),
|
||||
roles: z.array(z.string()).default([]),
|
||||
cta: z
|
||||
.array(
|
||||
z.object({
|
||||
label: z.string(),
|
||||
href: z.string(),
|
||||
variant: z.enum(['primary', 'ghost']).default('primary'),
|
||||
external: z.boolean().default(false),
|
||||
}),
|
||||
)
|
||||
.default([]),
|
||||
}),
|
||||
socials: z.object({
|
||||
email: z.string().email().optional(),
|
||||
github: z.string().url().optional(),
|
||||
gitea: z.string().url().optional(),
|
||||
linkedin: z.string().url().optional(),
|
||||
website: z.string().url().optional(),
|
||||
}),
|
||||
cv: z.string().optional(),
|
||||
});
|
||||
|
||||
export type Profile = z.infer<typeof ProfileSchema>;
|
||||
22
src/content/schemas/projects.ts
Normal file
22
src/content/schemas/projects.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const ProjectSchema = z.object({
|
||||
id: z.string(),
|
||||
title: z.string(),
|
||||
subtitle: z.string().optional(),
|
||||
description: z.string(),
|
||||
image: z.string().optional(),
|
||||
category: z.enum(['web', 'mobile', 'bot', 'infra', 'other']).default('web'),
|
||||
status: z.enum(['live', 'archived', 'private', 'wip']).default('live'),
|
||||
url: z.string().url().optional(),
|
||||
repoUrl: z.string().url().optional(),
|
||||
stack: z.array(z.string()).default([]),
|
||||
featured: z.boolean().default(false),
|
||||
});
|
||||
|
||||
export const ProjectsSchema = z.object({
|
||||
items: z.array(ProjectSchema),
|
||||
});
|
||||
|
||||
export type Project = z.infer<typeof ProjectSchema>;
|
||||
export type Projects = z.infer<typeof ProjectsSchema>;
|
||||
25
src/content/schemas/site.ts
Normal file
25
src/content/schemas/site.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const SiteSchema = z.object({
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
url: z.string().url(),
|
||||
keywords: z.array(z.string()).default([]),
|
||||
ogImage: z.string(),
|
||||
twitter: z.string().optional(),
|
||||
features: z
|
||||
.object({
|
||||
hero3D: z.boolean().default(true),
|
||||
smoothScroll: z.boolean().default(true),
|
||||
customCursor: z.boolean().default(true),
|
||||
partyMode: z.boolean().default(true),
|
||||
})
|
||||
.default({
|
||||
hero3D: true,
|
||||
smoothScroll: true,
|
||||
customCursor: true,
|
||||
partyMode: true,
|
||||
}),
|
||||
});
|
||||
|
||||
export type Site = z.infer<typeof SiteSchema>;
|
||||
22
src/content/schemas/skills.ts
Normal file
22
src/content/schemas/skills.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const SkillSchema = z.object({
|
||||
name: z.string(),
|
||||
icon: z.string(),
|
||||
level: z.enum(['primary', 'secondary']).default('primary'),
|
||||
});
|
||||
|
||||
export const SkillCategorySchema = z.object({
|
||||
id: z.string(),
|
||||
label: z.string(),
|
||||
items: z.array(SkillSchema),
|
||||
});
|
||||
|
||||
export const SkillsSchema = z.object({
|
||||
primary: z.array(SkillCategorySchema),
|
||||
secondary: z.array(SkillCategorySchema),
|
||||
});
|
||||
|
||||
export type Skill = z.infer<typeof SkillSchema>;
|
||||
export type SkillCategory = z.infer<typeof SkillCategorySchema>;
|
||||
export type Skills = z.infer<typeof SkillsSchema>;
|
||||
Reference in New Issue
Block a user