V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
guoliang
V2EX  ›  Blogger

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

  •  
  •   guoliang · 2017-03-25 18:54:07 +08:00 · 1737 次点击
    这是一个创建于 2561 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如果你不是一个 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 [email protected]: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

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

    不过我更偏好'InfrastructureAsCode', 干净利索 :)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2828 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 13:14 · PVG 21:14 · LAX 06:14 · JFK 09:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.