Run in docker

docker run -it --rm -v ~/blog:/blog dockercraft/bundler



gem install jekyll bundler

Create new website

jekyll new my-awesome-site

For an exist webiste

bundle install
bundle install --path vendor/bundle

General Usage

Build website

jekyll build
bundle exec jekyll build


Start local server

bundle exec jekyll serve

Set listener

bundle exec jekyll serve --host

Set port

bundle exec jekyll serve --port 3000



Add this line to your application’s Gemfile:

gem 'jekyll-compose', group: [:jekyll_plugins]

And then execute:



bundle install


Create new page

bundle exec jekyll page "My New Page"
jekyll page "My New Page"

Create new post

bundle exec jekyll post "My New Post"
jekyll post "My New Post"

Create new draft

bundle exec jekyll draft "My new draft"

jekyll draft "My new draft"

Publish draft

bundle exec jekyll publish _drafts/
jekyll publish _drafts/

specify a specific date on which to publish it

jekyll publish _drafts/ --date 2014-01-24

Unpublish Post

bundle exec jekyll unpublish _posts/
jekyll unpublish _posts/

Build index

bundle exec jekyll algolia

Ignore files and folders


Theme develop

Create theme 1

jekyll new-theme sample-theme
cd sample-theme

Config theme

On sample-theme.gemspec file do |spec|          = "sample-theme"
  spec.version       = "0.1.0"
  spec.authors       = [""]         = [""]
spec.summary       = %q{TODO: Write a short summary, because Rubygems requires one.}
  spec.homepage      = "TODO: Put your gem's website or public repo URL here."
  spec.license       = "MIT"
spec.files         = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|LICENSE|README)}i) }
spec.add_runtime_dependency "jekyll", "~> 3.6"
spec.add_development_dependency "bundler", "~> 1.12"
  spec.add_development_dependency "rake", "~> 10.0"

Build theme

gem build sample-theme.gemspec

Setup jekyll site

On your jekyll site, update Gemfile

gem "sample-theme", :path => "/var/theme"

Install theme

bundle install
bundle install --path vendor/bundle

config theme

# _config.yml

theme: sample-theme

Build and run site

build exec jekyll build
build exec jekyll serve


Show excerpts on post list.

show_excerpts: ture

Add <!--more--> post.