From 465dbb9e241381badf9ef6d200e583c6d1c4fc92 Mon Sep 17 00:00:00 2001 From: Moncef Belyamani Date: Wed, 16 Dec 2020 16:39:10 -0500 Subject: [PATCH 1/7] 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. --- ...reating-a-github-pages-site-with-jekyll.md | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md index c02beb7e31e8..0db6e11c2e09 100644 --- a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md +++ b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md @@ -74,13 +74,25 @@ Before you can use Jekyll to create a {% data variables.product.prodname_pages % $ jekyll VERSION new . # Creates a Jekyll site in the current directory ``` -8. Open the Gemfile that was created and follow the instructions in the Gemfile's comments to use {% data variables.product.prodname_pages %}. - ![Instructions for updating Gemfile](/assets/images/help/pages/gemfile-instructions.png) -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. -```shell -gem "github-pages", "~> VERSION", group: :jekyll_plugins -``` +8. Open the Gemfile that was created, find the line that looks like this: + ```shell + # gem "github-pages", group: :jekyll_plugins + ``` + and update it so that it looks like this: + ```shell + gem "github-pages", "~> 209", group: :jekyll_plugins + ``` + If there is a newer version of the `github-pages` gem, replace `209` above with the latest version that is listed in [Rubygems](https://rubygems.org/gems/github-pages). + Then find the line that looks like this: + ```shell + gem "jekyll", "~> 4.0.0" + ``` + and disable it by adding a `#` to it: + ```shell + # gem "jekyll", "~> 4.0.0" + ``` 10. Save and close the Gemfile. +11. From the command line, run `bundle install`. 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)." 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. ```shell From 0a459f6113f96a0c1632a213d76b59361d735503 Mon Sep 17 00:00:00 2001 From: Moncef Belyamani Date: Wed, 16 Dec 2020 23:50:47 -0500 Subject: [PATCH 2/7] Update step 7 as well MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- ...reating-a-github-pages-site-with-jekyll.md | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md index 0db6e11c2e09..899d4e426d06 100644 --- a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md +++ b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md @@ -44,7 +44,7 @@ Before you can use Jekyll to create a {% data variables.product.prodname_pages % $ git init REPOSITORY-NAME > Initialized empty Git repository in /Users/octocat/my-site/.git/ # Creates a new folder on your computer, initialized as a Git repository - ``` + ``` 4. Change directories to the repository. ```shell $ cd REPOSITORY-NAME @@ -63,18 +63,12 @@ Before you can use Jekyll to create a {% data variables.product.prodname_pages % $ git checkout --orphan gh-pages # Creates a new branch, with no history or contents, called gh-pages and switches to the gh-pages branch ``` - 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. - - If you installed Bundler: - ```shell - $ bundle exec jekyll VERSION new . - # Creates a Jekyll site in the current directory - ``` - - If you don't have Bundler installed: - ```shell - $ jekyll VERSION new . - # Creates a Jekyll site in the current directory - ``` -8. Open the Gemfile that was created, find the line that looks like this: +7. To create a new Jekyll site, use the `jekyll new` command: + ```shell + $ jekyll new . + # Creates a Jekyll site in the current directory + ``` +8. Open the file called `Gemfile` that was created, and find the line that looks like this: ```shell # gem "github-pages", group: :jekyll_plugins ``` @@ -85,14 +79,14 @@ Before you can use Jekyll to create a {% data variables.product.prodname_pages % If there is a newer version of the `github-pages` gem, replace `209` above with the latest version that is listed in [Rubygems](https://rubygems.org/gems/github-pages). Then find the line that looks like this: ```shell - gem "jekyll", "~> 4.0.0" + gem "jekyll", "~> 4.2.0" ``` and disable it by adding a `#` to it: ```shell - # gem "jekyll", "~> 4.0.0" + # gem "jekyll", "~> 4.2.0" ``` 10. Save and close the Gemfile. -11. From the command line, run `bundle install`. +11. From the command line, run `bundle update`. 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)." 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. ```shell From 31c3ca22e255842c9dfb001a1701a1cd4a71574f Mon Sep 17 00:00:00 2001 From: Moncef Belyamani Date: Tue, 19 Jan 2021 16:16:34 -0500 Subject: [PATCH 3/7] Update content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md Co-authored-by: Ben Whetton --- .../creating-a-github-pages-site-with-jekyll.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md index 899d4e426d06..976c55f15be1 100644 --- a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md +++ b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md @@ -77,14 +77,11 @@ Before you can use Jekyll to create a {% data variables.product.prodname_pages % gem "github-pages", "~> 209", group: :jekyll_plugins ``` If there is a newer version of the `github-pages` gem, replace `209` above with the latest version that is listed in [Rubygems](https://rubygems.org/gems/github-pages). - Then find the line that looks like this: - ```shell - gem "jekyll", "~> 4.2.0" - ``` - and disable it by adding a `#` to it: - ```shell - # gem "jekyll", "~> 4.2.0" + Comment out the Gemfile line which starts with: + ```shell + gem "jekyll" ``` + The correct version Jekyll will be installed as a dependency of the `github-pages` gem. 10. Save and close the Gemfile. 11. From the command line, run `bundle update`. 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)." From 604d91c3a185fdc885d3d67c26ede378c680e474 Mon Sep 17 00:00:00 2001 From: Moncef Belyamani Date: Tue, 19 Jan 2021 16:17:01 -0500 Subject: [PATCH 4/7] Update content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md Co-authored-by: Ben Whetton --- .../creating-a-github-pages-site-with-jekyll.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md index 976c55f15be1..3efc171adc5a 100644 --- a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md +++ b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md @@ -68,15 +68,11 @@ Before you can use Jekyll to create a {% data variables.product.prodname_pages % $ jekyll new . # Creates a Jekyll site in the current directory ``` -8. Open the file called `Gemfile` that was created, and find the line that looks like this: +8. Open the Gemfile that was created by jekyll. +9. Add the github-pages gem: update the line starting with `# gem "github-pages"`so that it looks like this, replacing _GITHUB-PAGES-VERSION_ with the latest supported version of the `github-pages` gem. This can be found on the "[Dependency versions](https://pages.github.com/versions/)" page of the {% data variables.product.prodname_pages %} site: ```shell - # gem "github-pages", group: :jekyll_plugins + gem "github-pages", "~> GITHUB-PAGES-VERSION", group: :jekyll_plugins ``` - and update it so that it looks like this: - ```shell - gem "github-pages", "~> 209", group: :jekyll_plugins - ``` - If there is a newer version of the `github-pages` gem, replace `209` above with the latest version that is listed in [Rubygems](https://rubygems.org/gems/github-pages). Comment out the Gemfile line which starts with: ```shell gem "jekyll" From c736e80aff61bb965eb476f2ae7e3dbb30518602 Mon Sep 17 00:00:00 2001 From: Moncef Belyamani Date: Mon, 15 Feb 2021 16:30:58 -0500 Subject: [PATCH 5/7] Update content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md Co-authored-by: hubwriter --- .../creating-a-github-pages-site-with-jekyll.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md index eba397649a3d..aa410bcdb4a3 100644 --- a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md +++ b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md @@ -70,7 +70,7 @@ Before you can use Jekyll to create a {% data variables.product.prodname_pages % $ jekyll new . # Creates a Jekyll site in the current directory ``` -8. Open the Gemfile that was created by jekyll. +8. Open the Gemfile that Jekyll created. 9. Add the github-pages gem: update the line starting with `# gem "github-pages"`so that it looks like this, replacing _GITHUB-PAGES-VERSION_ with the latest supported version of the `github-pages` gem. This can be found on the "[Dependency versions](https://pages.github.com/versions/)" page of the {% data variables.product.prodname_pages %} site: ```shell gem "github-pages", "~> GITHUB-PAGES-VERSION", group: :jekyll_plugins From 7a0b91d9b5a90c518ab4fa09d24cebc610728f07 Mon Sep 17 00:00:00 2001 From: Moncef Belyamani Date: Mon, 15 Feb 2021 16:32:44 -0500 Subject: [PATCH 6/7] Update content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md Co-authored-by: hubwriter --- .../creating-a-github-pages-site-with-jekyll.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md index aa410bcdb4a3..6fcf1e73b1cf 100644 --- a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md +++ b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md @@ -71,14 +71,14 @@ Before you can use Jekyll to create a {% data variables.product.prodname_pages % # Creates a Jekyll site in the current directory ``` 8. Open the Gemfile that Jekyll created. -9. Add the github-pages gem: update the line starting with `# gem "github-pages"`so that it looks like this, replacing _GITHUB-PAGES-VERSION_ with the latest supported version of the `github-pages` gem. This can be found on the "[Dependency versions](https://pages.github.com/versions/)" page of the {% data variables.product.prodname_pages %} site: +1. Add "#" to the beginning of the line that starts with `gem "jekyll"` to comment out this line. +1. Add the `github-pages` gem by editing the line starting with `# gem "github-pages"`. Change this line to: + ```shell - gem "github-pages", "~> GITHUB-PAGES-VERSION", group: :jekyll_plugins - ``` - Comment out the Gemfile line which starts with: - ```shell - gem "jekyll" - ``` + gem "github-pages", "~> GITHUB-PAGES-VERSION", group: :jekyll_plugins``` + +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/)." + The correct version Jekyll will be installed as a dependency of the `github-pages` gem. 10. Save and close the Gemfile. 11. From the command line, run `bundle update`. From cb6bdb862a3c1df7afa121f54faa8da3b2a5e4e5 Mon Sep 17 00:00:00 2001 From: hubwriter Date: Tue, 16 Feb 2021 09:15:22 +0000 Subject: [PATCH 7/7] Update creating-a-github-pages-site-with-jekyll.md --- .../creating-a-github-pages-site-with-jekyll.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md index 6fcf1e73b1cf..a6857aa6eda6 100644 --- a/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md +++ b/content/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll.md @@ -75,11 +75,12 @@ Before you can use Jekyll to create a {% data variables.product.prodname_pages % 1. Add the `github-pages` gem by editing the line starting with `# gem "github-pages"`. Change this line to: ```shell - gem "github-pages", "~> GITHUB-PAGES-VERSION", group: :jekyll_plugins``` + gem "github-pages", "~> GITHUB-PAGES-VERSION", group: :jekyll_plugins + ``` -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/)." + 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/)." - The correct version Jekyll will be installed as a dependency of the `github-pages` gem. + The correct version Jekyll will be installed as a dependency of the `github-pages` gem. 10. Save and close the Gemfile. 11. From the command line, run `bundle update`. 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)."