feat: Fix product tables and responsive fonts
- Add product detail page ([slug].astro) with table rendering - Display productTables from site-config.ts on product pages - Add responsive font scaling for large screens (1280px+) - Base font scales from 16px to 24px on 4K displays - All text elements use responsive sizing (md/lg/xl breakpoints) - Tables styled with green headers and alternating rows - Add comprehensive documentation (FIXES_SUMMARY.md) Fixes: - Product specification tables now visible on product pages - Font too small on large screens - now responsive
This commit is contained in:
94
src/data/AGENTS.md
Normal file
94
src/data/AGENTS.md
Normal file
@@ -0,0 +1,94 @@
|
||||
# DATA LAYER - Product Catalog & Site Configuration
|
||||
|
||||
**Generated:** 2026-03-01
|
||||
|
||||
## OVERVIEW
|
||||
|
||||
Centralized data layer for product catalog (~150KB total). Contains all product information, specifications, pricing tables, and site configuration in TypeScript.
|
||||
|
||||
## FILES
|
||||
|
||||
| File | Size | Purpose |
|
||||
|------|------|---------|
|
||||
| `site-config.ts` | ~149KB | Products, navigation, portfolio, company info |
|
||||
| `product-tables.ts` | ~33KB | Specification tables for products |
|
||||
|
||||
## STRUCTURE
|
||||
|
||||
### site-config.ts
|
||||
|
||||
```typescript
|
||||
// Core exports
|
||||
export const siteConfig: SiteConfig // Company info, contact
|
||||
export const workHours: WorkHours[] // Business hours
|
||||
export const productCategories: ProductCategory[] // All products (~20+)
|
||||
export const mainNavigation: NavItem[] // Header nav
|
||||
export const portfolioProjects: PortfolioProject[] // Portfolio items
|
||||
```
|
||||
|
||||
### ProductCategory Interface
|
||||
|
||||
```typescript
|
||||
interface ProductCategory {
|
||||
id: string; // kebab-case ID (e.g., 'ppr-elephant')
|
||||
name: string; // Thai name
|
||||
nameEn: string; // English name
|
||||
slug: string; // URL slug (Thai)
|
||||
href: string; // Full path with trailing slash
|
||||
image: string; // Image path from /public
|
||||
description: string; // Full description (Thai)
|
||||
shortDescription?: string;
|
||||
keywords?: string[]; // SEO keywords
|
||||
seoContent?: string; // Long-form SEO content
|
||||
specifications?: ProductSpecification[];
|
||||
features?: string[];
|
||||
applications?: string[];
|
||||
certifications?: string[];
|
||||
faq?: FAQItem[];
|
||||
schemaData?: {...}; // Schema.org structured data
|
||||
relatedProductIds?: string[];
|
||||
productTables?: ProductTable[]; // From product-tables.ts
|
||||
}
|
||||
```
|
||||
|
||||
## PRODUCT CATEGORIES
|
||||
|
||||
| ID | Thai Name | Type |
|
||||
|----|-----------|------|
|
||||
| `ppr-elephant` | ท่อพีพีอาร์ตราช้าง | PPR Pipe |
|
||||
| `thai-ppr` | ท่อ PPR Thai PPR | PPR Pipe |
|
||||
| `poloplast` | ท่อ PP-R/PP-RCT POLOPLAST | Premium PPR |
|
||||
| `ppr-welder` | เครื่องเชื่อมท่อพีพีอาร์ | Equipment |
|
||||
| `hdpe` | ท่อ HDPE | HDPE Pipe |
|
||||
| `hdpe-welder` | เครื่องเชื่อม HDPE | Equipment |
|
||||
| `upvc` | ท่อ uPVC | uPVC Pipe |
|
||||
| `pvc` | ท่อและข้อต่อ PVC | PVC Pipe |
|
||||
| `syler` | ท่อไซเลอร์ | Fire protection |
|
||||
| `xylent` | ท่อระบายน้ำ 3 ชั้น ไซเลนท์ | Drainage |
|
||||
| ... | ... | ... |
|
||||
|
||||
## CONVENTIONS
|
||||
|
||||
**Adding a new product**:
|
||||
1. Add to `productCategories[]` array
|
||||
2. Create unique `id` (kebab-case)
|
||||
3. Add Thai `slug` for URL
|
||||
4. Include `seoContent` for SEO pages
|
||||
5. Link `productTables` if spec tables exist
|
||||
6. Add `relatedProductIds` for cross-selling
|
||||
|
||||
**Product images**: Store in `/public/images/YYYY/MM/`
|
||||
|
||||
**URLs**: Thai with trailing slash: `/ท่อพีพีอาร์ตราช้าง/`
|
||||
|
||||
## ANTI-PATTERNS
|
||||
|
||||
- **DO NOT** import entire file in client components - it's 149KB
|
||||
- **DO NOT** hardcode product IDs - use constants
|
||||
- **DO NOT** edit `product-tables.ts` manually without checking all references
|
||||
|
||||
## NOTES
|
||||
|
||||
- File is large but tree-shakeable for unused products
|
||||
- `portfolioProjects` also defined here
|
||||
- SEO keywords array should include both Thai and English terms
|
||||
Reference in New Issue
Block a user