3.7 KiB
3.7 KiB
Content Scripts Migration Plan
Overview
After migrating from meta.toml + frontmatter to frontmatter-only approach, these scripts need updates:
✅ COMPLETED SCRIPTS
- ✅
build-localized-content-updated.nu- New frontmatter-only version - ✅
migrate-frontmatter.sh- One-time migration script (completed) - ✅
organize-frontmatter.sh- One-time organization script (completed) - ✅
verify-clean-structure.sh- Verification script (updated)
🔄 SCRIPTS TO UPDATE
1. validate-content.nu
Issues:
- Still expects meta.toml files
- Validation rules need frontmatter-only updates
Required Changes:
- Remove meta.toml validation
- Add frontmatter structure validation
- Update required field checks
2. content-manager.nu
Issues:
- May create/expect meta.toml files
- Content creation templates need updates
Required Changes:
- Update content templates to frontmatter-only
- Remove meta.toml creation logic
- Update content validation rules
3. generate-content.nu
Issues:
- Content generation may use old structure
- Template generation for meta.toml
Required Changes:
- Update content templates
- Generate frontmatter-only markdown
- Remove meta.toml generation
4. sync-translations.nu
Issues:
- Translation sync may expect meta.toml
- Field mapping needs updates
Required Changes:
- Update to work with frontmatter fields only
- Sync category/tag translations in frontmatter
- Remove meta.toml translation logic
5. validate-content-consistency.nu
Issues:
- Consistency checks between meta.toml and frontmatter
- Now redundant checks
Required Changes:
- Remove meta.toml consistency checks
- Add frontmatter internal consistency checks
- Validate required frontmatter fields
6. validate-id-consistency.nu
Issues:
- May check ID consistency across meta.toml and markdown
Required Changes:
- Focus only on frontmatter ID validation
- Remove meta.toml references
- Validate slug/ID consistency in frontmatter
🔧 HOT-RELOAD SYSTEM UPDATES
Build System Integration
Files to update:
crates/tools/src/build/build_tasks/content_processing.rscrates/server/src/content/watcher.rs- Hot-reload detection logic
Changes needed:
- Remove meta.toml file watching
- Update content change detection
- Ensure generated files go to correct location
Development Workflow
Commands to update:
just dev- Hot-reload with new structurejust content-build- Use updated scripts- Development file watching
📋 IMPLEMENTATION PRIORITY
Phase 1: Critical Scripts (Immediate)
- Replace
build-localized-content.nuwithbuild-localized-content-updated.nu - Update
validate-content.nufor frontmatter-only - Update
content-manager.nufor new content creation
Phase 2: Content Management (Next)
- Update
generate-content.nu - Update
sync-translations.nu - Update consistency validation scripts
Phase 3: Development Integration (Final)
- Update hot-reload system
- Update build system integration
- Update development commands
🎯 SUCCESS CRITERIA
- ✅ All scripts work with frontmatter-only content
- ✅ No references to meta.toml files
- ✅ Generated content only in public/static-content
- ✅ Hot-reload works with clean structure
- ✅ Content validation covers all frontmatter fields
- ✅ New content creation follows standard format
🚀 QUICK START
Replace the main build script immediately:
# Backup current script
mv scripts/content/build-localized-content.nu scripts/content/build-localized-content-old.nu
# Use updated version
mv scripts/content/build-localized-content-updated.nu scripts/content/build-localized-content.nu
# Make executable
chmod +x scripts/content/build-localized-content.nu