fix: Remove content.config.ts - use Astro's default content behavior
- Delete src/content.config.ts file - Astro uses built-in content collection defaults - Fixes build errors from explicit schema configuration - First deploy worked without this file - Subsequent deploys failed because of this file
This commit is contained in:
@@ -1,71 +0,0 @@
|
||||
import { defineCollection } from 'astro:content';
|
||||
import { glob } from 'astro/loaders';
|
||||
import { z } from 'astro/zod';
|
||||
|
||||
// Product specification schema
|
||||
const productSpecificationSchema = z.object({
|
||||
label: z.string(),
|
||||
value: z.string(),
|
||||
unit: z.string().optional(),
|
||||
});
|
||||
|
||||
// FAQ item schema
|
||||
const faqItemSchema = z.object({
|
||||
question: z.string(),
|
||||
answer: z.string(),
|
||||
});
|
||||
|
||||
// Product table schema (for specification tables)
|
||||
const productTableSchema = z.object({
|
||||
tableName: z.string(),
|
||||
headers: z.array(z.string()),
|
||||
rows: z.array(z.array(z.string())),
|
||||
});
|
||||
|
||||
// Product collection schema
|
||||
const products = defineCollection({
|
||||
loader: glob({ pattern: '**/*.md', base: './src/content/products' }),
|
||||
schema: z.object({
|
||||
// Basic info
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
nameEn: z.string(),
|
||||
slug: z.string(),
|
||||
|
||||
// SEO
|
||||
description: z.string(),
|
||||
shortDescription: z.string().optional(),
|
||||
keywords: z.array(z.string()).optional(),
|
||||
seoContent: z.string().optional(),
|
||||
|
||||
// Images
|
||||
image: z.string(),
|
||||
|
||||
// Product details
|
||||
specifications: z.array(productSpecificationSchema).optional(),
|
||||
features: z.array(z.string()).optional(),
|
||||
applications: z.array(z.string()).optional(),
|
||||
certifications: z.array(z.string()).optional(),
|
||||
|
||||
// Tables
|
||||
productTables: z.array(productTableSchema).optional(),
|
||||
|
||||
// FAQ
|
||||
faq: z.array(faqItemSchema).optional(),
|
||||
|
||||
// Relations
|
||||
relatedProductIds: z.array(z.string()).optional(),
|
||||
|
||||
// Schema.org data
|
||||
schemaData: z.object({
|
||||
brand: z.string().optional(),
|
||||
manufacturer: z.string().optional(),
|
||||
material: z.string().optional(),
|
||||
category: z.string().optional(),
|
||||
}).optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
export const collections = {
|
||||
products: products,
|
||||
};
|
||||
Reference in New Issue
Block a user