strict typescript
This commit is contained in:
+20
-18
@@ -1,27 +1,29 @@
|
||||
import { z, defineCollection } from 'astro:content';
|
||||
|
||||
export enum Tag {
|
||||
'Apps' = 'Apps',
|
||||
'Digital Life' = 'Digital Life',
|
||||
'Gaming' = 'Gaming',
|
||||
'Learning' = 'Learning',
|
||||
'Life' = 'Life',
|
||||
'MacOS' = 'MacOS',
|
||||
'Music' = 'Music',
|
||||
'Making Stuff' = 'Making Stuff',
|
||||
'Mental Health' = 'Mental Health',
|
||||
'Movies & TV' = 'Movies & TV',
|
||||
'Programming' = 'Programming',
|
||||
'Tech' = 'Tech',
|
||||
'Tutorial' = 'Tutorial',
|
||||
'Web Dev' = 'Web Dev',
|
||||
// only for filtering
|
||||
all = 'all',
|
||||
}
|
||||
|
||||
const blogCollection = defineCollection({
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
pubDate: z.string().transform((str) => new Date(str)),
|
||||
tags: z.array(
|
||||
z.enum([
|
||||
'Apps',
|
||||
'Digital Life',
|
||||
'Gaming',
|
||||
'Learning',
|
||||
'Life',
|
||||
'MacOS',
|
||||
'Music',
|
||||
'Making Stuff',
|
||||
'Mental Health',
|
||||
'Movies & TV',
|
||||
'Programming',
|
||||
'Tech',
|
||||
'Tutorial',
|
||||
'Web Dev',
|
||||
])
|
||||
),
|
||||
tags: z.array(z.nativeEnum(Tag)),
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user