parent
a0d7900bbe
commit
85508ccbf3
|
@ -1,8 +1,8 @@
|
|||
- title: Getting Started
|
||||
docs:
|
||||
- link: /docs/
|
||||
- link: /docs/ruby-101/
|
||||
- link: /docs/installation/
|
||||
- link: /docs/ruby-101/
|
||||
- link: /docs/community/
|
||||
- link: /docs/step-by-step/01-setup/
|
||||
- title: Build
|
||||
|
|
|
@ -18,7 +18,7 @@ If you're looking for support for Jekyll, there are a lot of options:
|
|||
* If you have a question about using Jekyll, start a discussion on the [Jekyll Forum](https://talk.jekyllrb.com/) or [StackOverflow](https://stackoverflow.com/questions/tagged/jekyll)
|
||||
* Chat with Jekyllers — Join our [Gitter channel](https://gitter.im/jekyll/jekyll) or our [IRC channel on Freenode](irc:irc.freenode.net/jekyll)
|
||||
|
||||
There are a bunch of helpful community members on these services that should be willing to point you in the right direction.
|
||||
There are a bunch of helpful community members on these services who are willing to point you in the right direction.
|
||||
|
||||
**Reminder: Jekyll's issue tracker is not a support forum.**
|
||||
|
||||
|
|
|
@ -6,19 +6,24 @@ redirect_from:
|
|||
- /docs/quickstart/
|
||||
- /docs/extras/
|
||||
---
|
||||
Jekyll is a static site generator. You give it text written in your
|
||||
favorite markup language and it uses layouts to create a static website. You can
|
||||
tweak how you want the site URLs to look, what data gets displayed on the
|
||||
site, and more.
|
||||
Jekyll is a static site generator. It takes text written in your
|
||||
favorite markup language and uses layouts to create a static website. You can
|
||||
tweak the site's look and feel, URLs, the data displayed on the page, and more.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
See [requirements]({{ '/docs/installation/#requirements' | relative_url }}).
|
||||
Jekyll requires the following:
|
||||
|
||||
* Ruby version **{{ site.data.ruby.min_version }}** or higher
|
||||
* RubyGems
|
||||
* GCC and Make
|
||||
|
||||
See [Requirements]({{ '/docs/installation/#requirements' | relative_url }}) for guides and details.
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Install a full [Ruby development environment]({{ '/docs/installation/' | relative_url }}).
|
||||
2. Install Jekyll and [bundler]({{ '/docs/ruby-101/#bundler' | relative_url }}) [gems]({{ '/docs/ruby-101/#gems' | relative_url }}).
|
||||
1. Install all [prerequisites]({{ '/docs/installation/' | relative_url }}).
|
||||
2. Install the jekyll and bundler [gems]({{ '/docs/ruby-101/#gems' | relative_url }}).
|
||||
```
|
||||
gem install jekyll bundler
|
||||
```
|
||||
|
@ -36,13 +41,12 @@ bundle exec jekyll serve
|
|||
```
|
||||
6. Browse to [http://localhost:4000](http://localhost:4000){:target="_blank"}
|
||||
|
||||
{: .note}
|
||||
Pass the `--livereload` option to the serve command if you want your browser to auto-refresh on each change you make: `bundle exec jekyll serve --livereload`
|
||||
{: .note .info}
|
||||
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, see the
|
||||
[troubleshooting]({{ '/docs/troubleshooting/#configuration-problems' | relative_url }}) page. Also,
|
||||
make sure you've installed the development headers and other prerequisites as
|
||||
mentioned on the [requirements]({{ '/docs/installation/#requirements' | relative_url }}) page.
|
||||
If you encounter any errors during this process, check that you have installed all the prerequisites in [Requirements]({{ '/docs/installation/#requirements' | relative_url }}).
|
||||
If you still have issues, see [Troubleshooting]({{ '/docs/troubleshooting/#configuration-problems' | relative_url }}).
|
||||
|
||||
Note: Installation might be different depending on your operating system. See our [guides](https://jekyllrb.com/docs/installation/#guides) for OS specific instructions.
|
||||
{: .note .info}
|
||||
Installation varies based on your operating system. See our [guides]({{ '/docs/installation/#guides' | relative_url }}) for OS-specific instructions.
|
||||
|
|
|
@ -4,19 +4,19 @@ description: Official guide to install Jekyll on macOS, GNU/Linux or Windows.
|
|||
permalink: /docs/installation/
|
||||
---
|
||||
|
||||
Jekyll is a [Ruby Gem](/docs/ruby-101/#gems) that can be installed on most systems.
|
||||
Jekyll is a [Ruby Gem]({{ '/docs/ruby-101/#gems' | relative_url }}) that can be installed on most systems.
|
||||
|
||||
## Requirements
|
||||
|
||||
* [Ruby](https://www.ruby-lang.org/en/downloads/) version **{{ site.data.ruby.min_version }}** or above, including all development headers (ruby version can be checked by running `ruby -v`)
|
||||
* [RubyGems](https://rubygems.org/pages/download) (which you can check by running `gem -v`)
|
||||
* [GCC](https://gcc.gnu.org/install/) and [Make](https://www.gnu.org/software/make/) (in case your system doesn't have them installed, which you can check by running `gcc -v`,`g++ -v` and `make -v` in your system's command line interface)
|
||||
* [Ruby](https://www.ruby-lang.org/en/downloads/) version **{{ site.data.ruby.min_version }}** or higher, including all development headers (check your Ruby version using `ruby -v`)
|
||||
* [RubyGems](https://rubygems.org/pages/download) (check your Gems version using `gem -v`)
|
||||
* [GCC](https://gcc.gnu.org/install/) and [Make](https://www.gnu.org/software/make/) (check versions using `gcc -v`,`g++ -v`, and `make -v`)
|
||||
|
||||
## Guides
|
||||
|
||||
For detailed install instructions have a look at the guide for your operating system.
|
||||
For detailed install instructions, follow the guide for your operating system.
|
||||
|
||||
* [macOS]({{ '/docs/installation/macos/' | relative_url }})
|
||||
* [Ubuntu Linux]({{ '/docs/installation/ubuntu/' | relative_url }})
|
||||
* [Other Linux distros]({{ '/docs/installation/other-linux/' | relative_url }})
|
||||
* [Ubuntu]({{ '/docs/installation/ubuntu/' | relative_url }})
|
||||
* [Other Linux]({{ '/docs/installation/other-linux/' | relative_url }})
|
||||
* [Windows]({{ '/docs/installation/windows/' | relative_url }})
|
|
@ -4,7 +4,7 @@ permalink: /docs/installation/macos/
|
|||
---
|
||||
|
||||
## Install Command Line Tools
|
||||
First, you need to install the command-line tools to be able to compile native extensions, open a terminal and run:
|
||||
To install the command line tools to compile native extensions, open a terminal and run:
|
||||
|
||||
```sh
|
||||
xcode-select --install
|
||||
|
@ -12,9 +12,10 @@ xcode-select --install
|
|||
|
||||
## Install Ruby
|
||||
|
||||
Jekyll requires **Ruby > {{ site.data.ruby.min_version }}**.
|
||||
macOS Catalina 10.15 comes with ruby 2.6.3, so you're fine.
|
||||
If you're running a previous macOS system, you'll have to install a newer version of Ruby.
|
||||
Jekyll requires **Ruby v{{ site.data.ruby.min_version }}** or higher.
|
||||
macOS Catalina 10.15 ships with Ruby 2.6.3. Check your Ruby version using `ruby -v`.
|
||||
|
||||
If you're running a previous version of macOS, you'll have to install a newer version of Ruby.
|
||||
|
||||
### With Homebrew {#brew}
|
||||
To run the latest Ruby version you need to install it through [Homebrew](https://brew.sh).
|
||||
|
@ -26,13 +27,13 @@ To run the latest Ruby version you need to install it through [Homebrew](https:/
|
|||
brew install ruby
|
||||
```
|
||||
|
||||
Add the brew ruby path to your shell config:
|
||||
Add the brew ruby path to your shell configuration:
|
||||
|
||||
```bash
|
||||
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
|
||||
```
|
||||
|
||||
Then relaunch your terminal and check your updated Ruby setup:
|
||||
Relaunch your terminal and check your Ruby setup:
|
||||
|
||||
```sh
|
||||
which ruby
|
||||
|
@ -42,7 +43,7 @@ ruby -v
|
|||
{{ site.data.ruby.current_version_output }}
|
||||
```
|
||||
|
||||
Yay, we are now running current stable Ruby!
|
||||
You're now running the current stable version of Ruby!
|
||||
|
||||
### With rbenv {#rbenv}
|
||||
|
||||
|
@ -63,8 +64,8 @@ rbenv init
|
|||
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
|
||||
```
|
||||
|
||||
Restart your terminal for changes to take effect.
|
||||
Now you can install the Ruby version of our choice, let's go with current latest stable Ruby:
|
||||
Restart your terminal to apply your changes.
|
||||
Next, you can install the Ruby version you want. Let's install the latest stable version:
|
||||
|
||||
```sh
|
||||
rbenv install {{ site.data.ruby.current_version }}
|
||||
|
@ -73,50 +74,50 @@ ruby -v
|
|||
{{ site.data.ruby.current_version_output }}
|
||||
```
|
||||
|
||||
That's it! Head over [rbenv command references](https://github.com/rbenv/rbenv#command-reference) to learn how to use different versions of Ruby in your projects.
|
||||
That's it! Head over to [rbenv command references](https://github.com/rbenv/rbenv#command-reference) to learn how to use different versions of Ruby in your projects.
|
||||
|
||||
## Install Jekyll
|
||||
|
||||
Now all that is left is installing [Bundler]({{ '/docs/ruby-101/#bundler' | relative_url }}) and Jekyll.
|
||||
After installing Ruby, install Jekyll and Bundler.
|
||||
|
||||
### Local Install
|
||||
|
||||
Install the bundler and jekyll gems:
|
||||
|
||||
```sh
|
||||
gem install --user-install bundler jekyll
|
||||
```
|
||||
|
||||
and then get your Ruby version using
|
||||
Get your Ruby version:
|
||||
|
||||
```sh
|
||||
ruby -v
|
||||
{{ site.data.ruby.current_version_output }}
|
||||
```
|
||||
|
||||
Then append your path file with the following, replacing the `X.X` with the first two digits of your Ruby version.
|
||||
Append your path file with the following, replacing the `X.X` with the first two digits of your Ruby version:
|
||||
|
||||
```bash
|
||||
echo 'export PATH="$HOME/.gem/ruby/X.X.0/bin:$PATH"' >> ~/.bash_profile
|
||||
```
|
||||
|
||||
To check that your gem paths point to your home directory run:
|
||||
Check that `GEM PATHS:` points to your home directory:
|
||||
|
||||
```sh
|
||||
gem env
|
||||
```
|
||||
|
||||
And check that `GEM PATHS:` points to a path in your home directory.
|
||||
|
||||
{: .note .info}
|
||||
Every time you update Ruby to a version with a different first two digits, you will need to update your path to match.
|
||||
Every time you update Ruby to a version in which the first two digits change, update your path to match.
|
||||
|
||||
### Global Install
|
||||
|
||||
{: .note .warning}
|
||||
We strongly recommend against installing Ruby gems globally to avoid file permissions problems and using `sudo`.
|
||||
We recommend not installing Ruby gems globally to avoid file permissions problems and using `sudo`.
|
||||
|
||||
#### On Mojave (10.14)
|
||||
|
||||
Because of SIP Protections in Mojave, you must run:
|
||||
Because of SIP Protections in Mojave, run:
|
||||
|
||||
```sh
|
||||
sudo gem install bundler
|
||||
|
@ -125,12 +126,12 @@ sudo gem install -n /usr/local/bin/ jekyll
|
|||
|
||||
#### Before Mojave (<10.14)
|
||||
|
||||
You only have to run:
|
||||
Run:
|
||||
|
||||
```sh
|
||||
sudo gem install bundler jekyll
|
||||
```
|
||||
|
||||
## Problems?
|
||||
## Troubleshooting
|
||||
|
||||
Check out the [troubleshooting]({{ '/docs/troubleshooting/' | relative_url }}) page or [ask for help on our forum](https://talk.jekyllrb.com).
|
||||
See [Troubleshooting]({{ '/docs/troubleshooting/' | relative_url }}) or [ask for help on our forum](https://talk.jekyllrb.com).
|
|
@ -2,21 +2,30 @@
|
|||
title: Jekyll on Linux
|
||||
permalink: /docs/installation/other-linux/
|
||||
---
|
||||
Installation on other Linux distributions works similarly as on [Ubuntu](../ubuntu/).
|
||||
|
||||
On Fedora, the dependencies can be installed as follows:
|
||||
Installation on other Linux distributions works similarly to installing on [Ubuntu](../ubuntu/).
|
||||
|
||||
## Install prerequisites
|
||||
|
||||
### Fedora
|
||||
|
||||
```sh
|
||||
sudo dnf install ruby ruby-devel @development-tools
|
||||
```
|
||||
### RHEL8/CentOS8
|
||||
|
||||
On Debian:
|
||||
```sh
|
||||
sudo dnf install ruby ruby-devel
|
||||
sudo dnf group install "Development Tools"
|
||||
```
|
||||
|
||||
### Debian
|
||||
|
||||
```sh
|
||||
sudo apt-get install ruby-full build-essential
|
||||
```
|
||||
|
||||
On Gentoo Linux:
|
||||
### Gentoo
|
||||
|
||||
```sh
|
||||
sudo emerge -av jekyll
|
||||
|
@ -28,22 +37,23 @@ or
|
|||
sudo emerge --ask --verbose jekyll
|
||||
```
|
||||
|
||||
On ArchLinux:
|
||||
### ArchLinux
|
||||
|
||||
```sh
|
||||
sudo pacman -S ruby base-devel
|
||||
```
|
||||
|
||||
On openSUSE:
|
||||
### OpenSUSE
|
||||
|
||||
```sh
|
||||
sudo zypper install -t pattern devel_ruby devel_C_C++
|
||||
```
|
||||
|
||||
On Clear Linux:
|
||||
### Clear Linux
|
||||
|
||||
```sh
|
||||
sudo swupd bundle-add ruby-basic
|
||||
```
|
||||
## Install Jekyll
|
||||
|
||||
The rest works the same as on [Ubuntu](../ubuntu/).
|
||||
Follow the instructions for [Ubuntu](../ubuntu/).
|
||||
|
|
|
@ -2,17 +2,19 @@
|
|||
title: Jekyll on Ubuntu
|
||||
permalink: /docs/installation/ubuntu/
|
||||
---
|
||||
Before we install Jekyll, we need to make sure we have all the required
|
||||
dependencies.
|
||||
|
||||
## Install dependencies
|
||||
|
||||
Install Ruby and other [prerequisites]({{ '/docs/installation/#requirements' | relative_url }}):
|
||||
|
||||
```sh
|
||||
sudo apt-get install ruby-full build-essential zlib1g-dev
|
||||
```
|
||||
|
||||
It is best to avoid installing Ruby Gems as the root user. Therefore, we need to
|
||||
Avoid installing Ruby as the root user. Instead,
|
||||
set up a gem installation directory for your user account. The following
|
||||
commands will add environment variables to your `~/.bashrc` file to configure
|
||||
the gem installation path. Run them now:
|
||||
the gem installation path:
|
||||
|
||||
```sh
|
||||
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
|
||||
|
@ -21,7 +23,7 @@ echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
|
|||
source ~/.bashrc
|
||||
```
|
||||
|
||||
Finally, install Jekyll:
|
||||
Finally, install Jekyll and Bundler:
|
||||
|
||||
```sh
|
||||
gem install jekyll bundler
|
||||
|
|
|
@ -5,27 +5,27 @@ redirect_from:
|
|||
- /docs/windows/
|
||||
---
|
||||
|
||||
While Windows is not an officially-supported platform, it can be used to run Jekyll with the proper tweaks. This page aims to
|
||||
collect some of the general knowledge and lessons that have been unearthed by Windows users.
|
||||
While Windows is not an officially-supported platform, it can be used to run Jekyll with the proper tweaks.
|
||||
|
||||
## Installing Jekyll
|
||||
## Installing Ruby and Jekyll
|
||||
|
||||
### Installation via RubyInstaller
|
||||
|
||||
The easiest way to run Jekyll is by using the [RubyInstaller](https://rubyinstaller.org/) for Windows.
|
||||
The easiest way to install Ruby and Jekyll is by using the [RubyInstaller](https://rubyinstaller.org/) for Windows.
|
||||
|
||||
RubyInstaller is a self-contained Windows-based installer that includes the Ruby language, an execution environment,
|
||||
important documentation, and more.
|
||||
We only cover RubyInstaller-2.4 and newer here, older versions need to
|
||||
|
||||
We only cover RubyInstaller-2.4 and newer here. Older versions need to
|
||||
[install the Devkit](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit) manually.
|
||||
|
||||
1. Download and Install a **Ruby+Devkit** version from [RubyInstaller Downloads](https://rubyinstaller.org/downloads/).
|
||||
1. Download and install a **Ruby+Devkit** version from [RubyInstaller Downloads](https://rubyinstaller.org/downloads/).
|
||||
Use default options for installation.
|
||||
2. Run the `ridk install` step on the last stage of the installation wizard. This is needed for installing gems with native
|
||||
extensions. You can find additional information regarding this in the
|
||||
[RubyInstaller Documentation](https://github.com/oneclick/rubyinstaller2#using-the-installer-on-a-target-system)
|
||||
3. Open a new command prompt window from the start menu, so that changes to the `PATH` environment variable becomes effective.
|
||||
Install Jekyll and Bundler via: `gem install jekyll bundler`
|
||||
Install Jekyll and Bundler using `gem install jekyll bundler`
|
||||
4. Check if Jekyll installed properly: `jekyll -v`
|
||||
|
||||
That's it, you're ready to use Jekyll!
|
||||
|
@ -38,19 +38,15 @@ If you are using Windows 10 version 1607 or later, another option to run Jekyll
|
|||
{: .note .info}
|
||||
You must have [Windows Subsystem for Linux](https://msdn.microsoft.com/en-us/commandline/wsl/about) enabled.
|
||||
|
||||
First let's make sure all our packages / repositories are up to date. Open a new Command Prompt instance, and type the following:
|
||||
Make sure all your packages and repositories are up to date. Open a new Command Prompt or Powershell window and type `bash`.
|
||||
|
||||
```sh
|
||||
bash
|
||||
```
|
||||
|
||||
Your Command Prompt instance should now be a Bash instance. Now we must update our repo lists and packages.
|
||||
Your terminal should now be a Bash instance. Next, update your repository lists and packages:
|
||||
|
||||
```sh
|
||||
sudo apt-get update -y && sudo apt-get upgrade -y
|
||||
```
|
||||
|
||||
Now we can install Ruby. To do this we will use a repository from [BrightBox](https://www.brightbox.com/docs/ruby/ubuntu/),
|
||||
Next, install Ruby. To do this, let's use a repository from [BrightBox](https://www.brightbox.com/docs/ruby/ubuntu/),
|
||||
which hosts optimized versions of Ruby for Ubuntu.
|
||||
|
||||
```sh
|
||||
|
@ -59,27 +55,28 @@ sudo apt-get update
|
|||
sudo apt-get install ruby2.5 ruby2.5-dev build-essential dh-autoreconf
|
||||
```
|
||||
|
||||
Next let's update our Ruby gems:
|
||||
Next, update your Ruby gems:
|
||||
|
||||
```sh
|
||||
gem update
|
||||
```
|
||||
|
||||
Now all that is left to do is install Jekyll.
|
||||
Install Jekyll:
|
||||
|
||||
```sh
|
||||
gem install jekyll bundler
|
||||
```
|
||||
|
||||
(*Note: no `sudo` here.*)
|
||||
{: .note .info}
|
||||
No `sudo` here.
|
||||
|
||||
Check if Jekyll installed properly by running:
|
||||
Check your Jekyll version:
|
||||
|
||||
```sh
|
||||
jekyll -v
|
||||
```
|
||||
|
||||
**And that's it!**
|
||||
That's it! You're ready to start using Jekyll.
|
||||
|
||||
You can make sure time management is working properly by inspecting your `_posts` folder. You should see a markdown file
|
||||
with the current date in the filename.
|
||||
|
@ -96,29 +93,28 @@ Bash on Ubuntu on Windows is still under development, so you may run into issues
|
|||
|
||||
## Encoding
|
||||
|
||||
If you use UTF-8 encoding, make sure that no `BOM` header characters exist in your files or very, very bad things will happen to
|
||||
Jekyll. This is especially relevant when you're running Jekyll on Windows.
|
||||
If you use UTF-8 encoding, make sure that no `BOM` header characters exist in your files. If they don't, Jekyll will break. This is especially relevant when you're running Jekyll on Windows.
|
||||
|
||||
Additionally, you might need to change the code page of the console window to UTF-8 in case you get a
|
||||
`Liquid Exception: Incompatible character encoding` error during the site generation process. It can be done with the following
|
||||
command:
|
||||
`Liquid Exception: Incompatible character encoding` error during the site generation process. Run the following:
|
||||
|
||||
```sh
|
||||
chcp 65001
|
||||
```
|
||||
|
||||
## Time-Zone Management
|
||||
## Time Zone Management
|
||||
|
||||
Since Windows doesn't have a native source of zoneinfo data, the Ruby Interpreter would not understand IANA Timezones and hence
|
||||
using them had the `TZ` environment variable default to UTC/GMT 00:00.
|
||||
Since Windows doesn't have a native source of zoneinfo data, the Ruby Interpreter doesn't understand IANA Timezones.
|
||||
Using them had the `TZ` environment variable default to UTC/GMT 00:00.
|
||||
|
||||
Though Windows users could alternatively define their blog's timezone by setting the key to use POSIX format of defining
|
||||
Though Windows users could alternatively define their blog's timezone by setting the key to use the POSIX format of defining
|
||||
timezones, it wasn't as user-friendly when it came to having the clock altered to changing DST-rules.
|
||||
|
||||
Jekyll now uses a rubygem to internally configure Timezone based on established
|
||||
[IANA Timezone Database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
|
||||
|
||||
While 'new' blogs created with Jekyll v3.4 and greater, will have the following added to their `Gemfile` by default, existing
|
||||
sites *will* have to update their `Gemfile` (and installed) to enable development on Windows:
|
||||
sites *will* have to update their `Gemfile` (and installed gems) to enable development on Windows:
|
||||
|
||||
```ruby
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
|
|
|
@ -3,24 +3,27 @@ title: Ruby 101
|
|||
permalink: /docs/ruby-101/
|
||||
---
|
||||
|
||||
Jekyll is written in Ruby. If you're new to Ruby, this page is to help you get
|
||||
up to speed with some of the terminology.
|
||||
Jekyll is written in Ruby. If you're new to Ruby, this page helps you learn some of the terminology.
|
||||
|
||||
## Gems
|
||||
|
||||
A gem is code you can include in Ruby projects. It allows you to package up functionality and share it across other projects or with other people. Gems can perform functionality such as:
|
||||
Gems are code you can include in Ruby projects. Gems package specific functionality. You can share gems across multiple projects or with other people.
|
||||
Gems can perform actions like:
|
||||
|
||||
* Converting a Ruby object to JSON
|
||||
* Pagination
|
||||
* Interacting with APIs such as GitHub
|
||||
* Jekyll itself is a gem as well as many Jekyll plugins including
|
||||
|
||||
Jekyll is a gem. Many Jekyll [plugins]({{ '/docs/plugins/' | relative_url }}) are also gems, including
|
||||
[jekyll-feed](https://github.com/jekyll/jekyll-feed),
|
||||
[jekyll-seo-tag](https://github.com/jekyll/jekyll-seo-tag) and
|
||||
[jekyll-archives](https://github.com/jekyll/jekyll-archives).
|
||||
|
||||
## Gemfile
|
||||
|
||||
A `Gemfile` is a list of gems required for your site. For a simple Jekyll site it might look something like this:
|
||||
A `Gemfile` is a list of gems used by your site. Every Jekyll site has a Gemfile in the main folder.
|
||||
|
||||
For a simple Jekyll site it might look something like this:
|
||||
|
||||
```ruby
|
||||
source "https://rubygems.org"
|
||||
|
@ -35,10 +38,19 @@ end
|
|||
|
||||
## Bundler
|
||||
|
||||
Bundler installs the gems in your `Gemfile`. It's not a requirement for you to use a `Gemfile` and `bundler`; however, it's highly recommended as it ensures you're running the same version of Jekyll and Jekyll plugins across different environments.
|
||||
[Bundler](https://rubygems.org/gems/bundler) is a gem that installs all gems in your `Gemfile`.
|
||||
|
||||
`gem install bundler` installs [Bundler](https://rubygems.org/gems/bundler). You only need to install it once — not every time you create a new Jekyll project. Here are some additional details:
|
||||
While you don't have to use `Gemfile` and `bundler`, it is highly recommended as it ensures you're running the same version of Jekyll and its plugins across different environments.
|
||||
|
||||
If you're using a `Gemfile` you would first run `bundle install` to install the gems, then `bundle exec jekyll serve` to build your site. This guarantees you're using the gem versions set in the `Gemfile`. If you're not using a `Gemfile` you can just run `jekyll serve`.
|
||||
Install Bundler using `gem install bundler`. You only need to install it once, not every time you create a new Jekyll project.
|
||||
|
||||
For more information about how to use Bundler in your Jekyll project, this [tutorial](/tutorials/using-jekyll-with-bundler/) should provide answers to the most common questions and explain how to get up and running quickly.
|
||||
To install gems in your Gemfile using Bundler, run the following in the directory that has the Gemfile:
|
||||
|
||||
```
|
||||
bundle install
|
||||
bundle exec jekyll serve
|
||||
```
|
||||
|
||||
To bypass Bundler if you aren't using a Gemfile, run `jekyll serve`.
|
||||
|
||||
See [Using Jekyll with Bundler](/tutorials/using-jekyll-with-bundler/) for more information about Bundler in Jekyll and for instructions to get up and running quickly.
|
||||
|
|
Loading…
Reference in New Issue