快速入门
Jekyll 是一个静态网站生成器。用你喜欢的 标记语言书写内容并交给 Jekyll 处理,它将利用模板为你创建一个静态网站。你可以 调整你想要的网址样式、在网站上显示哪些数据等等。
环境需求
Jekyll requires the following:
- Ruby version 2.7.0 or higher
- RubyGems
- GCC and Make
See Requirements for guides and details.
操作指南
- Install all prerequisites.
- 安装 Jekyll 和 bundler gems。
gem install jekyll bundler - 在
./myblog目录下创建一个全新的 Jekyll 网站。jekyll new myblog - 进入新创建的目录。
cd myblog - 构建网站并启动一个本地服务器。
bundle exec jekyll serve - 在浏览器中打开 http://localhost:4000 网址
If you are using Ruby version 3.0.0 or higher, step 5 may fail. You may fix it by adding webrick to your dependencies: bundle add webrick
Pass the --livereload option to serve to automatically refresh the page with each change you make to the source files: bundle exec jekyll serve --livereload
If you encounter any errors during this process, check that you have installed all the prerequisites in Requirements. If you still have issues, see Troubleshooting.
Installation varies based on your operating system. See our guides for OS-specific instructions.