guoliang
V2EX  ›  Blogger

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

  •  
  •   guoliang · Mar 25, 2017 · 2402 views
    This topic created in 3334 days ago, the information mentioned may be changed or developed.

    如果你不是一个 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 replies    2017-04-09 12:20:37 +08:00
    szhshp
        1
    szhshp  
       Apr 7, 2017
    路过看到了就过来评论下,还要装虚拟机多麻烦啊。
    我有个全部绿色版的实现方案: http://t.im/1cm9m
    十分钟足够了。
    guoliang
        2
    guoliang  
    OP
       Apr 9, 2017
    @szhshp 的确简单 +1

    不过我更偏好'InfrastructureAsCode', 干净利索 :)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   950 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 58ms · UTC 21:18 · PVG 05:18 · LAX 14:18 · JFK 17:18
    ♥ Do have faith in what you're doing.