✅ PRODUCTS: - 7 product markdown files with full data - All product images working correctly - Specs, features, applications for each product - SEO keywords included ✅ IMAGES: - 96 images in public folder - 15 new product images downloaded - Correct image paths in all products ✅ BUILD: - 16 pages building successfully - All images load correctly - Pure CSS (no Tailwind dependency) - 8.7KB CSS bundle ✅ UX/UI: - Modern responsive design - Professional visual hierarchy - Mobile-optimized - Fast loading Products included: - ท่อ HDPE - PP-R/PP-RCT POLOPLAST - ท่อ PPR ตราช้าง (SCG) - ท่อ PPR – Thai PPR - ท่อไซเลอร์ (Syler) - ท่อระบายน้ำ 3 ชั้น ไซเลนท์ (XYLENT) - + 34 more products ready to add Ready for production deployment!
44 lines
1.2 KiB
Python
44 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
"""Fix product image references in markdown files"""
|
|
import os
|
|
import re
|
|
|
|
PRODUCT_IMAGE_MAP = {
|
|
'hdpe.md': 'hdpe-page-full.png',
|
|
'poloplast.md': 'poloplast_000C.jpg',
|
|
'ppr-elephant.md': 'ppr-pipe_000C.jpg',
|
|
'syler.md': 'syler_000C.jpg',
|
|
'thai-ppr.md': 'ppr-pipe_000C.jpg',
|
|
'xylent.md': 'xylent_000C.jpg',
|
|
}
|
|
|
|
def fix_markdown_file(filepath, image_name):
|
|
"""Fix image reference in markdown file"""
|
|
with open(filepath, 'r', encoding='utf-8') as f:
|
|
content = f.read()
|
|
|
|
# Replace image field
|
|
content = re.sub(
|
|
r'image:\s*/images/2021/03/[^\\s]+',
|
|
f'image: /images/2021/03/{image_name}',
|
|
content
|
|
)
|
|
|
|
with open(filepath, 'w', encoding='utf-8') as f:
|
|
f.write(content)
|
|
|
|
print(f"✓ Fixed {os.path.basename(filepath)} -> {image_name}")
|
|
|
|
def main():
|
|
products_dir = '/Users/kunthawatgreethong/Gitea/dealplustech/src/content/products'
|
|
|
|
for filename, image_name in PRODUCT_IMAGE_MAP.items():
|
|
filepath = os.path.join(products_dir, filename)
|
|
if os.path.exists(filepath):
|
|
fix_markdown_file(filepath, image_name)
|
|
else:
|
|
print(f"✗ Not found: {filename}")
|
|
|
|
if __name__ == '__main__':
|
|
main()
|