-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.ts
More file actions
83 lines (73 loc) · 1.9 KB
/
config.ts
File metadata and controls
83 lines (73 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Simple content collections config with no rehype plugins
import { defineCollection, z } from "astro:content";
// Schema definitions
const blogSchema = z.object({
title: z.string(),
seoTitle: z.string().optional(),
publishDate: z.date(),
description: z.string(),
draft: z.boolean().optional().default(false),
author: z.string().optional(),
companyName: z.string().optional(),
companyDescription: z.string().optional(),
companyWebsite: z.string().optional(),
companySegment: z.string().optional(),
image: z.string().optional(),
tags: z.array(z.string()).optional(),
});
const productFeatures = defineCollection({
type: "content",
schema: z.object({
title: z.string(),
order: z.number(),
}),
});
const faqSchema = defineCollection({
type: "content",
schema: z.object({
title: z.string(),
order: z.number(),
}),
});
const pricingSchema = z.object({
name: z.string(),
order: z.number(),
price: z.number(),
annualPrice: z.number().optional(),
priceLink: z.string(),
annualPriceLink: z.string().optional(),
discount: z.number().optional(),
disabled: z.boolean().optional().default(false),
linkTarget: z.string().optional(),
buttonText: z.string().optional(),
});
const roadmapSchema = z.object({
title: z.string(),
version: z.number(),
});
// Export types
export type Roadmap = z.infer<typeof roadmapSchema>;
export type Blog = z.infer<typeof blogSchema>;
export type PricingSchema = z.infer<typeof pricingSchema>;
// Collection definitions
const roadmap = defineCollection({
type: "content",
schema: roadmapSchema,
});
const pricing = defineCollection({
type: "content",
schema: pricingSchema,
});
const blog = defineCollection({
type: "content",
schema: blogSchema,
});
// Export collections
export const collections = {
"client-features": productFeatures,
"core-features": productFeatures,
faq: faqSchema,
pricing,
roadmap,
blog,
};