10 分钟搭建本地 Jekyll 环境 - 使用 Vagrant + VirtualBox

2017-03-25 18:54:07 +08:00
 guoliang

如果你不是一个 Ruby developer, 而且你也不想花几个小时来配置本地 Jekyll 环境, 那你可以考虑使用Vagrant来自动化创建这个环境.

Vagrant是一个用来搭建开发环境的开源工具, 我们会用VagrantVirtualBox一起来搭建你的本地 Jekyll 环境. 你可以查看具体的: 'InfrastructureAsCode': https://github.com/guoliang-dev/jekyll-vagrant/blob/master/Vagrantfile

具体步骤:

  1. install VirtualBox v5.1.0
  2. install Vagrant v1.9.2
  3. open command line: cd c:/tmp
  4. git clone git@github.com:guoliang-dev/jekyll-vagrant.git
  5. cd jekyll-vagrant
  6. vagrant up, it may take few minutes to start the VM. it'll download a Ubuntu 14 to your PC during first time run.
  7. ssh vagrant@localhost -p 2222 with vagrant/vagrant and 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
  1. access your jekyll web app from host: http://127.0.0.1:8040
  2. config & customize your local Jekyll project: c:/tmp/vagrant/my-awesone-site
  3. push your local Jekyll project c:/tmp/vagrant/my-awesone-site to Github
  4. checkout your blog via https://your-github-id.github.io

这就是所有的步骤!

useful links


来源:setup-local-Jekyll-zh.html

1757 次点击
所在节点    Blogger
2 条回复
szhshp
2017-04-07 22:55:36 +08:00
路过看到了就过来评论下,还要装虚拟机多麻烦啊。
我有个全部绿色版的实现方案: http://t.im/1cm9m
十分钟足够了。
guoliang
2017-04-09 12:20:37 +08:00
@szhshp 的确简单 +1

不过我更偏好'InfrastructureAsCode', 干净利索 :)

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/350268

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX