如果你不是一个 Ruby developer, 而且你也不想花几个小时来配置本地 Jekyll 环境, 那你可以考虑使用Vagrant来自动化创建这个环境.
Vagrant是一个用来搭建开发环境的开源工具, 我们会用Vagrant 与 VirtualBox一起来搭建你的本地 Jekyll 环境. 你可以查看具体的: 'InfrastructureAsCode': https://github.com/guoliang-dev/jekyll-vagrant/blob/master/Vagrantfile
具体步骤:
- install VirtualBox v5.1.0
- install Vagrant v1.9.2
- open command line:
cd c:/tmp git clone [email protected]:guoliang-dev/jekyll-vagrant.gitcd jekyll-vagrantvagrant up, it may take few minutes to start the VM. it'll download a Ubuntu 14 to your PC during first time run.ssh vagrant@localhost -p 2222withvagrant/vagrantand execute:
cd /vagrant # /vagrant is the share folder pointing to folder jekyll-vagrant in the host.
jekyll new my-awesome-site
cd my-awesome-site
bundle exec jekyll serve --host 0.0.0.0
- access your jekyll web app from host: http://127.0.0.1:8040
- config & customize your local Jekyll project:
c:/tmp/vagrant/my-awesone-site - push your local Jekyll project
c:/tmp/vagrant/my-awesone-siteto Github - checkout your blog via https://your-github-id.github.io
这就是所有的步骤!
useful links