File tree Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change 47
47
48
48
### 搭建本地jekyll环境
49
49
50
- 1 . 首先下载并安装 [ rubyinstaller ] ( https://rubyinstaller.org/downloads/ ) ,安装好以后gem和ruby就都有了 ![ ] ( /resource/201502/1.png ) [ 2019.9.9更新:以前的railinstaller安装的ruby版本不支持最新的jekyll,因此直接装rubyinstaller即可,全量安装是可以的,不全量没测试 ]
50
+ > 参考官方文档: < https://jekyllrb.com/docs/installation/windows/ >
51
51
52
- 2 . 然后执行 ` gem install jekyll ` 安装jekyll,注意有时候要执行多次才能成功 ![ ] ( /resource/201502/2.png )
52
+ 注意:
53
53
54
- 3 . 执行 ` gem install bundler `
54
+ 1.rubyinstaller安装的时候需要选择默认配置,除了安装位置(默认是直接C盘建立一个根目录,改成program files好些)
55
55
56
- 4 . 执行 ` bundle init `
56
+ 2.第二步就是那个黑色弹窗,选择3,要等很久才能安装完,各种秘钥,成功会会说: https://jekyllrb.com/docs/installation/windows/
57
57
58
- 5 . 替换Gemfile内容为:
58
+ 3.第三步要打开新窗口执行gem install jekyll bundler,也是非常漫长,十多分钟
59
59
60
- source "https://rubygems.org "
61
60
62
- gem "webrick", "~ > 1.7"
63
- gem 'wdm'
64
- gem 'jekyll'
61
+ 最后进入git项目的根目录,运行` jekyll serve ` ,然后访问http://127.0.0.1:4000/便能看到效果了
65
62
66
- 6 . 执行` bundle install `
67
-
68
- 7 . 最后进入git项目的根目录,运行` jekyll serve ` ,然后访问http://127.0.0.1:4000/便能看到效果了
69
-
70
- 8 . 本地测试好以后,把代码提交到github,github会自动生成静态网站。注意jekyll生成的_site文件夹不需要提交,这个是本地的静态网站文件夹
63
+ 本地测试好以后,把代码提交到github,github会自动生成静态网站。注意jekyll生成的_site文件夹不需要提交,这个是本地的静态网站文件夹
71
64
72
65
> jekyll还有更多高级的用法,可以参考官方网站的[ 源代码] ( https://github.com/jekyll/jekyll/tree/master/site ) ,里面包含了翻页,页面变量,页面数据等用法
73
66
You can’t perform that action at this time.
0 commit comments