diff --git a/CONVERSION_SUMMARY.md b/CONVERSION_SUMMARY.md new file mode 100644 index 0000000..30fa73b --- /dev/null +++ b/CONVERSION_SUMMARY.md @@ -0,0 +1,102 @@ +# System Design 101 to Blog Posts Conversion Summary + +## Overview + +Successfully extracted and converted **400 system design guides** from this repository into individual Jekyll blog posts for publishing on atakuzi.github.io. + +## What Was Done + +### 1. Repository Analysis +- Explored the system-design-101 repository structure +- Found 400 markdown guides in `/data/guides/` directory +- Analyzed the existing atakuzi.github.io Jekyll site structure + +### 2. Conversion Script +Created `/home/user/convert_guides.py` which: +- Extracts frontmatter from each guide +- Converts to Jekyll-compatible format with proper frontmatter: + - `layout: post` + - `title` from original guide + - `subtitle` from description + - `date` from createdAt field + - `tags` from original tags +- Preserves all markdown content and images +- Names files with proper Jekyll convention: `YYYY-MM-DD-title.md` + +### 3. Conversion Results +- **Total guides converted**: 400 +- **Success rate**: 100% (400/400) +- **Failed conversions**: 0 +- **Output location**: `/home/user/atakuzi.github.io/_posts/` + +### 4. Content Categories Included +The converted posts cover: +- API and Web Development (78 guides) +- Real World Case Studies (32 guides) +- AI and Machine Learning (8 guides) +- Database and Storage (48 guides) +- Technical Interviews (5 guides) +- Caching & Performance (29 guides) +- Payment and Fintech (16 guides) +- Software Architecture (18 guides) +- DevTools & Productivity (19 guides) +- Software Development (29 guides) +- Cloud & Distributed Systems (50 guides) +- How it Works? (14 guides) +- DevOps and CI/CD (28 guides) +- Security (33 guides) +- Computer Fundamentals (13 guides) + +## Current Status + +### ✅ Completed +1. Cloned atakuzi.github.io repository +2. Created conversion script +3. Converted all 400 guides successfully +4. Committed changes locally to atakuzi.github.io + +### ⚠️ Pending +The changes are committed locally but need to be pushed to the remote repository. This requires GitHub authentication. + +### Commit Details +- **Repository**: atakuzi.github.io +- **Branch**: main +- **Commit Hash**: 84bb248 +- **Commit Message**: "Add 400 system design guides from ByteByteGo" +- **Files Added**: 400 new blog posts +- **Insertions**: 13,127 lines + +## Next Steps + +To complete the publication, you need to push the changes from the atakuzi.github.io repository: + +```bash +cd /home/user/atakuzi.github.io +git push origin main +``` + +Note: This requires GitHub authentication (personal access token or SSH key). + +## Sample Posts Created + +Here are a few examples of the converted posts: +- `2024-02-22-top-5-caching-strategies.md` +- `2024-01-28-system-design-cheat-sheet.md` +- `2024-03-15-how-does-docker-work.md` +- `2024-03-13-rest-api-cheatsheet.md` +- `2024-02-12-100x-postgres-scaling-at-figma.md` + +## Files and Tools + +- **Conversion Script**: `/home/user/convert_guides.py` +- **Source Directory**: `/home/user/system-design-101/data/guides/` +- **Output Directory**: `/home/user/atakuzi.github.io/_posts/` +- **Blog Site**: atakuzi.github.io (Jekyll/GitHub Pages) + +## Notes + +- All posts include original images from ByteByteGo CDN +- Post dates preserved from original `createdAt` field +- All posts maintain original markdown formatting +- Tags and categories preserved for proper organization +- The blog will automatically build and deploy once pushed to GitHub (via GitHub Pages) diff --git a/scripts/convert_guides.py b/scripts/convert_guides.py new file mode 100644 index 0000000..3dfa568 --- /dev/null +++ b/scripts/convert_guides.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python3 +""" +Convert system-design-101 guides to Jekyll blog posts for atakuzi.github.io +""" + +import os +import re +from pathlib import Path +from datetime import datetime + +def extract_frontmatter(content): + """Extract YAML frontmatter from markdown content.""" + match = re.match(r'^---\n(.*?)\n---\n(.*)$', content, re.DOTALL) + if match: + frontmatter = match.group(1) + body = match.group(2) + return frontmatter, body + return None, content + +def parse_frontmatter(frontmatter_text): + """Parse YAML frontmatter into a dictionary.""" + data = {} + for line in frontmatter_text.split('\n'): + if ':' in line: + key, value = line.split(':', 1) + key = key.strip() + value = value.strip().strip('"\'') + if key == 'categories' or key == 'tags': + # Skip, will process next + continue + data[key] = value + elif line.strip().startswith('- '): + # This is a list item + item = line.strip()[2:].strip('"\'') + if 'tags' not in data: + data['tags'] = [] + data['tags'].append(item) + return data + +def create_jekyll_frontmatter(original_data): + """Create Jekyll-compatible frontmatter.""" + title = original_data.get('title', 'Untitled') + description = original_data.get('description', '') + created_at = original_data.get('createdAt', datetime.now().strftime('%Y-%m-%d')) + tags = original_data.get('tags', []) + + # Build the frontmatter + frontmatter = f"""--- +layout: post +title: "{title}" +subtitle: "{description}" +date: {created_at} +tags: {tags} +--- +""" + return frontmatter + +def convert_guide_to_post(guide_path, output_dir): + """Convert a single guide file to Jekyll post format.""" + # Read the guide content + with open(guide_path, 'r', encoding='utf-8') as f: + content = f.read() + + # Extract and parse frontmatter + frontmatter_text, body = extract_frontmatter(content) + if not frontmatter_text: + print(f"Warning: No frontmatter found in {guide_path}") + return None + + original_data = parse_frontmatter(frontmatter_text) + + # Create Jekyll frontmatter + jekyll_frontmatter = create_jekyll_frontmatter(original_data) + + # Combine frontmatter and body + jekyll_content = jekyll_frontmatter + '\n' + body + + # Generate output filename + created_at = original_data.get('createdAt', datetime.now().strftime('%Y-%m-%d')) + guide_name = Path(guide_path).stem + output_filename = f"{created_at}-{guide_name}.md" + output_path = output_dir / output_filename + + # Write the Jekyll post + with open(output_path, 'w', encoding='utf-8') as f: + f.write(jekyll_content) + + return output_path + +def main(): + """Main conversion function.""" + # Define paths + guides_dir = Path('/home/user/system-design-101/data/guides') + output_dir = Path('/home/user/atakuzi.github.io/_posts') + + # Get all guide files + guide_files = sorted(guides_dir.glob('*.md')) + + print(f"Found {len(guide_files)} guide files to convert") + + converted = 0 + failed = 0 + + for guide_file in guide_files: + try: + result = convert_guide_to_post(guide_file, output_dir) + if result: + converted += 1 + if converted % 50 == 0: + print(f"Converted {converted} files...") + else: + failed += 1 + except Exception as e: + print(f"Error converting {guide_file}: {e}") + failed += 1 + + print(f"\n✅ Conversion complete!") + print(f" Successfully converted: {converted}") + print(f" Failed: {failed}") + print(f" Output directory: {output_dir}") + +if __name__ == '__main__': + main()