GitHub Pages
Why GitHub Pages?
Section titled “Why GitHub Pages?”GitHub Pages adalah static hosting - tidak bisa baca directory listing.
Solusi: Generate files.json saat build!
3-Tier Fallback System
Section titled “3-Tier Fallback System”1. Try files.json (GitHub Pages) ✅ ↓ fail2. Try /api/files/ (Local server) ✅ ↓ fail3. Use hardcoded list (Fallback) ✅Deployment Steps
Section titled “Deployment Steps”1. Generate File Lists
Section titled “1. Generate File Lists”python3 build.py# Output: ✅ Generated content/files.json2. Commit & Push
Section titled “2. Commit & Push”git add .git commit -m "Deploy to GitHub Pages"git push origin main3. Enable GitHub Pages
Section titled “3. Enable GitHub Pages”GitHub Repo → Settings → PagesSource: Deploy from branchBranch: main / (root)Auto-Build with GitHub Actions
Section titled “Auto-Build with GitHub Actions”File .github/workflows/build.yml:
1. **Trigger:** Setiap push ke main branch2. **Run:** `python3 build.py`3. **Generate:** `files.json` untuk setiap folder4. **Commit:** Auto-commit file lists5. **Deploy:** GitHub Pages auto-deployfiles.json Format
Section titled “files.json Format”[ { "name": "INDEX.md", "size": 1100 }, { "name": "QUICKSTART.md", "size": 4500 }]Adding New Files
Section titled “Adding New Files”# 1. Add fileecho "# New" > docs/NEW.md
# 2. Push (GitHub Actions auto-generates files.json)git add docs/NEW.mdgit commit -m "Add new doc"git pushFeatures
Section titled “Features”- ✅ Free hosting
- ✅ Auto SSL (HTTPS)
- ✅ CDN (fast worldwide)
- ✅ Auto-build with GitHub Actions
- ✅ Custom domain support