π GitHub Pages Memo System - README
β¨ Features
- Public & Private Memos: Control visibility of your memos
- Sync to GitHub Pages: Public memos visible to everyone
- Local Storage: Private memos stay on your device only
- File Attachments: Support images and files (max 10MB each)
- Categories & Priorities: Organize your memos
π How It Works
Public Memos (π)
- Stored in
_data/memos.yml - Synced to GitHub repository
- Visible to all website visitors
- Attachments saved in
assets/folder
Private Memos (π)
- Stored in browser IndexedDB only
- Never synced to server
- Only visible on your device
- Lost if you clear browser data
π GitHub Pages Limitations
| Resource | Limit | Our Approach |
|---|---|---|
| Repository Size | 1GB (recommended) | Monitor assets/ folder size |
| File Size | 100MB (hard limit) | Enforce 10MB max per file |
| Build Time | 10 minutes | Static files, fast builds |
| Bandwidth | 100GB/month | Reasonable for personal site |
π Usage
1. Add a Memo
- Fill in the form
- Choose visibility:
- Public π: Will be synced to server
- Private π: Stays local only
- Click βAdd Memoβ - saves to IndexedDB
2. Sync to Server (Public Memos Only)
Click the ββοΈ Syncβ button next to any public memo, then run the command:
# The sync command will be generated automatically
echo '{ memo data }' | ruby sync_memo.rb sync
git add _data/memos.yml assets/
git commit -m "Add memo: Your Title"
git push
3. Automatic Deployment
- GitHub Pages auto-builds after push (~1-2 minutes)
- Public memos appear on website
- Private memos remain local
π File Structure
junle-cc-website/
βββ _data/
β βββ memos.yml # Public memos data
βββ assets/
β βββ images/
β β βββ memos/ # Synced images
β βββ files/
β βββ memos/ # Synced files
βββ _layouts/
β βββ memo.html # Memo page template
βββ memos.md # Memo page
βββ sync_memo.rb # Sync script
πΎ Storage Guidelines
Recommended Limits
- Single file: < 10MB
- Total memo attachments: < 100MB
- Total repository: < 500MB (stay safe)
File Size Tips
- Compress images before upload
- Use PDF compression for documents
- Store large files elsewhere (Google Drive, etc.) and link them
- Regularly review and clean old attachments
π Privacy & Security
- Private memos: Never leave your browser
- Public memos: Anyone can see them on your website
- Attachments: Public attachments are publicly accessible
- Git history: All commits are public on GitHub
π οΈ Manual Sync Commands
Sync a single memo
cat memo.json | ruby sync_memo.rb sync
Delete a memo
ruby sync_memo.rb delete <memo_id>
Check repository size
du -sh .git
du -sh assets/
Clean up old attachments
# Remove unused files manually
rm assets/images/memos/old_*
rm assets/files/memos/old_*
π― Best Practices
- Use Private for sensitive info: Personal notes, passwords, etc.
- Use Public for sharing: Blog drafts, public todos, ideas
- Monitor repo size: Check occasionally with
du -sh - Compress files: Before uploading large attachments
- Regular cleanup: Delete old/unused memos and attachments
π Troubleshooting
Sync failed?
- Check file sizes (must be < 10MB)
- Ensure Ruby is installed
- Check JSON format
Memo not appearing?
- Public memos: Wait 1-2 min for GitHub Pages build
- Private memos: Check browser console for errors
- Clear cache and refresh
Repository too large?
# Find large files
find assets/ -type f -size +5M -ls
# Clean git history (nuclear option)
git filter-branch --tree-filter 'rm -rf assets/old_folder' HEAD
π Support
- File sizes too large? Consider external storage
- Need more space? Create separate GitHub repo for attachments
- Questions? Check Jekyll and GitHub Pages documentation
Happy memo-taking! πβ¨