mirror of
https://github.com/ArthurDanjou/artapi.git
synced 2026-01-14 20:59:26 +01:00
Amélioration de la configuration du contenu et ajout de nouvelles ressources : mise à jour des collections de profil et de mathématiques, correction des types de fichiers, et ajustement des titres des ressources.
This commit is contained in:
124
server/api/content.config.ts
Normal file
124
server/api/content.config.ts
Normal file
@@ -0,0 +1,124 @@
|
||||
import { defineCollection, defineContentConfig, z } from '@nuxt/content'
|
||||
|
||||
export default defineContentConfig({
|
||||
collections: {
|
||||
projects: defineCollection({
|
||||
type: 'page',
|
||||
source: 'projects/*.md',
|
||||
schema: z.object({
|
||||
slug: z.string(),
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
publishedAt: z.string(),
|
||||
readingTime: z.number().optional(),
|
||||
tags: z.array(z.string()),
|
||||
cover: z.string(),
|
||||
favorite: z.boolean().optional()
|
||||
})
|
||||
}),
|
||||
usesCategories: defineCollection({
|
||||
type: 'data',
|
||||
source: 'uses/categories/*.md',
|
||||
schema: z.object({
|
||||
slug: z.string(),
|
||||
name: z.string()
|
||||
})
|
||||
}),
|
||||
uses: defineCollection({
|
||||
type: 'data',
|
||||
source: 'uses/*.md',
|
||||
schema: z.object({
|
||||
name: z.string(),
|
||||
description: z.string(),
|
||||
category: z.string()
|
||||
})
|
||||
}),
|
||||
skills: defineCollection({
|
||||
type: 'page',
|
||||
source: 'skills.json',
|
||||
schema: z.object({
|
||||
description: z.string(),
|
||||
body: z.array(z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
items: z.array(z.object({
|
||||
name: z.string(),
|
||||
icon: z.string()
|
||||
}))
|
||||
}))
|
||||
})
|
||||
}),
|
||||
experiences: defineCollection({
|
||||
type: 'data',
|
||||
source: 'experiences/*.md',
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
company: z.string(),
|
||||
companyUrl: z.string().url().optional(),
|
||||
startDate: z.string(),
|
||||
endDate: z.string().optional(),
|
||||
location: z.string(),
|
||||
description: z.string(),
|
||||
tags: z.array(z.string())
|
||||
})
|
||||
}),
|
||||
education: defineCollection({
|
||||
type: 'data',
|
||||
source: 'education/*.md',
|
||||
schema: z.object({
|
||||
degree: z.string(),
|
||||
institution: z.string(),
|
||||
startDate: z.string(),
|
||||
endDate: z.string().optional(),
|
||||
location: z.string()
|
||||
})
|
||||
}),
|
||||
contact: defineCollection({
|
||||
type: 'page',
|
||||
source: 'contact.json',
|
||||
schema: z.object({
|
||||
body: z.array(z.object({
|
||||
name: z.string(),
|
||||
icon: z.string().optional(),
|
||||
value: z.string().url(),
|
||||
username: z.string().optional()
|
||||
}))
|
||||
})
|
||||
}),
|
||||
hobbies: defineCollection({
|
||||
type: 'page',
|
||||
source: 'hobbies.md'
|
||||
}),
|
||||
languages: defineCollection({
|
||||
type: 'page',
|
||||
source: 'languages.json',
|
||||
schema: z.object({
|
||||
body: z.array(z.object({
|
||||
name: z.string(),
|
||||
level: z.string(),
|
||||
proficiency: z.string()
|
||||
}))
|
||||
})
|
||||
}),
|
||||
certifications: defineCollection({
|
||||
type: 'page',
|
||||
source: 'certifications.json',
|
||||
schema: z.object({
|
||||
body: z.array(z.object({
|
||||
name: z.string(),
|
||||
issuer: z.string(),
|
||||
date: z.string(),
|
||||
url: z.string().url().optional()
|
||||
}))
|
||||
})
|
||||
}),
|
||||
mathematics: defineCollection({
|
||||
type: 'page',
|
||||
source: 'mathematics.md'
|
||||
}),
|
||||
profile: defineCollection({
|
||||
type: 'page',
|
||||
source: 'profile.md'
|
||||
})
|
||||
}
|
||||
})
|
||||
10
server/api/mathematics.get.ts
Normal file
10
server/api/mathematics.get.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { queryCollection } from '@nuxt/content/server'
|
||||
|
||||
export default defineCachedEventHandler(async (event) => {
|
||||
return await queryCollection(event, 'mathematics')
|
||||
.where('extension', '=', 'md')
|
||||
.first()
|
||||
}, {
|
||||
name: 'mathematics-list',
|
||||
maxAge: 3600 // 1 hour
|
||||
})
|
||||
@@ -2,7 +2,7 @@ import { queryCollection } from '@nuxt/content/server'
|
||||
|
||||
export default defineCachedEventHandler(async (event) => {
|
||||
return await queryCollection(event, 'profile')
|
||||
.where('extension', '=', 'json')
|
||||
.where('extension', '=', 'md')
|
||||
.first()
|
||||
}, {
|
||||
name: 'profile-info',
|
||||
|
||||
@@ -203,7 +203,7 @@ function createServer() {
|
||||
'artmcp-languages',
|
||||
'resource://artmcp/languages',
|
||||
{
|
||||
title: 'ArtMCP Languages',
|
||||
title: 'Arthur Danjou - Languages',
|
||||
description: 'Get Languages spoken by Arthur Danjou with proficiency levels'
|
||||
},
|
||||
async (uri) => {
|
||||
@@ -222,7 +222,7 @@ function createServer() {
|
||||
'artmcp-certifications',
|
||||
'resource://artmcp/certifications',
|
||||
{
|
||||
title: 'ArtMCP Certifications',
|
||||
title: 'Arthur Danjou - Certifications',
|
||||
description: 'Get Certifications and achievements of Arthur Danjou'
|
||||
},
|
||||
async (uri) => {
|
||||
@@ -237,11 +237,30 @@ function createServer() {
|
||||
}
|
||||
)
|
||||
|
||||
server.registerResource(
|
||||
'artmcp-mathematics',
|
||||
'resource://artmcp/mathematics',
|
||||
{
|
||||
title: 'Arthur Danjou - Mathematics',
|
||||
description: 'Get information about Arthur Danjou\'s background and knowledge in mathematics, including areas of expertise and academic achievements'
|
||||
},
|
||||
async (uri) => {
|
||||
const result = await $fetch('/api/mathematics')
|
||||
return {
|
||||
contents: [{
|
||||
uri: uri.href,
|
||||
mimeType: 'application/json',
|
||||
text: JSON.stringify(result, null, 2)
|
||||
}]
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
server.registerResource(
|
||||
'artmcp-profile',
|
||||
'resource://artmcp/profile',
|
||||
{
|
||||
title: 'ArtMCP Profile',
|
||||
title: 'Arthur Danjou - Profile',
|
||||
description: 'Get comprehensive profile information of Arthur Danjou including bio, location, availability, career goals, and work preferences'
|
||||
},
|
||||
async (uri) => {
|
||||
@@ -515,6 +534,25 @@ function createServer() {
|
||||
}
|
||||
)
|
||||
|
||||
server.registerPrompt(
|
||||
'artmcp-mathematics',
|
||||
{
|
||||
title: 'Get Mathematical Background Knowledge of Arthur Danjou',
|
||||
description: 'Get information about Arthur Danjou\'s background and knowledge in mathematics, including areas of expertise and academic achievements'
|
||||
},
|
||||
async () => {
|
||||
return {
|
||||
messages: [{
|
||||
role: 'user',
|
||||
content: {
|
||||
type: 'text',
|
||||
text: `Provide me information about Arthur Danjou's background and knowledge in mathematics, including areas of expertise and academic achievements.`
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
server.registerPrompt(
|
||||
'artmcp-profile',
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user