Development Setup
This document explains how to set up and run the portfolio site locally for development.
Prerequisites
- Ruby (version 3.0+)
- Bundler gem
- Git
Quick Start
Option 1: Using the Development Script (Recommended)
The easiest way to start development:
./dev-server.sh
This script will:
- Check if dependencies are installed
- Install gems if needed
- Start Jekyll with live reload and development settings
- Serve the site at
http://localhost:4000
Option 2: Using VS Code Tasks
If you’re using VS Code:
- Open the Command Palette (
Cmd+Shift+P) - Type “Tasks: Run Task”
- Select “Jekyll Serve (Development)”
Available tasks:
- Jekyll Serve (Development): Full development server with live reload
- Jekyll Serve (Basic): Basic server without extra features
- Jekyll Build: Build the site without serving
- Bundle Install: Install/update gem dependencies
Option 3: Manual Commands
# Install dependencies
bundle install
# Start development server
bundle exec jekyll serve --config _config.yml,_config_dev.yml --livereload --drafts --incremental
# Or basic server
bundle exec jekyll serve
# Build only (no server)
bundle exec jekyll build
Development Features
The development setup includes:
- Live Reload: Browser automatically refreshes when files change
- Draft Posts: Include posts marked as drafts
- Incremental Build: Faster builds by only processing changed files
- Development Config: Overrides production settings
- Verbose Output: More detailed build information
Configuration
Development vs Production
- Production (
_config.yml): Used for GitHub Pages deployment - Development (
_config_dev.yml): Extends production config with dev-specific settings
Development URLs
- Local site:
http://localhost:4000 - Live reload:
http://localhost:35729(automatic)
File Structure
├── _config.yml # Production configuration
├── _config_dev.yml # Development configuration overrides
├── dev-server.sh # Quick start script
├── .vscode/
│ └── tasks.json # VS Code development tasks
└── .github/workflows/
├── deploy.yml # Production deployment
└── dev-build.yml # Development build testing
Troubleshooting
Port Already in Use
If port 4000 is busy:
bundle exec jekyll serve --port 4001
Gem Installation Issues
Update RubyGems and Bundler:
gem update --system
gem install bundler
bundle update
Live Reload Not Working
- Check if the browser supports WebSockets
- Disable browser extensions that might block WebSockets
- Try running without live reload:
bundle exec jekyll serve --no-livereload
GitHub Actions Development Testing
You can test the build process in GitHub Actions:
- Go to Actions tab in your repository
- Run “Development Build Test” workflow
- Optionally specify how long to run the test server
- Download the built site artifact to inspect
Making Changes
- Content: Edit Markdown files in
_posts/,_projects/, or pages - Styles: Edit SCSS files in
_sass/orassets/css/ - Layout: Edit HTML files in
_layouts/and_includes/ - Configuration: Edit
_config.ymlfor production or_config_dev.ymlfor development
The development server will automatically rebuild and refresh the browser when you save changes.