Compare commits
1 Commits
feat/guide
...
fix/remove
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
831b1a6f5d |
@@ -3,6 +3,6 @@
|
||||
"enabled": false
|
||||
},
|
||||
"_variables": {
|
||||
"lastUpdateCheck": 1753810743067
|
||||
"lastUpdateCheck": 1750679157111
|
||||
}
|
||||
}
|
||||
1
.astro/types.d.ts
vendored
@@ -1,2 +1 @@
|
||||
/// <reference types="astro/client" />
|
||||
/// <reference path="content.d.ts" />
|
||||
89
migrate_content.py
Normal file
@@ -0,0 +1,89 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
def migrate_content():
|
||||
"""
|
||||
Migrate content from content folder to content-migrated folder using mapping file
|
||||
"""
|
||||
|
||||
# Read mapping file
|
||||
mapping_file = 'migration-mapping.json'
|
||||
content_dir = 'content'
|
||||
migrated_dir = 'content-migrated'
|
||||
|
||||
try:
|
||||
with open(mapping_file, 'r') as f:
|
||||
mapping = json.load(f)
|
||||
except FileNotFoundError:
|
||||
print(f"Error: {mapping_file} not found")
|
||||
return False
|
||||
except json.JSONDecodeError:
|
||||
print(f"Error: Invalid JSON in {mapping_file}")
|
||||
return False
|
||||
|
||||
migrated_count = 0
|
||||
skipped_count = 0
|
||||
error_count = 0
|
||||
|
||||
print(f"Starting migration of {len(mapping)} files...")
|
||||
|
||||
for source_path, target_id in mapping.items():
|
||||
# Determine source file path
|
||||
if ':' in source_path:
|
||||
# Nested path like "clean-code-principles:be-consistent"
|
||||
parts = source_path.split(':')
|
||||
source_file = os.path.join(content_dir, *parts[:-1], f"{parts[-1]}.md")
|
||||
else:
|
||||
# Top level path like "clean-code-principles"
|
||||
source_file = os.path.join(content_dir, source_path, 'index.md')
|
||||
|
||||
# Determine target file path
|
||||
target_filename = f"{source_path.split(':')[-1]}@{target_id}.md"
|
||||
target_file = os.path.join(migrated_dir, target_filename)
|
||||
|
||||
# Check if target file is empty (needs migration)
|
||||
if os.path.exists(target_file) and os.path.getsize(target_file) > 0:
|
||||
print(f"⏭️ Skipped: {target_filename} (already migrated)")
|
||||
skipped_count += 1
|
||||
continue
|
||||
|
||||
# Check if source file exists
|
||||
if not os.path.exists(source_file):
|
||||
print(f"❌ Error: Source file not found: {source_file}")
|
||||
error_count += 1
|
||||
continue
|
||||
|
||||
try:
|
||||
# Read source content
|
||||
with open(source_file, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
if not content.strip():
|
||||
print(f"⚠️ Warning: Source file is empty: {source_file}")
|
||||
continue
|
||||
|
||||
# Write to target file
|
||||
with open(target_file, 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
|
||||
print(f"✅ Migrated: {source_path} -> {target_filename}")
|
||||
migrated_count += 1
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Error migrating {source_path}: {str(e)}")
|
||||
error_count += 1
|
||||
|
||||
print(f"\n📊 Migration Summary:")
|
||||
print(f" ✅ Migrated: {migrated_count}")
|
||||
print(f" ⏭️ Skipped: {skipped_count}")
|
||||
print(f" ❌ Errors: {error_count}")
|
||||
print(f" 📁 Total: {len(mapping)}")
|
||||
|
||||
return error_count == 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
success = migrate_content()
|
||||
sys.exit(0 if success else 1)
|
||||
@@ -16,7 +16,6 @@
|
||||
"roadmap-links": "node scripts/roadmap-links.cjs",
|
||||
"roadmap-dirs": "node scripts/roadmap-dirs.cjs",
|
||||
"roadmap-assets": "tsx scripts/editor-roadmap-assets.ts",
|
||||
"refresh-assets": "tsx scripts/refresh-assets.ts",
|
||||
"editor-roadmap-dirs": "tsx scripts/editor-roadmap-dirs.ts",
|
||||
"editor-roadmap-content": "tsx scripts/editor-roadmap-content.ts",
|
||||
"roadmap-content": "node scripts/roadmap-content.cjs",
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 821 KiB After Width: | Height: | Size: 821 KiB |
|
Before Width: | Height: | Size: 386 KiB After Width: | Height: | Size: 386 KiB |
|
Before Width: | Height: | Size: 256 KiB After Width: | Height: | Size: 256 KiB |
|
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 145 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 1013 KiB After Width: | Height: | Size: 1013 KiB |
|
Before Width: | Height: | Size: 370 KiB After Width: | Height: | Size: 370 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 203 B |
|
Before Width: | Height: | Size: 1021 B After Width: | Height: | Size: 1021 B |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 405 KiB After Width: | Height: | Size: 405 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 149 KiB After Width: | Height: | Size: 149 KiB |
|
Before Width: | Height: | Size: 936 KiB After Width: | Height: | Size: 936 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 398 KiB After Width: | Height: | Size: 398 KiB |
|
Before Width: | Height: | Size: 286 KiB After Width: | Height: | Size: 286 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 123 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 119 KiB |
|
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
|
Before Width: | Height: | Size: 312 KiB After Width: | Height: | Size: 312 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 123 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |