Skip to content

Commit 59b3313

Browse files
monfreshMoncef BelyamaniBenWhettonhubwriter
authored andcommitted
Update creating-a-github-pages-site-with-jekyll.md (github#2178)
* Update creating-a-github-pages-site-with-jekyll.md The previous instructions for installing the `github-pages` gem via the Gemfile were confusing. If you search for `could not find gem github-pages` in your favorite search engine, you'll find many people didn't uncomment the line and/or tried to run `bundle update github-pages` instead of `bundle install`. This is my attempt to make things clearer by being more specific step by step. * Update step 7 as well I was initially focused on steps 8-10, but I thought I should try all of the commands to make sure everything works. As far as I can tell, you cannot pass in a version number to the `jekyll new` command, at least not the way it was documented here. Also, the Bundler section is more confusing than helpful because for `bundle exec` to work, a Gemfile must exist in the directory, but the instructions don’t mention that. Instead of adding more steps, I thought it was easier to skip that section. Because people installing Jekyll today will have version 4.2.0, and because github-pages only supports 3.9.0, one must run `bundle update` instead of `bundle install` to resolve all dependencies. * Update content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md Co-authored-by: Ben Whetton <[email protected]> * Update content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md Co-authored-by: Ben Whetton <[email protected]> * Update content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md Co-authored-by: hubwriter <[email protected]> * Update content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md Co-authored-by: hubwriter <[email protected]> * Update creating-a-github-pages-site-with-jekyll.md Co-authored-by: Moncef Belyamani <[email protected]> Co-authored-by: Ben Whetton <[email protected]> Co-authored-by: hubwriter <[email protected]>
1 parent 2802f54 commit 59b3313

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Before you can use Jekyll to create a {% data variables.product.prodname_pages %
4646
$ git init <em>REPOSITORY-NAME</em>
4747
> Initialized empty Git repository in /Users/octocat/my-site/.git/
4848
# Creates a new folder on your computer, initialized as a Git repository
49-
```
49+
```
5050
4. Change directories to the repository.
5151
```shell
5252
$ cd <em>REPOSITORY-NAME</em>
@@ -65,24 +65,24 @@ Before you can use Jekyll to create a {% data variables.product.prodname_pages %
6565
$ git checkout --orphan gh-pages
6666
# Creates a new branch, with no history or contents, called gh-pages and switches to the gh-pages branch
6767
```
68-
7. To create a new Jekyll site, use the `jekyll new` command, replacing _VERSION_ with the current dependency version for Jekyll. For more information, see "[Dependency versions](https://pages.github.com/versions/)" on the {% data variables.product.prodname_pages %} site.
69-
- If you installed Bundler:
70-
```shell
71-
$ bundle exec jekyll <em>VERSION</em> new .
72-
# Creates a Jekyll site in the current directory
73-
```
74-
- If you don't have Bundler installed:
75-
```shell
76-
$ jekyll <em>VERSION</em> new .
77-
# Creates a Jekyll site in the current directory
78-
```
79-
8. Open the Gemfile that was created and follow the instructions in the Gemfile's comments to use {% data variables.product.prodname_pages %}.
80-
![Instructions for updating Gemfile](/assets/images/help/pages/gemfile-instructions.png)
81-
9. Update the `gem "github-pages"` line so that the line looks like this, replacing _VERSION_ with the current dependency version for `github-pages`. For more information, see "[Dependency versions](https://pages.github.com/versions/)" on the {% data variables.product.prodname_pages %} site.
82-
```shell
83-
gem "github-pages", "~> <em>VERSION</em>", group: :jekyll_plugins
84-
```
68+
7. To create a new Jekyll site, use the `jekyll new` command:
69+
```shell
70+
$ jekyll new .
71+
# Creates a Jekyll site in the current directory
72+
```
73+
8. Open the Gemfile that Jekyll created.
74+
1. Add "#" to the beginning of the line that starts with `gem "jekyll"` to comment out this line.
75+
1. Add the `github-pages` gem by editing the line starting with `# gem "github-pages"`. Change this line to:
76+
77+
```shell
78+
gem "github-pages", "~> GITHUB-PAGES-VERSION", group: :jekyll_plugins
79+
```
80+
81+
Replace _GITHUB-PAGES-VERSION_ with the latest supported version of the `github-pages` gem. You can find this version here: "[Dependency versions](https://pages.github.com/versions/)."
82+
83+
The correct version Jekyll will be installed as a dependency of the `github-pages` gem.
8584
10. Save and close the Gemfile.
85+
11. From the command line, run `bundle update`.
8686
11. Optionally, test your site locally. For more information, see "[Testing your {% data variables.product.prodname_pages %} site locally with Jekyll](/articles/testing-your-github-pages-site-locally-with-jekyll)."
8787
12. Add your {% data variables.product.product_name %} repository as a remote, replacing {% if enterpriseServerVersions contains currentVersion or currentVersion == "github-ae@latest" %}_HOSTNAME_ with your enterprise's hostname,{% endif %} _USER_ with the account that owns the repository{% if enterpriseServerVersions contains currentVersion or currentVersion == "github-ae@latest" %},{% endif %} and _REPOSITORY_ with the name of the repository.
8888
```shell

0 commit comments

Comments
 (0)