|
1 | | -import { defineCollection, z } from 'astro:content'; |
| 1 | +import {defineCollection, z} from 'astro:content'; |
2 | 2 |
|
3 | | -const news = defineCollection({ |
4 | | - type: 'content', |
5 | | - schema: z.object({ |
6 | | - title: z.string(), |
7 | | - date: z.string(), |
8 | | - summary: z.string(), |
9 | | - cover: z.object({ |
10 | | - source: z.string(), |
11 | | - }).optional(), |
12 | | - layout: z.string().optional(), |
13 | | - variant: z.string().optional(), |
14 | | - }), |
| 3 | +const about = defineCollection({ |
| 4 | + type: 'content', |
| 5 | + schema: z.object({ |
| 6 | + title: z.string().optional(), |
| 7 | + layout: z.string().optional(), |
| 8 | + variant: z.string().optional(), |
| 9 | + cover: z.object({ |
| 10 | + source: z.string(), |
| 11 | + }).optional(), |
| 12 | + }), |
15 | 13 | }); |
16 | 14 |
|
17 | | -const services = defineCollection({ |
18 | | - type: 'content', |
19 | | - schema: z.object({ |
20 | | - title: z.string(), |
21 | | - summary: z.string(), |
22 | | - logo: z.string().optional(), |
23 | | - tags: z.array(z.string()).optional(), |
24 | | - layout: z.string().optional(), |
25 | | - variant: z.string().optional(), |
26 | | - }), |
| 15 | +const accessibility = defineCollection({ |
| 16 | + type: 'content', |
| 17 | + schema: z.object({ |
| 18 | + title: z.string().optional(), |
| 19 | + layout: z.string().optional(), |
| 20 | + variant: z.string().optional(), |
| 21 | + }), |
27 | 22 | }); |
28 | 23 |
|
29 | | -const events = defineCollection({ |
30 | | - type: 'content', |
31 | | - schema: z.object({ |
32 | | - title: z.string(), |
33 | | - date: z.string(), |
34 | | - summary: z.string(), |
35 | | - cover: z.object({ |
36 | | - source: z.string(), |
37 | | - }).optional(), |
38 | | - layout: z.string().optional(), |
39 | | - variant: z.string().optional(), |
40 | | - }), |
| 24 | +const banner = defineCollection({ |
| 25 | + type: 'content', |
| 26 | + schema: z.object({ |
| 27 | + title: z.string().optional(), |
| 28 | + summary: z.string().optional(), |
| 29 | + }), |
41 | 30 | }); |
42 | 31 |
|
43 | | -const about = defineCollection({ |
44 | | - type: 'content', |
45 | | - schema: z.object({ |
46 | | - title: z.string().optional(), |
47 | | - summary: z.string().optional(), |
48 | | - logo: z.string().optional(), |
49 | | - layout: z.string().optional(), |
50 | | - variant: z.string().optional(), |
51 | | - }), |
| 32 | +const events = defineCollection({ |
| 33 | + type: 'content', |
| 34 | + schema: z.object({ |
| 35 | + layout: z.string().optional(), |
| 36 | + variant: z.string().optional(), |
| 37 | + title: z.string(), |
| 38 | + date: z.string(), |
| 39 | + cover: z.object({ |
| 40 | + source: z.string(), |
| 41 | + }).optional(), |
| 42 | + summary: z.string(), |
| 43 | + }), |
52 | 44 | }); |
53 | 45 |
|
54 | 46 | const fundingAndProjects = defineCollection({ |
55 | | - type: 'content', |
56 | | - schema: z.object({ |
57 | | - title: z.string(), |
58 | | - summary: z.string().optional(), |
59 | | - date: z.string().optional(), |
60 | | - cover: z.object({ |
61 | | - source: z.string(), |
62 | | - }).optional(), |
63 | | - layout: z.string().optional(), |
64 | | - variant: z.string().optional(), |
65 | | - }), |
| 47 | + type: 'content', |
| 48 | + schema: z.object({ |
| 49 | + layout: z.string().optional(), |
| 50 | + variant: z.string().optional(), |
| 51 | + title: z.string(), |
| 52 | + summary: z.string().optional(), |
| 53 | + status: z.string().optional(), |
| 54 | + category: z.string().optional(), |
| 55 | + funder: z.object({ |
| 56 | + name: z.string().or(z.null()), |
| 57 | + link: z.string().or(z.null()), |
| 58 | + }).optional(), |
| 59 | + project_number: z.object({ |
| 60 | + grant_agreement_id: z.string().or(z.number()).or(z.null()), |
| 61 | + link: z.string().or(z.null()), |
| 62 | + }).optional(), |
| 63 | + period: z.string().optional(), |
| 64 | + external_link: z.string().optional().or(z.null()), |
| 65 | + keywords: z.array(z.string()).optional(), |
| 66 | + draft: z.boolean().optional(), |
| 67 | + }), |
66 | 68 | }); |
67 | 69 |
|
68 | | -const accessibility = defineCollection({ |
69 | | - type: 'content', |
70 | | - schema: z.object({ |
71 | | - title: z.string().optional(), |
72 | | - layout: z.string().optional(), |
73 | | - variant: z.string().optional(), |
74 | | - }), |
| 70 | +const landing = defineCollection({ |
| 71 | + type: 'content', |
| 72 | + schema: z.object({ |
| 73 | + layout: z.string().optional(), |
| 74 | + variant: z.string().optional(), |
| 75 | + }), |
75 | 76 | }); |
76 | 77 |
|
77 | | -const banner = defineCollection({ |
78 | | - type: 'content', |
79 | | - schema: z.object({ |
80 | | - title: z.string().optional(), |
81 | | - layout: z.string().optional(), |
82 | | - variant: z.string().optional(), |
83 | | - }), |
| 78 | +const news = defineCollection({ |
| 79 | + type: 'content', |
| 80 | + schema: z.object({ |
| 81 | + layout: z.string().optional(), |
| 82 | + variant: z.string().optional(), |
| 83 | + title: z.string(), |
| 84 | + date: z.string(), |
| 85 | + cover: z.object({ |
| 86 | + source: z.string(), |
| 87 | + }).optional(), |
| 88 | + summary: z.string(), |
| 89 | + }), |
84 | 90 | }); |
85 | 91 |
|
86 | | -const landing = defineCollection({ |
87 | | - type: 'content', |
88 | | - schema: z.object({ |
89 | | - title: z.string().optional(), |
90 | | - layout: z.string().optional(), |
91 | | - variant: z.string().optional(), |
92 | | - }), |
| 92 | +const researchSupport = defineCollection({ |
| 93 | + type: 'content', |
| 94 | + schema: z.object({ |
| 95 | + title: z.string().optional(), |
| 96 | + layout: z.string().optional(), |
| 97 | + variant: z.string().optional(), |
| 98 | + }), |
93 | 99 | }); |
94 | 100 |
|
95 | | -const researchSupport = defineCollection({ |
96 | | - type: 'content', |
97 | | - schema: z.object({ |
98 | | - title: z.string().optional(), |
99 | | - summary: z.string().optional(), |
100 | | - layout: z.string().optional(), |
101 | | - variant: z.string().optional(), |
102 | | - }), |
| 101 | +const services = defineCollection({ |
| 102 | + type: 'content', |
| 103 | + schema: z.object({ |
| 104 | + layout: z.string().optional(), |
| 105 | + variant: z.string().optional(), |
| 106 | + title: z.string(), |
| 107 | + logo: z.string().optional(), |
| 108 | + summary: z.string(), |
| 109 | + tags: z.array(z.string()).optional(), |
| 110 | + }), |
103 | 111 | }); |
104 | 112 |
|
105 | 113 | const training = defineCollection({ |
106 | | - type: 'content', |
107 | | - schema: z.object({ |
108 | | - title: z.string().optional(), |
109 | | - summary: z.string().optional(), |
110 | | - date: z.string().optional(), |
111 | | - layout: z.string().optional(), |
112 | | - variant: z.string().optional(), |
113 | | - }), |
| 114 | + type: 'content', |
| 115 | + schema: z.object({ |
| 116 | + layout: z.string().optional(), |
| 117 | + variant: z.string().optional(), |
| 118 | + title: z.string().optional(), |
| 119 | + }), |
114 | 120 | }); |
115 | 121 |
|
116 | 122 | export const collections = { |
117 | | - news, |
118 | | - services, |
119 | | - events, |
120 | | - about, |
121 | | - 'funding-and-projects': fundingAndProjects, |
122 | | - accessibility, |
123 | | - banner, |
124 | | - landing, |
125 | | - 'research-support': researchSupport, |
126 | | - training, |
| 123 | + news, |
| 124 | + services, |
| 125 | + events, |
| 126 | + about, |
| 127 | + 'funding-and-projects': fundingAndProjects, |
| 128 | + accessibility, |
| 129 | + banner, |
| 130 | + landing, |
| 131 | + 'research-support': researchSupport, |
| 132 | + training, |
127 | 133 | }; |
0 commit comments