Overview
Jekyll is a static site generator that transforms your plain text into static websites and blogs. This reference covers all available commands.
Installation
Install Jekyll and Bundler:
gem install jekyll bundler
Verify installation:
jekyll --version
Quick Start
# Create a new site
jekyll new my-site
# Navigate to site
cd my-site
# Start development server
bundle exec jekyll serve
# Visit http://localhost:4000
Global Options
These options work with all commands:
| Option | Description |
|---|---|
-v, --version |
Print version number |
-h, --help |
Show help information |
--config FILE |
Use custom config file(s) |
--trace |
Show full backtrace on errors |
Environment Variables
| Variable | Description |
|---|---|
JEKYLL_ENV |
Set to production for production builds |
JEKYLL_LOG_LEVEL |
Logging level (debug, info, warn, error) |
Commands
new
jekyll new PATH [options]
Create a new Jekyll site with default scaffolding
Arguments
PATH
required
Examples
Create a new site
jekyll new my-awesome-site
Create a blank site
jekyll new my-site --blank
Force create in existing directory
jekyll new . --force
serve
jekyll serve [options]
Build the site and start a local development server
Examples
Start development server
jekyll serve
Serve with live reload
jekyll serve --livereload
Serve on custom port
jekyll serve --port 3000
Serve including drafts
jekyll serve --drafts --future
build
jekyll build [options]
Build the site and output to the _site directory
Examples
Build the site
jekyll build
Build to custom directory
jekyll build --destination ./public
Build with baseurl
jekyll build --baseurl /my-project
Production build
JEKYLL_ENV=production jekyll build
clean
jekyll clean
Remove all generated files and caches
Examples
Clean build artifacts
jekyll clean
doctor
jekyll doctor
Check your site for common issues and configuration problems
Examples
Run diagnostics
jekyll doctor