Vài bước đơn giản để tạo github page bằng Jekyll.
Tạo tài khoản github và fork repository mẫu (ex: beautiful-jekyll) với tên <ten-tai-khoan>.github.io
.
Run ở local
- Clone repository về máy.
- Cài đặt Ruby. Kiểm tra cài đặt ruby:
ruby --version
- Cài đặt
gem
có tên làbundler
:
gem install bundler
- Download 1 template dựng sẵn (ex: beautiful-jekyll)
- Chỉnh sửa config site (title, description, …) trong file
_config.yml
. - Run
jekyll serve
để chạy trang ở local,jekyll build
để build.
Chú ý:
1. Ở windows muốn run jekyll serve
thì vào file Gemfile
uncomment dòng
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
2. Nếu run jekyll serve
bị lỗi như sau thì run bundle exec jekyll serve
.
You have already activated public_suffix 3.1.1, but your Gemfile requires public_suffix 2.0.5. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)