Automated blog that fetches and posts LeetCode Daily Challenge problems every day at 00:00 UTC (midnight UTC).
- Automated Daily Posts: GitHub Actions fetches the daily LeetCode problem and creates a new blog post automatically
- AI-Generated Solutions: Solutions in 19 programming languages with Pure CSS tabs
- Gemini-only AI: Gemini 3 Pro with Flash fallback on 429s
- Manual Regeneration: Update existing posts with new AI solutions via workflow or command line
- Jekyll-powered: Clean, fast static site hosted on GitHub Pages
- Modern UI: Beautiful, responsive design with dark mode support and code copy buttons
- Navigation: Archive, difficulty, and topic-based browsing
- Smart Caching: Efficient date-to-problem mapping for fast regeneration
- Go to repository Settings → Pages
- Source: Deploy from a branch
- Branch: Select
masterand/rootfolder - Save
- Go to repository Settings → Actions → General
- Workflow permissions: Select "Read and write permissions"
- Save
To enable AI-generated solutions, add your API key:
| Provider | Model | Secret Name | Get API Key |
|---|---|---|---|
| Gemini ✨ | gemini-3-flash-preview | GEMINI_API_KEY |
Get Key |
-
Add API Key to GitHub Secrets
- Go to repository Settings → Secrets and variables → Actions
- Click "New repository secret"
- Add
GEMINI_API_KEY
-
Model Behavior
- gemini-3-flash-preview
Notes:
- Only API keys go in Secrets (sensitive data)
- Without an API key, posts will only have problem descriptions without solutions
You can manually trigger the workflow to test:
- Go to Actions tab
- Select "LeetCode Daily Challenge" workflow
- Click "Run workflow"
- Choose AI model (default: Gemini)
scavienger.github.io/
├── _config.yml # Jekyll configuration
├── Gemfile # Ruby dependencies
├── index.md # Home page
├── _layouts/
│ ├── home.html # Homepage layout
│ └── post.html # Post layout with TOC
├── _posts/ # Auto-generated blog posts (nested by date)
│ └── _daily/ # Daily challenges
│ └── YYYY/MM/DD/ # Year/Month/Day folders
│ ├── slug.md # Post file
│ └── *.txt # Code snippets for each language
├── .github/
│ └── workflows/
│ ├── leetcode-daily.yml # Daily automation workflow
│ ├── regenerate-solution.yml # Manual regeneration workflow
│ └── generate-post-by-date.yml # Generate by specific date
├── scripts/
│ ├── requirements.txt # Python dependencies
│ ├── generate_posts.py # Unified generator (fetch + solve + post)
│ ├── solve_with_ai.py # AI solution generator
│ └── generate_post.py # Jekyll post generator
├── data/ # Cache files
│ └── daily_challenges.json # Cached daily challenge mappings
└── assets/
└── js/
├── dark-mode.js # Dark mode toggle
├── code-tabs.js # Code tab interactions
└── code-copy.js # Code copy functionality
- Scheduled Trigger: GitHub Actions runs daily at 00:00 UTC (midnight UTC)
- Fetch Challenges: Queries LeetCode GraphQL API for daily challenges
- Cache Mapping: Stores date-to-problem mappings in
data/daily_challenges.json - Fetch Problem Details: Gets problem content, examples, hints, and code templates
- Save Snippets: Stores code templates for all 19 languages
- AI Solutions: Generates solutions in 19 languages with approach and complexity analysis
- Generate Post: Creates markdown file with Gemini solution and code tabs
- Auto Deploy: GitHub Pages automatically builds and deploys the updated site
Via GitHub Actions UI:
- Go to Actions → Regenerate AI Solution for Post
- Click Run workflow
- Enter the post date (YYYY-MM-DD format, e.g.,
2025-11-23) - Click Run workflow
Via Command Line:
# Set up environment
export GEMINI_API_KEY="your-key-here"
# Regenerate (Gemini only)
python scripts/generate_posts.py 2025-11-23This is useful for:
- Regenerating solutions with improved prompts
- Adding solutions to posts that were created without AI keys
- gemini-3-flash-preview
All 19 languages supported by LeetCode:
- C++
- Java
- Python
- Python3
- C
- C#
- JavaScript
- TypeScript
- PHP
- Swift
- Kotlin
- Dart
- Go
- Ruby
- Scala
- Rust
- Racket
- Erlang
- Elixir
- Ruby (>= 2.7)
- Bundler
- Python (>= 3.8)
# Install Ruby dependencies
bundle install
# Serve the site locally
bundle exec jekyll serve
# Visit http://localhost:4000# Install Python dependencies
pip install -r scripts/requirements.txt
# Generate post for today
export GEMINI_API_KEY="your-key"
python scripts/generate_posts.py 2025-11-23
# Generate for date range
python scripts/generate_posts.py 2025-11-01 2025-11-10Edit .github/workflows/leetcode-daily.yml:
schedule:
- cron: '0 0 * * *' # Change this cron expressionCurrent: 00:00 UTC (midnight UTC)
The site uses the Minima theme with heavy customizations:
- Override styles in
_sass/directory - Modify layouts in
_layouts/ - Update
_config.ymlfor site settings
- Check GitHub Actions logs for errors
- Ensure workflow has write permissions
- Verify
_posts/_daily/directory has new files
- Check Jekyll build logs in Actions
- Validate markdown frontmatter format
- Ensure all required gems are in Gemfile
- Verify API keys are added to GitHub Secrets
- Check API key name:
GEMINI_API_KEY - Check API rate limits (free tier has limits)
If you're having trouble with problem fetching:
# Delete cache to force refresh
rm data/daily_challenges.jsonGenerate posts for multiple dates:
# Generate all posts for November 2025
python scripts/generate_posts.py 2025-11-01 2025-11-30Note: This will make many API calls. Use delays between requests to avoid rate limiting.
The system caches daily challenge mappings in data/daily_challenges.json.
This cache allows fast regeneration without repeated API calls. The cache is automatically updated when generating posts for missing dates.
Issues and pull requests are welcome!
This project uses Git Flow branching strategy:
master: Production, deployed to GitHub Pagesdevelop: Main development branchdevelop-feature-{name}-{id}: Individual feature branches
See BRANCHING_STRATEGY.md for details.
MIT License - Feel free to use this for your own LeetCode blog!
- LeetCode for providing the daily challenge problems
- Google for Gemini API
- Gemini API for solution generation
- Jekyll and Minima theme
For detailed developer documentation, see CLAUDE.md.