From da762eaa42f0410dcd6c254c4f020d0f63532330 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 3 Nov 2016 15:48:37 -0700 Subject: [PATCH 01/84] Revert "Add permalinks to docs in '/maintaining/'" --- docs/_docs/maintaining/affinity-team-captain.md | 1 - docs/_docs/maintaining/avoiding-burnout.md | 1 - docs/_docs/maintaining/becoming-a-maintainer.md | 1 - docs/_docs/maintaining/merging-a-pull-request.md | 1 - docs/_docs/maintaining/reviewing-a-pull-request.md | 1 - docs/_docs/maintaining/special-labels.md | 1 - docs/_docs/maintaining/triaging-an-issue.md | 1 - 7 files changed, 7 deletions(-) diff --git a/docs/_docs/maintaining/affinity-team-captain.md b/docs/_docs/maintaining/affinity-team-captain.md index 0554fdc6..02247d2d 100644 --- a/docs/_docs/maintaining/affinity-team-captain.md +++ b/docs/_docs/maintaining/affinity-team-captain.md @@ -1,7 +1,6 @@ --- title: Affinity Team Captains layout: docs -permalink: /docs/maintaining/affinity-team-captain/ --- **This guide is for affinity team captains.** These special people are **team maintainers** of one of our [affinity teams][] and help triage and evaluate the issues and contributions of others. You may find what is written here interesting, but it’s definitely not for everyone. diff --git a/docs/_docs/maintaining/avoiding-burnout.md b/docs/_docs/maintaining/avoiding-burnout.md index 72e46e1a..a418cefd 100644 --- a/docs/_docs/maintaining/avoiding-burnout.md +++ b/docs/_docs/maintaining/avoiding-burnout.md @@ -1,7 +1,6 @@ --- title: "Avoiding Burnout" layout: docs -permalink: /docs/maintaining/avoiding-burnout/ --- **This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but it’s definitely not for everyone. diff --git a/docs/_docs/maintaining/becoming-a-maintainer.md b/docs/_docs/maintaining/becoming-a-maintainer.md index 61b19e2c..c4a262b9 100644 --- a/docs/_docs/maintaining/becoming-a-maintainer.md +++ b/docs/_docs/maintaining/becoming-a-maintainer.md @@ -1,7 +1,6 @@ --- title: "Becoming a Maintainer" layout: docs -permalink: /docs/maintaining/becoming-a-maintainer/ --- **This guide is for contributors.** These special people have contributed to one or more of Jekyll's repositories, but do not yet have write access to any. You may find what is written here interesting, but it’s definitely not for everyone. diff --git a/docs/_docs/maintaining/merging-a-pull-request.md b/docs/_docs/maintaining/merging-a-pull-request.md index e5c5eacf..7265c6f8 100644 --- a/docs/_docs/maintaining/merging-a-pull-request.md +++ b/docs/_docs/maintaining/merging-a-pull-request.md @@ -1,7 +1,6 @@ --- title: "Merging a Pull Request" layout: docs -permalink: /docs/maintaining/merging-a-pull-request/ --- **This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but it’s definitely not for everyone. diff --git a/docs/_docs/maintaining/reviewing-a-pull-request.md b/docs/_docs/maintaining/reviewing-a-pull-request.md index 3185a19e..1ecaeea9 100644 --- a/docs/_docs/maintaining/reviewing-a-pull-request.md +++ b/docs/_docs/maintaining/reviewing-a-pull-request.md @@ -1,7 +1,6 @@ --- title: "Reviewing a Pull Request" layout: docs -permalink: /docs/maintaining/reviewing-a-pull-request/ --- **This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but it’s definitely not for everyone. diff --git a/docs/_docs/maintaining/special-labels.md b/docs/_docs/maintaining/special-labels.md index 7a32a1fa..ff8a623f 100644 --- a/docs/_docs/maintaining/special-labels.md +++ b/docs/_docs/maintaining/special-labels.md @@ -1,7 +1,6 @@ --- title: "Special Labels" layout: docs -permalink: /docs/maintaining/special-labels/ --- **This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but it’s definitely not for everyone. diff --git a/docs/_docs/maintaining/triaging-an-issue.md b/docs/_docs/maintaining/triaging-an-issue.md index 6c97f967..4802b61b 100644 --- a/docs/_docs/maintaining/triaging-an-issue.md +++ b/docs/_docs/maintaining/triaging-an-issue.md @@ -1,7 +1,6 @@ --- title: "Triaging an Issue" layout: docs -permalink: /docs/maintaining/triaging-an-issue/ --- **This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but it’s definitely not for everyone. From 8d1e0433061b1ebae06d5755dc05edf7ecdbe3da Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 3 Nov 2016 15:49:21 -0700 Subject: [PATCH 02/84] Set docs permalink in config --- docs/_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_config.yml b/docs/_config.yml index 6f57710a..32ae74bb 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -12,6 +12,7 @@ timezone: America/Los_Angeles collections: docs: + permalink: /:collection/:path/ output: true posts: permalink: /news/:year/:month/:day/:title/ From 820b704e3f9f2a05541d90988ef36bf2ecd29466 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Thu, 10 Nov 2016 00:00:26 +0100 Subject: [PATCH 03/84] appease script/proof --disable-external --- docs/_docs/continuous-integration.md | 2 +- docs/_docs/contributing.md | 6 +++--- docs/_docs/github-pages.md | 6 +++--- docs/_docs/maintaining/avoiding-burnout.md | 2 +- docs/_docs/maintaining/becoming-a-maintainer.md | 6 +++--- docs/_docs/maintaining/merging-a-pull-request.md | 2 +- docs/_docs/maintaining/reviewing-a-pull-request.md | 2 +- docs/_docs/maintaining/special-labels.md | 2 +- docs/_docs/plugins.md | 1 - 9 files changed, 14 insertions(+), 15 deletions(-) diff --git a/docs/_docs/continuous-integration.md b/docs/_docs/continuous-integration.md index 4b5b2d4e..54b3466c 100644 --- a/docs/_docs/continuous-integration.md +++ b/docs/_docs/continuous-integration.md @@ -229,5 +229,5 @@ an entry in the `.gitignore` file to avoid it from being checked in again. This entire guide is open-source. Go ahead and [edit it][3] if you have a fix or [ask for help][4] if you run into trouble and need some help. -[3]: https://github.com/jekyll/jekyll/edit/master/site/_docs/continuous-integration.md +[3]: https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration.md [4]: https://jekyllrb.com/help/ diff --git a/docs/_docs/contributing.md b/docs/_docs/contributing.md index a317631c..c5a37722 100644 --- a/docs/_docs/contributing.md +++ b/docs/_docs/contributing.md @@ -67,13 +67,13 @@ We want the Jekyll documentation to be the best it can be. We've open-sourced ou ### How to submit changes -You can find the documentation for jekyllrb.com in the [site](https://github.com/jekyll/jekyll/tree/master/site) directory. See the section above, [submitting a pull request](#submitting-a-pull-request) for information on how to propose a change. +You can find the documentation for jekyllrb.com in the [docs](https://github.com/jekyll/jekyll/tree/master/docs) directory. See the section above, [submitting a pull request](#submitting-a-pull-request) for information on how to propose a change. One gotcha, all pull requests should be directed at the `master` branch (the default branch). ### Adding plugins -If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](https://github.com/jekyll/jekyll/blob/master/site/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type. +If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](https://github.com/jekyll/jekyll/blob/master/docs/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type. ## Code Contributions @@ -85,7 +85,7 @@ Any time you propose a code change, you should also include updates to the docum #### Documentation -If your contribution changes any Jekyll behavior, make sure to update the documentation. Documentation lives in the `site/_docs` folder (spoiler alert: it's a Jekyll site!). If the docs are missing information, please feel free to add it in. Great docs make a great project. Include changes to the documentation within your pull request, and once merged, `jekyllrb.com` will be updated. +If your contribution changes any Jekyll behavior, make sure to update the documentation. Documentation lives in the `docs/_docs` folder (spoiler alert: it's a Jekyll site!). If the docs are missing information, please feel free to add it in. Great docs make a great project. Include changes to the documentation within your pull request, and once merged, `jekyllrb.com` will be updated. #### Tests diff --git a/docs/_docs/github-pages.md b/docs/_docs/github-pages.md index 6a449d68..7a90b8bb 100644 --- a/docs/_docs/github-pages.md +++ b/docs/_docs/github-pages.md @@ -122,9 +122,9 @@ custom domain is specified—see below). The Jekyll project repository itself is a perfect example of this branch structure—the [master branch]({{ site.repository }}) contains the -actual software project for Jekyll, however the Jekyll website (that you’re -looking at right now) is contained in the [gh-pages -branch]({{ site.repository }}/tree/gh-pages) of the same repository. +actual software project for Jekyll, and the Jekyll website that you’re +looking at right now is contained in the [docs +folder]({{ site.repository }}/tree/master/docs) of the same repository.
Source Files Must be in the Root Directory
diff --git a/docs/_docs/maintaining/avoiding-burnout.md b/docs/_docs/maintaining/avoiding-burnout.md index a418cefd..1d1d93b1 100644 --- a/docs/_docs/maintaining/avoiding-burnout.md +++ b/docs/_docs/maintaining/avoiding-burnout.md @@ -28,4 +28,4 @@ Jekyll gets a lot of feature requests, non-reproducible bug reports, usage quest Thanks to https://gist.github.com/ryanflorence/124070e7c4b3839d4573 which influenced this document. -Thanks to [Homebrew's "Avoiding Burnout" document](https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Maintainers-Avoiding-Burnout.md) for providing a perfect base for this document. +Thanks to [Homebrew's "Avoiding Burnout" document](https://github.com/Homebrew/brew/blob/master/docs/Maintainers-Avoiding-Burnout.md) for providing a perfect base for this document. diff --git a/docs/_docs/maintaining/becoming-a-maintainer.md b/docs/_docs/maintaining/becoming-a-maintainer.md index c4a262b9..e4a1840c 100644 --- a/docs/_docs/maintaining/becoming-a-maintainer.md +++ b/docs/_docs/maintaining/becoming-a-maintainer.md @@ -14,7 +14,7 @@ You want to maintain Jekyll? Use it often. Do weird things with it. Do normal th ## 2. Help Triage Issues -Watch the repository you're interested in. Join [an Affinity Team](https://teams.jekyllrb.com) and receive mentions regarding a particular interest area of the project. When you receive a notification for an issue that has not been triaged by a maintainer, dive in. Can you reproduce the issue? Can you determine the fix? [More tips on Triaging an Issue in our maintainer guide](triaging-an-issue.md). Every maintainer loves an issue that is resolved before they get to it. :smiley: +Watch the repository you're interested in. Join [an Affinity Team](https://teams.jekyllrb.com) and receive mentions regarding a particular interest area of the project. When you receive a notification for an issue that has not been triaged by a maintainer, dive in. Can you reproduce the issue? Can you determine the fix? [More tips on Triaging an Issue in our maintainer guide](../triaging-an-issue). Every maintainer loves an issue that is resolved before they get to it. :smiley: ## 3. Write Documentation @@ -26,7 +26,7 @@ As a maintainer, you will be reviewing pull requests which update code. You shou ## 5. Review Pull Requests -Start by reviewing one pull request a week. Leave detailed comments and [follow our guide for reviewing pull requests](reviewing-a-pull-request.md). +Start by reviewing one pull request a week. Leave detailed comments and [follow our guide for reviewing pull requests](../reviewing-a-pull-request). ## 6. Ask! @@ -36,4 +36,4 @@ We would love to expand the team and look forward to many more community members # Helping Out Elsewhere -In addition to maintainers of our core and plugin code, the Jekyll team is comprised of moderators for our forums. These helpful community members take a look at the topics posted to https://talk.jekyllrb.com and ensure they are properly categorized and are acceptable under our Code of Conduct. If you would like to be a moderator, email one of the maintainers with links to where you have answered questions and a request to be added as a moderator. More help is always welcome. +In addition to maintainers of our core and plugin code, the Jekyll team is comprised of moderators for our forums. These helpful community members take a look at the topics posted to [https://talk.jekyllrb.com](https://talk.jekyllrb.com) and ensure they are properly categorized and are acceptable under our Code of Conduct. If you would like to be a moderator, email one of the maintainers with links to where you have answered questions and a request to be added as a moderator. More help is always welcome. diff --git a/docs/_docs/maintaining/merging-a-pull-request.md b/docs/_docs/maintaining/merging-a-pull-request.md index 7265c6f8..80ad6f7c 100644 --- a/docs/_docs/maintaining/merging-a-pull-request.md +++ b/docs/_docs/maintaining/merging-a-pull-request.md @@ -10,7 +10,7 @@ layout: docs All pull requests should be subject to code review. Code review is a [foundational value](https://blog.fullstory.com/what-we-learned-from-google-code-reviews-arent-just-for-catching-bugs-b125a13aa292) of good engineering teams. Besides providing validation of correctness, it promotes a sense of community and gives other maintainers understanding of all parts of the code base. In short, code review is crucial to a healthy open source project. -**Read our guide for [Reviewing a pull request](reviewing-a-pull-request.md) before merging.** Notably, the change must have tests if for code, and at least two maintainers must give it an OK. +**Read our guide for [Reviewing a pull request](../reviewing-a-pull-request) before merging.** Notably, the change must have tests if for code, and at least two maintainers must give it an OK. ## Merging diff --git a/docs/_docs/maintaining/reviewing-a-pull-request.md b/docs/_docs/maintaining/reviewing-a-pull-request.md index 1ecaeea9..ebdd7a3c 100644 --- a/docs/_docs/maintaining/reviewing-a-pull-request.md +++ b/docs/_docs/maintaining/reviewing-a-pull-request.md @@ -8,7 +8,7 @@ layout: docs ## Respond Kindly -Above all else, please review a pull request kindly. Our community can only be strong if we make it a welcoming and inclusive environment. To further promote this, the Jekyll community is governed by a [Code of Conduct](../CONDUCT.markdown) by which all community members must abide. +Above all else, please review a pull request kindly. Our community can only be strong if we make it a welcoming and inclusive environment. To further promote this, the Jekyll community is governed by a [Code of Conduct](/docs/conduct) by which all community members must abide. Use emoji liberally :heart: :tada: :sparkles: :confetti_ball: and feel free to be emotive!! Contributions keep this project moving forward and we're always happy to receive them, even if the pull request isn't ultimately merged. diff --git a/docs/_docs/maintaining/special-labels.md b/docs/_docs/maintaining/special-labels.md index ff8a623f..eea366e9 100644 --- a/docs/_docs/maintaining/special-labels.md +++ b/docs/_docs/maintaining/special-labels.md @@ -18,4 +18,4 @@ These labels are used to indicate that the Git state of a pull request must chan ## `stale` -This label is automatically added and removed by @jekyllbot based on activity on an issue or pull request. The rules for this label are laid out in [Triaging an Issue: Staleness and automatic closure](triaging-an-issue.md#staleness-and-automatic-closure). +This label is automatically added and removed by @jekyllbot based on activity on an issue or pull request. The rules for this label are laid out in [Triaging an Issue: Staleness and automatic closure](../triaging-an-issue/#staleness-and-automatic-closure). diff --git a/docs/_docs/plugins.md b/docs/_docs/plugins.md index 6e5bbf23..e546396f 100644 --- a/docs/_docs/plugins.md +++ b/docs/_docs/plugins.md @@ -771,7 +771,6 @@ LESS.js files during generation. - [Markdown References by Olov Lassus](https://github.com/olov/jekyll-references): Keep all your markdown reference-style link definitions in one \_references.md file. - [Stylus Converter](https://gist.github.com/988201): Convert .styl to .css. - [ReStructuredText Converter](https://github.com/xdissent/jekyll-rst): Converts ReST documents to HTML with Pygments syntax highlighting. -- [Jekyll-pandoc-plugin](https://github.com/dsanson/jekyll-pandoc-plugin): Use pandoc for rendering markdown. - [Jekyll-pandoc-multiple-formats](https://github.com/fauno/jekyll-pandoc-multiple-formats) by [edsl](https://github.com/edsl): Use pandoc to generate your site in multiple formats. Supports pandoc’s markdown extensions. - [Transform Layouts](https://gist.github.com/1472645): Allows HAML layouts (you need a HAML Converter plugin for this to work). - [Org-mode Converter](https://gist.github.com/abhiyerra/7377603): Org-mode converter for Jekyll. From f5f387711a87555ea5c7b4988e4510975512a324 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Sun, 11 Dec 2016 15:35:46 +0530 Subject: [PATCH 04/84] update documentation on updating FontAwesome Iconset --- docs/_docs/contributing.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/_docs/contributing.md b/docs/_docs/contributing.md index c5a37722..662c60c0 100644 --- a/docs/_docs/contributing.md +++ b/docs/_docs/contributing.md @@ -71,6 +71,26 @@ You can find the documentation for jekyllrb.com in the [docs](https://github.com One gotcha, all pull requests should be directed at the `master` branch (the default branch). +### Updating FontAwesome package for jekyllrb.com + +We recently moved to using a stripped-down version of FontAwesome iconset on the site, consisting of only those icons that we actually use here. + +If you ever need to update our documentation with an icon that is not already available in our custom iconset, you'll have to regenerate the iconset using Icomoon's Generator: + +1. Go to +2. Click `Import Icons` on the top-horizontal-bar and upload `icomoon-selection.json` +3. Click `Add Icons from Library..` further down on the page, and add 'Font Awesome' +4. Select the required icon(s) from the Library (make sure its the 'FontAwesome' library instead of 'IcoMoon-Free' library). +5. Click `Generate Font` on the bottom-horizontal-bar +6. Inspect the included icons and proceed by clicking `Download`. +7. Extract the font files and adapt the CSS to the paths we use in Jekyll: + - Copy the entire `fonts` directory over and overwrite existing ones at `/docs/`. + - Copy the contents of `selection.json` and overwrite existing content inside `/docs/icomoon-selection.json`. + - Copy the entire `@font-face {}` declaration and only the **new-icon(s)' css declarations** further below, to update the + `/docs/_sass/_font-awesome.scss` sass partial. + - Fix paths in the `@font-face {}` declaraion by adding `../` before `fonts/FontAwesome.???` like so: + `('../fonts/Fontawesome.woff?9h6hxj')` + ### Adding plugins If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](https://github.com/jekyll/jekyll/blob/master/docs/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type. From 8a89f033ad0b67a71f5df5940e634c3acf02ff3a Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Sun, 11 Dec 2016 19:52:22 +0530 Subject: [PATCH 05/84] fix errors. --- docs/_docs/contributing.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/_docs/contributing.md b/docs/_docs/contributing.md index 662c60c0..0099c08a 100644 --- a/docs/_docs/contributing.md +++ b/docs/_docs/contributing.md @@ -71,25 +71,25 @@ You can find the documentation for jekyllrb.com in the [docs](https://github.com One gotcha, all pull requests should be directed at the `master` branch (the default branch). -### Updating FontAwesome package for jekyllrb.com +### Updating FontAwesome iconset for jekyllrb.com We recently moved to using a stripped-down version of FontAwesome iconset on the site, consisting of only those icons that we actually use here. If you ever need to update our documentation with an icon that is not already available in our custom iconset, you'll have to regenerate the iconset using Icomoon's Generator: -1. Go to -2. Click `Import Icons` on the top-horizontal-bar and upload `icomoon-selection.json` -3. Click `Add Icons from Library..` further down on the page, and add 'Font Awesome' +1. Go to . +2. Click `Import Icons` on the top-horizontal-bar and upload the existing `/docs/icomoon-selection.json`. +3. Click `Add Icons from Library..` further down on the page, and add 'Font Awesome'. 4. Select the required icon(s) from the Library (make sure its the 'FontAwesome' library instead of 'IcoMoon-Free' library). -5. Click `Generate Font` on the bottom-horizontal-bar +5. Click `Generate Font` on the bottom-horizontal-bar. 6. Inspect the included icons and proceed by clicking `Download`. 7. Extract the font files and adapt the CSS to the paths we use in Jekyll: - Copy the entire `fonts` directory over and overwrite existing ones at `/docs/`. - Copy the contents of `selection.json` and overwrite existing content inside `/docs/icomoon-selection.json`. - Copy the entire `@font-face {}` declaration and only the **new-icon(s)' css declarations** further below, to update the `/docs/_sass/_font-awesome.scss` sass partial. - - Fix paths in the `@font-face {}` declaraion by adding `../` before `fonts/FontAwesome.???` like so: - `('../fonts/Fontawesome.woff?9h6hxj')` + - Fix paths in the `@font-face {}` declaration by adding `../` before `fonts/FontAwesome.*` like so: + `('../fonts/Fontawesome.woff?9h6hxj')`. ### Adding plugins From 109dceee3dfe35ebba51e4706d9c19d926943f1e Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Sun, 18 Dec 2016 07:45:08 +0530 Subject: [PATCH 06/84] move changes to /.github/ and regenerate site --- .github/CONTRIBUTING.markdown | 20 ++++++++++++++++++++ docs/_docs/contributing.md | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.markdown b/.github/CONTRIBUTING.markdown index 9e9e479c..6a239fc7 100644 --- a/.github/CONTRIBUTING.markdown +++ b/.github/CONTRIBUTING.markdown @@ -66,6 +66,26 @@ You can find the documentation for jekyllrb.com in the [docs](https://github.com One gotcha, all pull requests should be directed at the `master` branch (the default branch). +### Updating FontAwesome iconset for jekyllrb.com + +We use a custom version of FontAwesome which contains just the icons we use. + +If you ever need to update our documentation with an icon that is not already available in our custom iconset, you'll have to regenerate the iconset using Icomoon's Generator: + +1. Go to . +2. Click `Import Icons` on the top-horizontal-bar and upload the existing `/docs/icomoon-selection.json`. +3. Click `Add Icons from Library..` further down on the page, and add 'Font Awesome'. +4. Select the required icon(s) from the Library (make sure its the 'FontAwesome' library instead of 'IcoMoon-Free' library). +5. Click `Generate Font` on the bottom-horizontal-bar. +6. Inspect the included icons and proceed by clicking `Download`. +7. Extract the font files and adapt the CSS to the paths we use in Jekyll: + - Copy the entire `fonts` directory over and overwrite existing ones at `/docs/`. + - Copy the contents of `selection.json` and overwrite existing content inside `/docs/icomoon-selection.json`. + - Copy the entire `@font-face {}` declaration and only the **new-icon(s)' css declarations** further below, to update the + `/docs/_sass/_font-awesome.scss` sass partial. + - Fix paths in the `@font-face {}` declaration by adding `../` before `fonts/FontAwesome.*` like so: + `('../fonts/Fontawesome.woff?9h6hxj')`. + ### Adding plugins If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](https://github.com/jekyll/jekyll/blob/master/docs/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type. diff --git a/docs/_docs/contributing.md b/docs/_docs/contributing.md index 0099c08a..9ccac293 100644 --- a/docs/_docs/contributing.md +++ b/docs/_docs/contributing.md @@ -73,7 +73,7 @@ One gotcha, all pull requests should be directed at the `master` branch (the def ### Updating FontAwesome iconset for jekyllrb.com -We recently moved to using a stripped-down version of FontAwesome iconset on the site, consisting of only those icons that we actually use here. +We use a custom version of FontAwesome which contains just the icons we use. If you ever need to update our documentation with an icon that is not already available in our custom iconset, you'll have to regenerate the iconset using Icomoon's Generator: From 38a50e49dec1c0ff58061e853870c792724a867b Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sat, 17 Dec 2016 21:59:26 -0800 Subject: [PATCH 07/84] Update history to reflect merge of #5655 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 65e79f96..dd181cba 100644 --- a/History.markdown +++ b/History.markdown @@ -11,6 +11,7 @@ * Use only the used Font Awesome icons. (#5530) * Switch to `https` when possible. (#5611) * Update `_font-awesome.scss` to move .woff file before .ttf (#5614) + * Update documentation on updating FontAwesome Iconset (#5655) ### Minor Enhancements From de56b977b6672d041215d681a6d47cb6c131c3d6 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 18 Dec 2016 07:22:11 +0100 Subject: [PATCH 08/84] ran rubocop -a #5665 --- lib/jekyll/collection.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index f04fdb3f..a2f912ac 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -32,8 +32,8 @@ module Jekyll # Override of method_missing to check in @data for the key. def method_missing(method, *args, &blck) if docs.respond_to?(method.to_sym) - Jekyll.logger.warn "Deprecation:", "#{label}.#{method} should be changed to" \ - "#{label}.docs.#{method}." + Jekyll.logger.warn "Deprecation:", + "#{label}.#{method} should be changed to #{label}.docs.#{method}." Jekyll.logger.warn "", "Called by #{caller.first}." docs.public_send(method.to_sym, *args, &blck) else @@ -197,6 +197,7 @@ module Jekyll end private + def read_document(full_path) doc = Jekyll::Document.new(full_path, :site => site, :collection => self) doc.read @@ -208,6 +209,7 @@ module Jekyll end private + def read_static_file(file_path, full_path) relative_dir = Jekyll.sanitized_path( relative_directory, @@ -215,7 +217,7 @@ module Jekyll ).chomp("/.") files << StaticFile.new(site, site.source, relative_dir, - File.basename(full_path), self) + File.basename(full_path), self) end end end From d134afcd4aa150746f472fb309e69487bc774039 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 18 Dec 2016 07:22:36 +0100 Subject: [PATCH 09/84] ran rubocop -a --- lib/jekyll/excerpt.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/jekyll/excerpt.rb b/lib/jekyll/excerpt.rb index 34a2e65c..61344e79 100644 --- a/lib/jekyll/excerpt.rb +++ b/lib/jekyll/excerpt.rb @@ -30,8 +30,7 @@ module Jekyll @data end - def trigger_hooks(*) - end + def trigger_hooks(*); end # 'Path' of the excerpt. # From 48f7a155c3e91d62e2b899334b34ab19916734bc Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 18 Dec 2016 08:55:05 +0100 Subject: [PATCH 10/84] reindent attributes --- lib/jekyll/collection.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index a2f912ac..9e906ab0 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -216,8 +216,13 @@ module Jekyll File.dirname(file_path) ).chomp("/.") - files << StaticFile.new(site, site.source, relative_dir, - File.basename(full_path), self) + files << StaticFile.new( + site, + site.source, + relative_dir, + File.basename(full_path), + self + ) end end end From 53db36c43a1ea8caffd77928a6abe30f8d2bfa9e Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 18 Dec 2016 02:02:42 -0800 Subject: [PATCH 11/84] Update history to reflect merge of #5666 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index dd181cba..368c0753 100644 --- a/History.markdown +++ b/History.markdown @@ -29,6 +29,7 @@ * clean unit-test names in `test/test_tags.rb` (#5608) * Add cucumber feature to test for bonafide theme gems (#5384) * Use `assert_nil` instead of `assert_equal nil` (#5652) + * Rubocop -a on lib/jekyll (#5666) ### Documentation From 2fc800ebd26dcbab97fddef0462b051b9945eebb Mon Sep 17 00:00:00 2001 From: Kevin Wojniak Date: Sun, 18 Dec 2016 17:32:19 -0800 Subject: [PATCH 12/84] Use each instead of map to actually return nothing --- lib/jekyll/reader.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/reader.rb b/lib/jekyll/reader.rb index 7bde499d..e1d3b8f5 100644 --- a/lib/jekyll/reader.rb +++ b/lib/jekyll/reader.rb @@ -71,7 +71,7 @@ module Jekyll # # Returns nothing. def retrieve_dirs(_base, dir, dot_dirs) - dot_dirs.map do |file| + dot_dirs.each do |file| dir_path = site.in_source_dir(dir, file) rel_path = File.join(dir, file) unless @site.dest.sub(%r!/$!, "") == dir_path From 79adb496764e29c31f5ead49f96e50f2629f3309 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 19 Dec 2016 12:40:10 -0800 Subject: [PATCH 13/84] Update history to reflect merge of #5668 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 368c0753..125dddd3 100644 --- a/History.markdown +++ b/History.markdown @@ -23,6 +23,7 @@ * Escaped regular expressions when using post_url. (#5605) * fix date parsing in file names to be stricter (#5609) * Add a module to re-define `ENV["TZ"]` in Windows (#5612) + * Use each instead of map to actually return nothing (#5668) ### Development Fixes From f09e1b15d8492a26a6597e363a261b60d2a70084 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 19 Dec 2016 23:42:30 +0100 Subject: [PATCH 14/84] bump to rake 12.0 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 378f6b82..b0fb8679 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" gemspec :name => "jekyll" -gem "rake", "~> 11.0" +gem "rake", "~> 12.0" # Dependency of jekyll-mentions. RubyGems in Ruby 2.1 doesn't shield us from this. gem "activesupport", "~> 4.2", :groups => [:test_legacy, :site] if RUBY_VERSION < '2.2.2' From 8a0d44eedce1175c4bae840ad2173fcb2f02b343 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 19 Dec 2016 23:50:16 +0100 Subject: [PATCH 15/84] please Rubocop :robot: - Reorder gems - use double quotes --- Gemfile | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Gemfile b/Gemfile index 378f6b82..2fa70c6e 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ gemspec :name => "jekyll" gem "rake", "~> 11.0" # Dependency of jekyll-mentions. RubyGems in Ruby 2.1 doesn't shield us from this. -gem "activesupport", "~> 4.2", :groups => [:test_legacy, :site] if RUBY_VERSION < '2.2.2' +gem "activesupport", "~> 4.2", :groups => [:test_legacy, :site] if RUBY_VERSION < "2.2.2" group :development do gem "launchy", "~> 2.3" @@ -18,15 +18,15 @@ end # group :test do - gem "rubocop", "~> 0.44.1" + gem "codeclimate-test-reporter", "~> 0.6.0" gem "cucumber", "~> 2.1" gem "jekyll_test_plugin" gem "jekyll_test_plugin_malicious" - gem "codeclimate-test-reporter", "~> 0.6.0" - gem "rspec-mocks" gem "nokogiri" gem "rspec" - gem "test-theme", path: File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__)) + gem "rspec-mocks" + gem "rubocop", "~> 0.44.1" + gem "test-theme", path => File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__)) gem "jruby-openssl" if RUBY_ENGINE == "jruby" end @@ -34,54 +34,54 @@ end # group :test_legacy do - if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2") - gem 'test-unit' + if RUBY_PLATFORM =~ %r!cygwin! || RUBY_VERSION.start_with?("2.2") + gem "test-unit" end - gem "redgreen" - gem "simplecov" - gem "minitest-reporters" - gem "minitest-profile" gem "minitest" + gem "minitest-profile" + gem "minitest-reporters" + gem "redgreen" gem "shoulda" + gem "simplecov" end # group :benchmark do if ENV["BENCHMARK"] - gem "ruby-prof" gem "benchmark-ips" - gem "stackprof" gem "rbtrace" + gem "ruby-prof" + gem "stackprof" end end # group :jekyll_optional_dependencies do - gem "toml", "~> 0.1.0" gem "coderay", "~> 1.1.0" - gem "jekyll-docs", :path => '../docs' if Dir.exist?('../docs') && ENV['JEKYLL_VERSION'] - gem "jekyll-gist" - gem "jekyll-feed" gem "jekyll-coffeescript" - gem "jekyll-redirect-from" + gem "jekyll-docs", :path => "../docs" if Dir.exist?("../docs") && ENV["JEKYLL_VERSION"] + gem "jekyll-feed" + gem "jekyll-gist" gem "jekyll-paginate" - gem "mime-types", "~> 3.0" + gem "jekyll-redirect-from" gem "kramdown", "~> 1.9" + gem "mime-types", "~> 3.0" gem "rdoc", "~> 4.2" + gem "toml", "~> 0.1.0" platform :ruby, :mswin, :mingw, :x64_mingw do - gem "rdiscount", "~> 2.0" - gem "pygments.rb", "~> 0.6.0" - gem "redcarpet", "~> 3.2", ">= 3.2.3" gem "classifier-reborn", "~> 2.0" gem "liquid-c", "~> 3.0" + gem "pygments.rb", "~> 0.6.0" + gem "rdiscount", "~> 2.0" + gem "redcarpet", "~> 3.2", ">= 3.2.3" end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem - gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] + gem "tzinfo-data", :platforms => [:mingw, :mswin, :x64_mingw, :jruby] end # @@ -91,9 +91,9 @@ group :site do gem "html-proofer", "~> 2.0" end - gem "jemoji", "0.5.1" - gem "jekyll-sitemap" - gem "jekyll-seo-tag" gem "jekyll-avatar" gem "jekyll-mentions" + gem "jekyll-seo-tag" + gem "jekyll-sitemap" + gem "jemoji", "0.5.1" end From 00f2fe3abc549cdd3f9675b3a5f18f5ea7293d84 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Tue, 20 Dec 2016 09:27:44 +0100 Subject: [PATCH 16/84] fix typo --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 2fa70c6e..671cb4fd 100644 --- a/Gemfile +++ b/Gemfile @@ -26,7 +26,7 @@ group :test do gem "rspec" gem "rspec-mocks" gem "rubocop", "~> 0.44.1" - gem "test-theme", path => File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__)) + gem "test-theme", :path => File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__)) gem "jruby-openssl" if RUBY_ENGINE == "jruby" end From 6eca7e101a378f669753197bc0ccf26240216954 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 20 Dec 2016 00:38:18 -0800 Subject: [PATCH 17/84] Update history to reflect merge of #5670 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 125dddd3..47b0fef5 100644 --- a/History.markdown +++ b/History.markdown @@ -31,6 +31,7 @@ * Add cucumber feature to test for bonafide theme gems (#5384) * Use `assert_nil` instead of `assert_equal nil` (#5652) * Rubocop -a on lib/jekyll (#5666) + * Bump to rake 12.0 (#5670) ### Documentation From 52c2645abb871dbde190651e8e2396dacb3b60dc Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 20 Dec 2016 02:15:57 -0800 Subject: [PATCH 18/84] Update history to reflect merge of #5671 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 47b0fef5..3bd4af8e 100644 --- a/History.markdown +++ b/History.markdown @@ -32,6 +32,7 @@ * Use `assert_nil` instead of `assert_equal nil` (#5652) * Rubocop -a on lib/jekyll (#5666) * Bump to rake 12.0 (#5670) + * Rubocop Gemfile (#5671) ### Documentation From 704910b297a833cb2e03c433d800d4eaf7e29c7a Mon Sep 17 00:00:00 2001 From: Nursen Date: Fri, 23 Dec 2016 14:08:54 -0800 Subject: [PATCH 19/84] Update windows.md Added an update to installation instructions, as a cert authority change in Ruby causes problems with the prior recommended version of Ruby. --- docs/_docs/windows.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/_docs/windows.md b/docs/_docs/windows.md index ab536382..0426a4de 100644 --- a/docs/_docs/windows.md +++ b/docs/_docs/windows.md @@ -20,6 +20,9 @@ For a more conventional way of installing Jekyll you can follow this [complete g [windows-installjekyll3]: https://labs.sverrirs.com/jekyll/ +\[Update 12/23/2016\]: Updates in the infrastructure of Ruby may cause SLL errors when attemptying to use gem install on a version of ruby older than 2.6. (The ruby package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update ruby using the directions [here.][ssl-certificate-update] +[ssl-certificate-update]: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages + ## Encoding If you use UTF-8 encoding, make sure that no `BOM` header From 467f0a13714e68153161366d4c5fcd27c868fd85 Mon Sep 17 00:00:00 2001 From: Nursen Date: Sat, 24 Dec 2016 01:22:55 -0800 Subject: [PATCH 20/84] Update windows.md revising terminology to avoid ambiguity and moving in relation to alternative install instructions. --- docs/_docs/windows.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_docs/windows.md b/docs/_docs/windows.md index 0426a4de..7d6db10c 100644 --- a/docs/_docs/windows.md +++ b/docs/_docs/windows.md @@ -16,13 +16,13 @@ A quick way to install Jekyll is to follow the [installation instructions by Dav 2. Install Ruby via Chocolatey: `choco install ruby -y` 3. Reopen a command prompt and install Jekyll: `gem install jekyll` +Updates in the infrastructure of Ruby may cause SLL errors when attempting to use `gem install` on a version of the RubyGems package older than 2.6. (The RubyGems package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update the RubyGems package using the directions [here.][ssl-certificate-update] +[ssl-certificate-update]: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages + For a more conventional way of installing Jekyll you can follow this [complete guide to install Jekyll 3 on Windows by Sverrir Sigmundarson][windows-installjekyll3]. [windows-installjekyll3]: https://labs.sverrirs.com/jekyll/ -\[Update 12/23/2016\]: Updates in the infrastructure of Ruby may cause SLL errors when attemptying to use gem install on a version of ruby older than 2.6. (The ruby package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update ruby using the directions [here.][ssl-certificate-update] -[ssl-certificate-update]: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages - ## Encoding If you use UTF-8 encoding, make sure that no `BOM` header From 80d3c7a20495b59dc1cd598065ba337ce6b274d9 Mon Sep 17 00:00:00 2001 From: Nursen Date: Sat, 24 Dec 2016 01:25:03 -0800 Subject: [PATCH 21/84] Update windows.md fixing typo --- docs/_docs/windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/windows.md b/docs/_docs/windows.md index 7d6db10c..514730eb 100644 --- a/docs/_docs/windows.md +++ b/docs/_docs/windows.md @@ -16,7 +16,7 @@ A quick way to install Jekyll is to follow the [installation instructions by Dav 2. Install Ruby via Chocolatey: `choco install ruby -y` 3. Reopen a command prompt and install Jekyll: `gem install jekyll` -Updates in the infrastructure of Ruby may cause SLL errors when attempting to use `gem install` on a version of the RubyGems package older than 2.6. (The RubyGems package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update the RubyGems package using the directions [here.][ssl-certificate-update] +Updates in the infrastructure of Ruby may cause SSL errors when attempting to use `gem install` on a version of the RubyGems package older than 2.6. (The RubyGems package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update the RubyGems package using the directions [here.][ssl-certificate-update] [ssl-certificate-update]: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages For a more conventional way of installing Jekyll you can follow this [complete guide to install Jekyll 3 on Windows by Sverrir Sigmundarson][windows-installjekyll3]. From d442c4fe137a217f838ce3fde7aabce398b2c245 Mon Sep 17 00:00:00 2001 From: Nursen Date: Sat, 24 Dec 2016 02:16:20 -0800 Subject: [PATCH 22/84] Update windows.md --- docs/_docs/windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/windows.md b/docs/_docs/windows.md index 514730eb..8d7bb8bc 100644 --- a/docs/_docs/windows.md +++ b/docs/_docs/windows.md @@ -16,7 +16,7 @@ A quick way to install Jekyll is to follow the [installation instructions by Dav 2. Install Ruby via Chocolatey: `choco install ruby -y` 3. Reopen a command prompt and install Jekyll: `gem install jekyll` -Updates in the infrastructure of Ruby may cause SSL errors when attempting to use `gem install` on a version of the RubyGems package older than 2.6. (The RubyGems package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update the RubyGems package using the directions [here.][ssl-certificate-update] +Updates in the infrastructure of Ruby may cause SSL errors when attempting to use `gem install` with versions of the RubyGems package older than 2.6. (The RubyGems package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update the RubyGems package using the directions [here.][ssl-certificate-update] [ssl-certificate-update]: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages For a more conventional way of installing Jekyll you can follow this [complete guide to install Jekyll 3 on Windows by Sverrir Sigmundarson][windows-installjekyll3]. From 317eae55802e637663bc880b72961a2aff68cd3e Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Sun, 25 Dec 2016 20:31:32 -0800 Subject: [PATCH 23/84] Improve quickstart docs See https://github.com/jekyll/jekyll/pull/5630 for more details on the update. @jekyll/documentation @DirtyF --- docs/_docs/quickstart.md | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/docs/_docs/quickstart.md b/docs/_docs/quickstart.md index 969b5384..c2d0e79d 100644 --- a/docs/_docs/quickstart.md +++ b/docs/_docs/quickstart.md @@ -4,25 +4,37 @@ title: Quick-start guide permalink: /docs/quickstart/ --- -For the impatient, here's how to get a boilerplate Jekyll site up and running. +If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGems](https://rubygems.org/pages/download) installed (see Jekyll's [requirements](/docs/installation/#requirements/)), you can create a new Jekyll site by doing the following: ```sh +# Install Jekyll and Bundler gems through RubyGems ~ $ gem install jekyll bundler + +# Create a new Jekyll site at ./myblog ~ $ jekyll new myblog + +# Change into your new directory ~ $ cd myblog + +# Build the site on the preview server ~/myblog $ bundle exec jekyll serve -# => Now browse to http://localhost:4000 + +# Now browse to http://localhost:4000 ``` -The `jekyll new` command now automatically initiates `bundle install` and installs the dependencies required. To skip this, pass `--skip-bundle` option like so `jekyll new myblog --skip-bundle`. +`gem install jekyll bundler` installs the [jekyll](https://rubygems.org/gems/jekyll/) and [bundler](https://rubygems.org/gems/bundler) gems through [RubyGems](https://rubygems.org/). You need only to install the gems one time — not every time you create a new Jekyll project. Here are some additional details: -If you wish to install jekyll into an existing directory, you can do so by running `jekyll new .` from within the directory instead of creating a new one. If the existing directory isn't empty, you'll also have to pass the `--force` option like so `jekyll new . --force`. +* `bundler` is a gem that manages other Ruby gems. It makes sure your gems and gem versions are compatible, and that you have all necessary dependencies each gem requires. +* The `Gemfile` and `Gemfile.lock` files inform Bundler about the gem requirements in your theme. If your theme doesn't have these Gemfiles, you can omit `bundle exec` and just run `jekyll serve`. -That's nothing, though. The real magic happens when you start creating blog -posts, using the front matter to control templates and layouts, and taking -advantage of all the awesome configuration options Jekyll makes available. +* When you run `bundle exec jekyll serve`, Bundler uses the gems and versions as specified in `Gemfile.lock` to ensure your Jekyll site builds with no compatibility or dependency conflicts. -If you're running into problems, ensure you have all the [requirements -installed][Installation]. +`jekyll new ` installs a new Jekyll site at the path specified (relative to current directory). In this case, Jekyll will be installed in a directory called `myblog`. Here are some additional details: -[Installation]: /docs/installation/ +* To install the Jekyll site into the directory you're currently in, run `jekyll new .` If the existing directory isn't empty, you can pass the `--force` option with `jekyll new . --force`. +* `jekyll new` automatically initiates `bundle install` to install the dependencies required. (If you don't want Bundler to install the gems, use `jekyll new myblog --skip-bundle`.) +* By default, Jekyll installs a gem-based theme called [Minima](https://github.com/jekyll/minima). With gem-based themes, some of the theme directories and files are stored in the gem, hidden from view in your Jekyll project. To better understand themes, see [Themes](../themes). + +## Next steps + +Building the default theme is just the first step. The real magic happens when you start creating blog posts, using the front matter to control templates and layouts, and taking advantage of all the awesome configuration options Jekyll makes available. From 91cd32ca493e26bb2c32959ac239a22790153860 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Sun, 25 Dec 2016 20:35:31 -0800 Subject: [PATCH 24/84] Improve pages docs See https://github.com/jekyll/jekyll/pull/5630 for more details on the update. @jekyll/documentation @DirtyF --- docs/_docs/pages.md | 59 +++++++++++++-------------------------------- 1 file changed, 17 insertions(+), 42 deletions(-) diff --git a/docs/_docs/pages.md b/docs/_docs/pages.md index 15e8f830..258fd6a2 100644 --- a/docs/_docs/pages.md +++ b/docs/_docs/pages.md @@ -4,9 +4,7 @@ title: Creating pages permalink: /docs/pages/ --- -In addition to [writing posts](../posts/), another thing you may want to do -with your Jekyll site is create static pages. By taking advantage of the way -Jekyll copies files and directories, this is easy to do. +In addition to [writing posts](../posts/), you might also want to add static pages (content that isn't date-based) to your Jekyll site. By taking advantage of the way Jekyll copies files and directories, this is easy to do. ## Homepage @@ -28,16 +26,14 @@ homepage of your Jekyll-generated site. ## Where additional pages live Where you put HTML or [Markdown](https://daringfireball.net/projects/markdown/) -files for pages depends on how you want the pages to work. -There are two main ways of creating pages: +files for pages depends on how you want the pages to work. There are two main ways of creating pages: - Place named HTML or [Markdown](https://daringfireball.net/projects/markdown/) files for each page in your site's root folder. -- Create a folder in the site's root for each page, and place an index.html -or index.md file in each page folder. +- Place pages inside folders and subfolders named whatever you want. Both methods work fine (and can be used in conjunction with each other), -with the only real difference being the resulting URLs. +with the only real difference being the resulting URLs. By default, pages retain the same folder structure in `_site` as they do in the source directory. ### Named HTML files @@ -59,42 +55,21 @@ and associated URLs might look like: └── contact.html # => http://example.com/contact.html ``` -### Named folders containing index HTML files +If you have a lot of pages, you can organize those pages into subfolders. The same subfolders that are used to group your pages in our project's source will exist in the `_site` folder when your site builds. -There is nothing wrong with the above method. However, some people like to keep -their URLs free from things like filename extensions. To achieve clean URLs for -pages using Jekyll, you simply need to create a folder for each top-level page -you want, and then place an `index.html` file in each page’s folder. This way -the page URL ends up being the folder name, and the web server will serve up -the respective `index.html` file. Here's an example of what this structure -might look like: +## Flattening pages from subfolders into the root directory -```sh -. -├── _config.yml -├── _includes/ -├── _layouts/ -├── _posts/ -├── _site/ -├── about/ -| └── index.html # => http://example.com/about/ -├── contact/ -| └── index.html # => http://example.com/contact/ -|── other/ -| └── index.md # => http://example.com/other/ -└── index.html # => http://example.com/ +If you have pages organized into subfolders in your source folder and want to flatten them in the root folder on build, you must add the [permalink]({% link _docs/permalinks.md %}) property directly in your page's front matter like this: + +``` +--- +title: My page +permalink: mypageurl.html +--- ``` -This approach may not suit everyone, but for people who like clean URLs it’s -simple and it works. In the end, the decision is yours! +### Named folders containing index HTML files -
-
ProTip™: Use permalink Front Matter Variable
-

- Clean URLs can also be achieved using the permalink front - matter variable. In the example above, using the first method, you can - get URL http://example.com/other for the file - other.md by setting this at the top of the file: - permalink: /other -

-
+If you don't want file extensions (`.html`) to appear in your page URLs (file extensions are the default), you can choose a [permalink style](../permalinks/#builtinpermalinkstyles) that has a trailing slash instead of a file extension. + +Note if you want to view your site offline *without the Jekyll preview server*, your browser will need the file extension to display the page, and all assets will need to be relative links that function without the server baseurl. From 93cd0cdb503694670db5f9c7e25e54ca7a3b0722 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Sun, 25 Dec 2016 20:36:25 -0800 Subject: [PATCH 25/84] Improve permalinks docs See https://github.com/jekyll/jekyll/pull/5630 for more details on the update. @jekyll/documentation @DirtyF --- docs/_docs/permalinks.md | 190 +++++++++++++++++++++++++-------------- 1 file changed, 122 insertions(+), 68 deletions(-) diff --git a/docs/_docs/permalinks.md b/docs/_docs/permalinks.md index 31eeb30b..d41d6162 100644 --- a/docs/_docs/permalinks.md +++ b/docs/_docs/permalinks.md @@ -4,27 +4,62 @@ title: Permalinks permalink: /docs/permalinks/ --- -Jekyll supports a flexible way to build your site’s URLs. You can specify the -permalinks for your site through the [Configuration](../configuration/) or in -the [YAML Front Matter](../frontmatter/) for each post. You’re free to choose -one of the built-in styles to create your links or craft your own. The default -style is `date`. +Jekyll supports a flexible way to build the permalinks for your pages, posts, and collections. A permalink is the URL for the page, post, or collection (excluding the domain name or directory folder). -Permalinks are constructed by creating a template URL where dynamic elements -are represented by colon-prefixed keywords. For example, the default `date` -permalink is defined according to the format `/:categories/:year/:month/:day/:title.html`. +You construct permalinks by creating a template URL where dynamic elements are represented by colon-prefixed keywords. The default template permalink is `/:categories/:year/:month/:day/:title.html`. Each of the colon-prefixed keywords is a template variable. +You’re free to construct your own permalink style using the available template variables or choose one of the built-in permalink styles (such as `date`) that automatically use a template-variable pattern. + +## Where to configure permalinks + +You can configure your site's permalinks through the [Configuration]({% link _docs/configuration.md %}) file or in the [Front Matter]({% link _docs/frontmatter.md %}) for each post, page, or collection. + +Setting permalink styles in your configuration file applies the setting globally in your project. You configure permalinks in your `_config.yml` file like this: + +```yaml +permalink: /:categories/:year/:month/:day/:title.html +``` + +If you don't specify any permalink setting, Jekyll uses the above pattern as the default. + +The permalink can also be set using a built-in permalink style: + +```yaml +permalink: date +``` + +`date` is the same as `:categories/:year/:month/:day/:title.html`, the default. See [Built-in Permalink Styles](#builtinpermalinkstyles) below for more options. + +Setting the permalink in your post, page, or collection's front matter overrides any global settings. Here's an example: + +```yaml +--- +title: My page title +permalink: /mypageurl/ +--- +``` + +Even if your configuration file specifies the `date` style, the URL for this page would be `http://somedomain.com/mypageurl/`. + +{% comment %}this note needs clarification
-
Specifying permalinks through the YAML Front Matter
-

- Built-in permalink styles are not recognized in YAML Front Matter. So - permalink: pretty will not work, but the equivalent - /:categories/:year/:month/:day/:title/ - using template variables will. -

+
Specifying permalinks through the YAML Front Matter
+

Built-in permalink styles are not recognized in YAML Front Matter. As a result, permalink: pretty will not work, but the equivalent /:categories/:year/:month/:day/:title/ using template variables will.

+{% endcomment %} -## Template variables +When you use permalinks that omit the `.html` file extension (called "clean URLs") Jekyll builds the file as index.html placed inside a folder with the page's name. For example: + +``` +├── mypageurl +│   └── index.html +``` + +Servers automatically load the index.html file inside of any folder, so users can simply navigate to `http://somedomain.com/mypageurl` to get to `mypageurl/index.html`. + +## Template variables for permalinks {#template-variables} + +The following table lists the template variables available for permalinks. You can use these variables in the `permalink` property in your config file.
@@ -40,7 +75,7 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti

year

@@ -48,7 +83,7 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti

month

@@ -56,7 +91,7 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti

i_month

@@ -64,7 +99,7 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti

day

@@ -72,7 +107,7 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti

i_day

@@ -80,7 +115,7 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti

short_year

@@ -89,7 +124,7 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti @@ -99,7 +134,7 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti @@ -109,7 +144,7 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti @@ -130,8 +165,8 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti @@ -142,7 +177,7 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti
-

Year from the Post’s filename

+

Year from the post's filename

-

Month from the Post’s filename

+

Month from the post's filename

-

Month from the Post’s filename without leading zeros.

+

Month from the post's filename without leading zeros.

-

Day from the Post’s filename

+

Day from the post's filename

-

Day from the Post’s filename without leading zeros.

+

Day from the post's filename without leading zeros.

-

Year from the Post’s filename without the century.

+

Year from the post's filename without the century.

- Hour of the day, 24-hour clock, zero-padded from the post’s date front matter. (00..23) + Hour of the day, 24-hour clock, zero-padded from the post's date front matter. (00..23)

- Minute of the hour from the post’s date front matter. (00..59) + Minute of the hour from the post's date front matter. (00..59)

- Second of the minute from the post’s date front matter. (00..59) + Second of the minute from the post's date front matter. (00..59)

- Slugified title from the document’s filename ( any character - except numbers and letters is replaced as hyphen ). May be + Slugified title from the document’s filename (any character + except numbers and letters is replaced as hyphen). May be overridden via the document’s slug YAML front matter.

- The specified categories for this Post. If a post has multiple + The specified categories for this post. If a post has multiple categories, Jekyll will create a hierarchy (e.g. /category1/category2). Also Jekyll automatically parses out double slashes in the URLs, so if no categories are present, it will ignore this. @@ -153,10 +188,11 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti

-## Built-in permalink styles +Note that all template variables relating to time or categories are available to posts only. -While you can specify a custom permalink style using [template variables](#template-variables), -Jekyll also provides the following built-in styles for convenience. +## Built-in permalink styles {#builtinpermalinkstyles} + +Although you can specify a custom permalink pattern using [template variables](#template-variables), Jekyll also provides the following built-in styles for convenience.
@@ -203,26 +239,11 @@ Jekyll also provides the following built-in styles for convenience.
-## Pages and collections +Rather than typing `permalink: /:categories/:year/:month/:day/:title/`, you can just type `permalink: date`. -The `permalink` configuration setting specifies the permalink style used for -posts. Pages and collections each have their own default permalink style; the -default style for pages is `/:path/:basename` and the default for collections is -`/:collection/:path`. +## Permalink style examples with posts {#permalink-style-examples} -These styles are modified to match the suffix style specified in the post -permalink setting. For example, a permalink style of `pretty`, which contains a -trailing slash, will update page permalinks to also contain a trailing slash: -`/:path/:basename/`. A permalink style of `date`, which contains a trailing -file extension, will update page permalinks to also contain a file extension: -`/:path/:basename:output_ext`. The same is true for any custom permalink style. - -The permalink for an individual page or collection document can always be -overridden in the [YAML Front Matter](../frontmatter/) for the page or document. -Additionally, permalinks for a given collection can be customized [in the -collections configuration](../collections/). - -## Permalink style examples +Here are a few examples to clarify how permalink styles get applied with posts. Given a post named: `/2009-04-29-slap-chop.md` @@ -280,24 +301,58 @@ Given a post named: `/2009-04-29-slap-chop.md`
-## Extensionless permalinks +## Permalink settings for pages and collections {#pages-and-collections} -Jekyll supports permalinks that contain neither a trailing slash nor a file -extension, but this requires additional support from the web server to properly -serve. When using extensionless permalinks, output files written to disk will -still have the proper file extension (typically `.html`), so the web server -must be able to map requests without file extensions to these files. +The permalink setting in your configuration file specifies the permalink style used for posts, pages, and collections. However, because pages and collections don't have time or categories, these aspects of the permalink style are ignored with pages and collections. -Both [GitHub Pages](../github-pages/) and the Jekyll's built-in WEBrick server -handle these requests properly without any additional work. +For example: + +* A permalink style of `/:categories/:year/:month/:day/:title.html` for posts becomes `/:title.html` for pages and collections. +* A permalink style of `pretty` (or `/:categories/:year/:month/:day/:title/`), which omits the file extension and contains a trailing slash, will update page and collection permalinks to also omit the file extension and contain a trailing slash: `/:title/`. +* A permalink style of `date`, which contains a trailing file extension, will update page permalinks to also contain a trailing file extension: `/:title.html`. But no time or category information will be included. + +## Permalinks and default paths + +The path to the post or page in the built site differs for posts, pages, and collections: + +### Posts + +No matter how many subfolders you organize your posts into inside the `_posts` folder, all posts are pulled out of those subfolders and flattened into the `_site`'s root directory upon build. + +If you use a permalink style that omits the `.html` file extension, each post is rendered as an `index.html` file inside a folder with the post's name (for example, `categoryname/2016/12/01/mypostname/index.html`). + +### Pages + +Unlike posts, pages are *not* removed from their subfolder directories when you build your site. Pages remain in the same folder structure in which you organized your pages in the source directory, except that the structure is now mirrored in `_site`. (The only exception is if your page has a `permalink` declared its front matter — in that case, the structure honors the permalink setting instead of the source folder structure.) + +As with posts, if you use a permalink style that omits the `.html` file extension, each page is rendered as an `index.html` file inserted inside a folder with the page's name (for example, `mypage/index.html`). + +### Collections + +By default, collections follow a similar structure in the `_site` folder as pages, except that the path is prefaced by the collection name. For example: `collectionname/mypage.html`. For permalink settings that omit the file extension, the path would be `collection_name/mypage/index.html`. + +Collections have their own way of setting permalinks. Additionally, collections have unique template variables available available (such as `path` and `output_ext`). See the [Configuring permalinks for collections]( ../collections#permalinks ) in Collections for more information. + +## Flattening pages in \_site on build + +If you want to flatten your pages (pull them out of subfolders) in the `_site` directory when your site builds (similar to posts), add the permalink property of each page's front matter: + +``` +--- +title: My page +permalink: mypageurl.html +--- +``` + +## Extensionless permalinks with no trailing slashes {#extensionless-permalinks} + +Jekyll supports permalinks that contain neither a trailing slash nor a file extension, but this requires additional support from the web server to properly serve. When using extensionless permalinks, output files written to disk will still have the proper file extension (typically `.html`), so the web server must be able to map requests without file extensions to these files. + +Both [GitHub Pages](../github-pages/) and the Jekyll's built-in WEBrick server handle these requests properly without any additional work. ### Apache -The Apache web server has very extensive support for content negotiation and can -handle extensionless URLs by setting the [multiviews][] option in your -`httpd.conf` or `.htaccess` file: - -[multiviews]: https://httpd.apache.org/docs/current/content-negotiation.html#multiviews +The Apache web server has extensive support for content negotiation and can handle extensionless URLs by setting the [multiviews](https://httpd.apache.org/docs/current/content-negotiation.html#multiviews) option in your `httpd.conf` or `.htaccess` file: {% highlight apache %} Options +MultiViews @@ -305,13 +360,12 @@ Options +MultiViews ### Nginx -The [try_files][] directive allows you to specify a list of files to search for -to process a request. The following configuration will instruct nginx to search -for a file with an `.html` extension if an exact match for the requested URI is -not found. - -[try_files]: http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files +The [try_files](http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files) directive allows you to specify a list of files to search for to process a request. The following configuration will instruct nginx to search for a file with an `.html` extension if an exact match for the requested URI is not found. {% highlight nginx %} try_files $uri $uri.html $uri/ =404; {% endhighlight %} + +## Linking without regard to permalink styles + +You can create links in your topics to other posts, pages, or collection items in a way that is valid no matter what permalink configuration you choose. By using the `link` tag, if you change your permalinks, your links won't break. See [Linking to pages](../templates#link) for more details. From 2d0df85b93f767a12059a5fb0402d36e6e3c0b81 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Sun, 25 Dec 2016 20:42:16 -0800 Subject: [PATCH 26/84] Add includes link to doc nav I created more advanced details about includes and created a new page for it instead of putting all the info on the templates page. See https://github.com/jekyll/jekyll/pull/5630 for more details on the update. @jekyll/documentation @DirtyF --- docs/_data/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_data/docs.yml b/docs/_data/docs.yml index 4ff28ba2..cb24042e 100644 --- a/docs/_data/docs.yml +++ b/docs/_data/docs.yml @@ -19,6 +19,7 @@ - datafiles - assets - migrations + - includes - title: Customization docs: From 503420a9b45e36cbf718ddc0069dba0f64858fee Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Sun, 25 Dec 2016 20:44:35 -0800 Subject: [PATCH 27/84] Added new includes.md topic to docs Added new includes.md topic. See https://github.com/jekyll/jekyll/pull/5630 for more details on the update. @jekyll/documentation @DirtyF --- docs/_docs/includes.md | 175 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 docs/_docs/includes.md diff --git a/docs/_docs/includes.md b/docs/_docs/includes.md new file mode 100644 index 00000000..dceece77 --- /dev/null +++ b/docs/_docs/includes.md @@ -0,0 +1,175 @@ +--- +layout: docs +title: Includes +permalink: /docs/includes/ +--- + +The `include` tag allows you to include the content from another file stored in the `_includes` folder: + +```liquid +{% raw %}{% include footer.html %}{% endraw %} +``` + +Jekyll will look for the referenced file (in this case, `footer.html`) in the `_includes` directory at the root of your source directory and insert its contents. + +### Including files relative to another file + +You can choose to include file fragments relative to the current file by using the `include_relative` tag: + +```liquid +{% raw %}{% include_relative somedir/footer.html %}{% endraw %} +``` + +You won't need to place your included content within the `_includes` directory. Instead, +the inclusion is specifically relative to the file where the tag is being used. For example, +if `_posts/2014-09-03-my-file.markdown` uses the `include_relative` tag, the included file +must be within the `_posts` directory or one of its subdirectories. + +Note that you cannot use the `../` syntax to specify an include location that refers to a higher-level directory. + +All the other capabilities of the `include` tag are available to the `include_relative` tag, +such as variables. + +### Using variables names for the include file + +The name of the file you want to embed can be specified as a variable instead of an actual file name. For example, suppose you defined a variable in your page's frontmatter like this: + +```yaml +--- +title: My page +my_variable: footer_company_a.html +--- +``` + +You could then reference that variable in your include: + +```liquid +{% raw %}{% include {{page.my_variable}} %}{% endraw %} +``` + +In this example, the include would insert the file `footer_company_a.html` from the `_includes/footer_company_a.html` directory. + +### Passing parameters to includes + +You can also pass parameters to an include. For example, suppose you have a file called `note.html` in your `_includes` folder that contains this formatting: + +```liquid +{% raw %}{% endraw %} +``` + +The {% raw %}`{{include.content}}`{% endraw %} is a parameter gets populated when you call the include and specify a value for that parameter, like this: + +```liquid +{% raw %}{% include note.html content="This is my sample note." %} {% endraw %} +``` + +The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{include.content}}`{% endraw %} parameter. + +Passing parameters to includes is especially helpful when you want to hide away complex formatting from your Markdown content. + +For example, suppose you have a special image syntax with complex formatting, and you don't want your authors to remember the complex formatting. As a result, you decide to simplify the formatting by using an include with parameters. Here's an example of the special image syntax you want to populate with an include: + +```html +
Jekyll logo
+This is the Jekyll logo
+``` + +You could templatize this content in your include and make each value available as a parameter, like this: + +```liquid +{% raw %}
{{include.caption}} +
{% endraw %} +``` + +This include contains 5 parameters: + +* `url` +* `max-width` +* `file` +* `alt` +* `caption` + +You could also use `if` tags to safeguard scenarios where either the parameter is optional or where the author doesn't include the parameter: + +```liquid +{% raw %}
{% if {{include.url}} %} +{% endif %}{% if {{include.url}} %}{% endif %} +{% if {{include.caption}} %}
{{include.caption}} +
{% endif %}
{% endraw %} +``` + +In this example, `{% raw %}if {{include.url}}{% endraw %}` will include the `url` only if the `url` parameter is specified in the include. You could also create default values using [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). + +Here's an example that passes all the parameters to this include (the include file is named `image.html`): + +```liquid +{% raw %}{% include image.html url="http://jekyllrb.com" +max-width="200px" file="logo.png" alt="Jekyll logo" +caption="This is the Jekyll logo." %} {% endraw %} +``` + +The result is the original HTML code shown earlier. + +You can create includes that act as templates for a variety of uses — inserting audio or video clips, alerts, special formatting, and more. + +However, note that you should avoid using too many includes, as this will slow down the build time of your site. For example, don't use includes every time you insert an image. (The above technique shows a use case for special images.) + +### Passing parameter variables to includes + +Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{site.product_name}}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) + +The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{site.product_name}} is now available."`{% endraw %} + +If you want to include this variable in your parameter that you pass to an include, you need to store the entire parameter as a variable before passing it to the include. You can use `capture` tags to create the variable: + +```liquid +{% raw %}{% capture download_note %}The latest version of +{{site.product_name}} is now available.{% endcapture %}{% endraw %} +``` + +Then pass this captured variable into the parameter for the include. Omit the quotation marks around the parameter content because it's no longer a string (it's a variable): + +```liquid +{% raw %}{% include note.html content=download_note %}{% endraw %} +``` + +### Passing references to YAML files as parameter values + +Instead of passing string variables to the include, you can pass a reference to a YAML data file stored in the `_data` folder. + +Here's an example. In the `_data` folder, suppose you have a YAML file called `profiles.yml`. Its content looks like this: + +```yaml +- name: John Doe + login_age: old + image: johndoe.jpg + +- name: Jane Doe + login_age: new + image: janedoe.jpg +``` + +In the `_includes` folder, assume you have a file called `spotlight.html` with this code: + +```liquid +{% raw %}{% for person in {{include.participants}} %} +{% if person.login_age == "new" %} +{{person.name}} +{% endif %} +{% endfor %}{% endraw %} +``` + +Now when you insert the `spotlight.html` include file, you can submit the YAML file as a parameter: + +``` +{% raw %}{% include spotlight.html participants=site.data.profiles %}{% endraw %} +``` + +In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{include.participants}}`{% endraw %} in the include, and the Liquid logic processes. The result will be `Jane Doe`. From 31de9ea484e996188a9407a416e236f7e0b4f2a6 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Mon, 26 Dec 2016 18:28:27 -0800 Subject: [PATCH 28/84] made requested updates - made `{{ }}` formatting more readable by adding spacing. - added formatting to code samples to properly reflect line breaks for readability --- docs/_docs/includes.md | 57 ++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/docs/_docs/includes.md b/docs/_docs/includes.md index dceece77..3a0b819d 100644 --- a/docs/_docs/includes.md +++ b/docs/_docs/includes.md @@ -44,7 +44,7 @@ my_variable: footer_company_a.html You could then reference that variable in your include: ```liquid -{% raw %}{% include {{page.my_variable}} %}{% endraw %} +{% raw %}{% include {{ page.my_variable }} %}{% endraw %} ``` In this example, the include would insert the file `footer_company_a.html` from the `_includes/footer_company_a.html` directory. @@ -55,35 +55,41 @@ You can also pass parameters to an include. For example, suppose you have a file ```liquid {% raw %}{% endraw %} ``` -The {% raw %}`{{include.content}}`{% endraw %} is a parameter gets populated when you call the include and specify a value for that parameter, like this: +The `{% raw %}{{ include.content }}{% endraw %}` is a parameter gets populated when you call the include and specify a value for that parameter, like this: ```liquid {% raw %}{% include note.html content="This is my sample note." %} {% endraw %} ``` -The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{include.content}}`{% endraw %} parameter. +The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{ include.content }}`{% endraw %} parameter. Passing parameters to includes is especially helpful when you want to hide away complex formatting from your Markdown content. For example, suppose you have a special image syntax with complex formatting, and you don't want your authors to remember the complex formatting. As a result, you decide to simplify the formatting by using an include with parameters. Here's an example of the special image syntax you want to populate with an include: ```html -
Jekyll logo
-This is the Jekyll logo
+
+ + Jekyll logo +
This is the Jekyll logo
+
``` You could templatize this content in your include and make each value available as a parameter, like this: ```liquid -{% raw %}
{{include.caption}} -
{% endraw %} +{% raw %}
+ + {{ include.alt }} +
{{ include.caption }}
+
{% endraw %} ``` This include contains 5 parameters: @@ -97,15 +103,18 @@ This include contains 5 parameters: You could also use `if` tags to safeguard scenarios where either the parameter is optional or where the author doesn't include the parameter: ```liquid -{% raw %}
{% if {{include.url}} %} -{% endif %}{% if {{include.url}} %}{% endif %} -{% if {{include.caption}} %}
{{include.caption}} -
{% endif %}
{% endraw %} +{% raw %}
+ {% if {{ include.url }} %}{% endif %} + {{ include.alt }}{% if {{ include.url }} %}{% endif %} + {% if {{ include.caption }} %} +
{{ include.caption }}
+ {% endif %} +
{% endraw %} ``` -In this example, `{% raw %}if {{include.url}}{% endraw %}` will include the `url` only if the `url` parameter is specified in the include. You could also create default values using [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). +In this example, `{% raw %}if {{ include.url }}{% endraw %}` will include the `url` only if the `url` parameter is specified in the include. You could also create default values using [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). Here's an example that passes all the parameters to this include (the include file is named `image.html`): @@ -123,15 +132,15 @@ However, note that you should avoid using too many includes, as this will slow d ### Passing parameter variables to includes -Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{site.product_name}}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) +Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{ site.product_name }}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) -The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{site.product_name}} is now available."`{% endraw %} +The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{ site.product_name }} is now available."`{% endraw %} If you want to include this variable in your parameter that you pass to an include, you need to store the entire parameter as a variable before passing it to the include. You can use `capture` tags to create the variable: ```liquid {% raw %}{% capture download_note %}The latest version of -{{site.product_name}} is now available.{% endcapture %}{% endraw %} +{{ site.product_name }} is now available.{% endcapture %}{% endraw %} ``` Then pass this captured variable into the parameter for the include. Omit the quotation marks around the parameter content because it's no longer a string (it's a variable): @@ -159,9 +168,9 @@ Here's an example. In the `_data` folder, suppose you have a YAML file called `p In the `_includes` folder, assume you have a file called `spotlight.html` with this code: ```liquid -{% raw %}{% for person in {{include.participants}} %} +{% raw %}{% for person in {{ include.participants }} %} {% if person.login_age == "new" %} -{{person.name}} +{{ person.name }} {% endif %} {% endfor %}{% endraw %} ``` @@ -172,4 +181,4 @@ Now when you insert the `spotlight.html` include file, you can submit the YAML f {% raw %}{% include spotlight.html participants=site.data.profiles %}{% endraw %} ``` -In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{include.participants}}`{% endraw %} in the include, and the Liquid logic processes. The result will be `Jane Doe`. +In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{ include.participants }}`{% endraw %} in the include, and the Liquid logic processes. The result will be `Jane Doe`. From 488ec5489c1efc69547ad86e7d93feaf2a6d3c50 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Mon, 26 Dec 2016 18:36:39 -0800 Subject: [PATCH 29/84] moved includes to appear after templates made update based on review. moved includes topic after templates in nav list. --- docs/_data/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_data/docs.yml b/docs/_data/docs.yml index cb24042e..bb9d3b14 100644 --- a/docs/_data/docs.yml +++ b/docs/_data/docs.yml @@ -19,11 +19,11 @@ - datafiles - assets - migrations - - includes - title: Customization docs: - templates + - includes - permalinks - pagination - plugins From 190ea160e50b0e6427212795bc5d38ee7c53075e Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Mon, 26 Dec 2016 20:40:07 -0800 Subject: [PATCH 30/84] Made updates as requested by reviewers Made requested updates. --- docs/_docs/quickstart.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/_docs/quickstart.md b/docs/_docs/quickstart.md index c2d0e79d..3a57ef87 100644 --- a/docs/_docs/quickstart.md +++ b/docs/_docs/quickstart.md @@ -22,6 +22,8 @@ If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGem # Now browse to http://localhost:4000 ``` +## About bundler + `gem install jekyll bundler` installs the [jekyll](https://rubygems.org/gems/jekyll/) and [bundler](https://rubygems.org/gems/bundler) gems through [RubyGems](https://rubygems.org/). You need only to install the gems one time — not every time you create a new Jekyll project. Here are some additional details: * `bundler` is a gem that manages other Ruby gems. It makes sure your gems and gem versions are compatible, and that you have all necessary dependencies each gem requires. @@ -29,12 +31,14 @@ If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGem * When you run `bundle exec jekyll serve`, Bundler uses the gems and versions as specified in `Gemfile.lock` to ensure your Jekyll site builds with no compatibility or dependency conflicts. +## Jekyll new options + `jekyll new ` installs a new Jekyll site at the path specified (relative to current directory). In this case, Jekyll will be installed in a directory called `myblog`. Here are some additional details: * To install the Jekyll site into the directory you're currently in, run `jekyll new .` If the existing directory isn't empty, you can pass the `--force` option with `jekyll new . --force`. * `jekyll new` automatically initiates `bundle install` to install the dependencies required. (If you don't want Bundler to install the gems, use `jekyll new myblog --skip-bundle`.) -* By default, Jekyll installs a gem-based theme called [Minima](https://github.com/jekyll/minima). With gem-based themes, some of the theme directories and files are stored in the gem, hidden from view in your Jekyll project. To better understand themes, see [Themes](../themes). +* By default, the Jekyll site installed by `jekyll new` uses a gem-based theme called [Minima](https://github.com/jekyll/minima). With [gem-based themes](../themes), some of the directories and files are stored in the theme-gem, hidden from your immediate view. ## Next steps -Building the default theme is just the first step. The real magic happens when you start creating blog posts, using the front matter to control templates and layouts, and taking advantage of all the awesome configuration options Jekyll makes available. +Building a Jekyll site with the default theme is just the first step. The real magic happens when you start creating blog posts, using the front matter to control templates and layouts, and taking advantage of all the awesome configuration options Jekyll makes available. From f18363ea1383cb6b2791464c44cb06f7b4020212 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Tue, 27 Dec 2016 11:03:23 -0800 Subject: [PATCH 31/84] Updated to remove spacing from include variables It turns out Liquid throws an error when you write `{% if {{ include.url }} %}` instead of `{% if {{include.url}} %}`. I updated the examples here to omit the spacing. To avoid inconsistency, I just omitted the spacing from all curly braces. Also added a note explaining the issue and put the blame on Liquid. --- docs/_docs/includes.md | 46 ++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/docs/_docs/includes.md b/docs/_docs/includes.md index 3a0b819d..1a60ce0d 100644 --- a/docs/_docs/includes.md +++ b/docs/_docs/includes.md @@ -32,7 +32,7 @@ such as variables. ### Using variables names for the include file -The name of the file you want to embed can be specified as a variable instead of an actual file name. For example, suppose you defined a variable in your page's frontmatter like this: +The name of the file you want to embed can be specified as a variable instead of an actual file name. For example, suppose you defined a variable in your page's front matter like this: ```yaml --- @@ -44,7 +44,7 @@ my_variable: footer_company_a.html You could then reference that variable in your include: ```liquid -{% raw %}{% include {{ page.my_variable }} %}{% endraw %} +{% raw %}{% include {{page.my_variable}} %}{% endraw %} ``` In this example, the include would insert the file `footer_company_a.html` from the `_includes/footer_company_a.html` directory. @@ -56,17 +56,17 @@ You can also pass parameters to an include. For example, suppose you have a file ```liquid {% raw %}{% endraw %} ``` -The `{% raw %}{{ include.content }}{% endraw %}` is a parameter gets populated when you call the include and specify a value for that parameter, like this: +The `{% raw %}{{include.content}}{% endraw %}` is a parameter that gets populated when you call the include and specify a value for that parameter, like this: ```liquid {% raw %}{% include note.html content="This is my sample note." %} {% endraw %} ``` -The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{ include.content }}`{% endraw %} parameter. +The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{include.content}}`{% endraw %} parameter. Passing parameters to includes is especially helpful when you want to hide away complex formatting from your Markdown content. @@ -85,10 +85,10 @@ You could templatize this content in your include and make each value available ```liquid {% raw %}
- - {{ include.alt }} -
{{ include.caption }}
+
+ {{include.alt}} +
{{include.caption}}
{% endraw %} ``` @@ -104,17 +104,17 @@ You could also use `if` tags to safeguard scenarios where either the parameter i ```liquid {% raw %}
- {% if {{ include.url }} %}{% endif %} - {{ include.alt }}{% if {{ include.url }} %}{% endif %} - {% if {{ include.caption }} %} -
{{ include.caption }}
+ {% if {{include.url}} %}{% endif %} + {{include.alt}}{% if {{include.url}} %}{% endif %} + {% if {{include.caption}} %} +
{{include.caption}}
{% endif %}
{% endraw %} ``` -In this example, `{% raw %}if {{ include.url }}{% endraw %}` will include the `url` only if the `url` parameter is specified in the include. You could also create default values using [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). +In this example, `{% raw %}if {{include.url}}{% endraw %}` will include the `url` only if the `url` parameter is specified in the include. You could also create default values using [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). Here's an example that passes all the parameters to this include (the include file is named `image.html`): @@ -130,17 +130,19 @@ You can create includes that act as templates for a variety of uses — inse However, note that you should avoid using too many includes, as this will slow down the build time of your site. For example, don't use includes every time you insert an image. (The above technique shows a use case for special images.) +Additionally, if you have a include variable inside an `if` statement, such as `{% raw %}{% if {{include.url}} %}{% endraw %}`, don't use spaces inside the curly braces. For example, avoid this syntax: `{% raw %}{% if {{ include.url }} %}{% endraw %}`. Liquid will consider this extra spacing an error. (Outside of `if` statements, the spacing for include variables doesn't matter.) + ### Passing parameter variables to includes -Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{ site.product_name }}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) +Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{site.product_name}}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) -The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{ site.product_name }} is now available."`{% endraw %} +The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{site.product_name}} is now available."`{% endraw %} If you want to include this variable in your parameter that you pass to an include, you need to store the entire parameter as a variable before passing it to the include. You can use `capture` tags to create the variable: ```liquid {% raw %}{% capture download_note %}The latest version of -{{ site.product_name }} is now available.{% endcapture %}{% endraw %} +{{site.product_name}} is now available.{% endcapture %}{% endraw %} ``` Then pass this captured variable into the parameter for the include. Omit the quotation marks around the parameter content because it's no longer a string (it's a variable): @@ -168,9 +170,9 @@ Here's an example. In the `_data` folder, suppose you have a YAML file called `p In the `_includes` folder, assume you have a file called `spotlight.html` with this code: ```liquid -{% raw %}{% for person in {{ include.participants }} %} +{% raw %}{% for person in {{include.participants}} %} {% if person.login_age == "new" %} -{{ person.name }} +{{person.name}} {% endif %} {% endfor %}{% endraw %} ``` @@ -181,4 +183,4 @@ Now when you insert the `spotlight.html` include file, you can submit the YAML f {% raw %}{% include spotlight.html participants=site.data.profiles %}{% endraw %} ``` -In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{ include.participants }}`{% endraw %} in the include, and the Liquid logic processes. The result will be `Jane Doe`. +In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{include.participants}}`{% endraw %} in the include, and the Liquid logic processes. The result will be `Jane Doe`. From 56ae6ed571aec6f10aefae44442d879261f31cc8 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Tue, 27 Dec 2016 21:39:56 -0800 Subject: [PATCH 32/84] Removed erroneous liquid code, added back spacing - removed erroneous liquid code with conditional include parameters - added back spacing in {{ }} tags --- docs/_docs/includes.md | 52 ++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 35 deletions(-) diff --git a/docs/_docs/includes.md b/docs/_docs/includes.md index 1a60ce0d..94c56894 100644 --- a/docs/_docs/includes.md +++ b/docs/_docs/includes.md @@ -44,7 +44,7 @@ my_variable: footer_company_a.html You could then reference that variable in your include: ```liquid -{% raw %}{% include {{page.my_variable}} %}{% endraw %} +{% raw %}{% include {{ page.my_variable }} %}{% endraw %} ``` In this example, the include would insert the file `footer_company_a.html` from the `_includes/footer_company_a.html` directory. @@ -56,21 +56,21 @@ You can also pass parameters to an include. For example, suppose you have a file ```liquid {% raw %}{% endraw %} ``` -The `{% raw %}{{include.content}}{% endraw %}` is a parameter that gets populated when you call the include and specify a value for that parameter, like this: +The `{% raw %}{{ include.content }}{% endraw %}` is a parameter that gets populated when you call the include and specify a value for that parameter, like this: ```liquid {% raw %}{% include note.html content="This is my sample note." %} {% endraw %} ``` -The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{include.content}}`{% endraw %} parameter. +The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{ include.content }}`{% endraw %} parameter. Passing parameters to includes is especially helpful when you want to hide away complex formatting from your Markdown content. -For example, suppose you have a special image syntax with complex formatting, and you don't want your authors to remember the complex formatting. As a result, you decide to simplify the formatting by using an include with parameters. Here's an example of the special image syntax you want to populate with an include: +For example, suppose you have a special image syntax with complex formatting, and you don't want your authors to remember the complex formatting. As a result, you decide to simplify the formatting by using an include with parameters. Here's an example of the special image syntax you might want to populate with an include: ```html
@@ -85,10 +85,10 @@ You could templatize this content in your include and make each value available ```liquid {% raw %}
- - {{include.alt}} -
{{include.caption}}
+
+ {{ include.alt }} +
{{ include.caption }}
{% endraw %} ``` @@ -100,22 +100,6 @@ This include contains 5 parameters: * `alt` * `caption` -You could also use `if` tags to safeguard scenarios where either the parameter is optional or where the author doesn't include the parameter: - -```liquid -{% raw %}
- {% if {{include.url}} %}{% endif %} - {{include.alt}}{% if {{include.url}} %}{% endif %} - {% if {{include.caption}} %} -
{{include.caption}}
- {% endif %} -
{% endraw %} -``` - -In this example, `{% raw %}if {{include.url}}{% endraw %}` will include the `url` only if the `url` parameter is specified in the include. You could also create default values using [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). - Here's an example that passes all the parameters to this include (the include file is named `image.html`): ```liquid @@ -126,23 +110,21 @@ caption="This is the Jekyll logo." %} {% endraw %} The result is the original HTML code shown earlier. -You can create includes that act as templates for a variety of uses — inserting audio or video clips, alerts, special formatting, and more. +To safeguard situations where users don't supply a value for the parameter, you can use [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). -However, note that you should avoid using too many includes, as this will slow down the build time of your site. For example, don't use includes every time you insert an image. (The above technique shows a use case for special images.) - -Additionally, if you have a include variable inside an `if` statement, such as `{% raw %}{% if {{include.url}} %}{% endraw %}`, don't use spaces inside the curly braces. For example, avoid this syntax: `{% raw %}{% if {{ include.url }} %}{% endraw %}`. Liquid will consider this extra spacing an error. (Outside of `if` statements, the spacing for include variables doesn't matter.) +Overall, you can create includes that act as templates for a variety of uses — inserting audio or video clips, alerts, special formatting, and more. However, note that you should avoid using too many includes, as this will slow down the build time of your site. For example, don't use includes every time you insert an image. (The above technique shows a use case for special images.) ### Passing parameter variables to includes -Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{site.product_name}}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) +Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{ site.product_name }}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) -The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{site.product_name}} is now available."`{% endraw %} +The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{ site.product_name }} is now available."`{% endraw %} If you want to include this variable in your parameter that you pass to an include, you need to store the entire parameter as a variable before passing it to the include. You can use `capture` tags to create the variable: ```liquid {% raw %}{% capture download_note %}The latest version of -{{site.product_name}} is now available.{% endcapture %}{% endraw %} +{{ site.product_name }} is now available.{% endcapture %}{% endraw %} ``` Then pass this captured variable into the parameter for the include. Omit the quotation marks around the parameter content because it's no longer a string (it's a variable): @@ -170,9 +152,9 @@ Here's an example. In the `_data` folder, suppose you have a YAML file called `p In the `_includes` folder, assume you have a file called `spotlight.html` with this code: ```liquid -{% raw %}{% for person in {{include.participants}} %} +{% raw %}{% for person in {{ include.participants }} %} {% if person.login_age == "new" %} -{{person.name}} +{{ person.name }} {% endif %} {% endfor %}{% endraw %} ``` @@ -183,4 +165,4 @@ Now when you insert the `spotlight.html` include file, you can submit the YAML f {% raw %}{% include spotlight.html participants=site.data.profiles %}{% endraw %} ``` -In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{include.participants}}`{% endraw %} in the include, and the Liquid logic processes. The result will be `Jane Doe`. +In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{ include.participants }}`{% endraw %} in the include file, and the Liquid logic processes. The result will be `Jane Doe`. From adc619ca6c418fe90b0d242309db39224bd1a94a Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Wed, 28 Dec 2016 15:21:57 -0800 Subject: [PATCH 33/84] added info about jekyll new --help --- docs/_docs/quickstart.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/_docs/quickstart.md b/docs/_docs/quickstart.md index 3a57ef87..8c509fab 100644 --- a/docs/_docs/quickstart.md +++ b/docs/_docs/quickstart.md @@ -22,7 +22,7 @@ If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGem # Now browse to http://localhost:4000 ``` -## About bundler +## About Bundler `gem install jekyll bundler` installs the [jekyll](https://rubygems.org/gems/jekyll/) and [bundler](https://rubygems.org/gems/bundler) gems through [RubyGems](https://rubygems.org/). You need only to install the gems one time — not every time you create a new Jekyll project. Here are some additional details: @@ -31,13 +31,14 @@ If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGem * When you run `bundle exec jekyll serve`, Bundler uses the gems and versions as specified in `Gemfile.lock` to ensure your Jekyll site builds with no compatibility or dependency conflicts. -## Jekyll new options +## Options for creating a new site with Jekyll `jekyll new ` installs a new Jekyll site at the path specified (relative to current directory). In this case, Jekyll will be installed in a directory called `myblog`. Here are some additional details: * To install the Jekyll site into the directory you're currently in, run `jekyll new .` If the existing directory isn't empty, you can pass the `--force` option with `jekyll new . --force`. * `jekyll new` automatically initiates `bundle install` to install the dependencies required. (If you don't want Bundler to install the gems, use `jekyll new myblog --skip-bundle`.) * By default, the Jekyll site installed by `jekyll new` uses a gem-based theme called [Minima](https://github.com/jekyll/minima). With [gem-based themes](../themes), some of the directories and files are stored in the theme-gem, hidden from your immediate view. +* To learn about other parameters you can include with `jekyll new`, type ` jekyll new --help`. ## Next steps From 1bc82b9c8a28e2170e3ac256dde01b4cf265e016 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 28 Dec 2016 22:54:37 -0700 Subject: [PATCH 34/84] Fix script/stackprof & add some GC stats. When running 'script/stackprof object', I noticed that it would be helpful to see GC information. It appears we create a lot of junk -- a source of optimization if we decide to go down that path. An average Jekyll build doesn't run a GC, but auto-regeneration likely would eventually require a GC run and it would be interesting to see if we can reduce how much we throw away with each call to 'site.process'. --- script/stackprof | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/script/stackprof b/script/stackprof index 1c833142..f78f11aa 100755 --- a/script/stackprof +++ b/script/stackprof @@ -10,13 +10,17 @@ esac export BENCHMARK=true command -v stackprof > /dev/null || script/bootstrap -TEST_SCRIPT="Jekyll::Commands::Build.process({'source' => 'site'})" +TEST_SCRIPT="Jekyll::Commands::Build.process({'source' => 'docs'})" PROF_OUTPUT_FILE=tmp/stackprof-${STACKPROF_MODE}-$(date +%Y%m%d%H%M).dump +GC_BEFORE="puts 'GC Stats:'; puts JSON.pretty_generate(GC.stat); GC.disable" +GC_AFTER="puts 'GC Stats:'; GC.start(full_mark: true, immediate_sweep: false); puts JSON.pretty_generate(GC.stat);" + echo Stackprof Mode: $STACKPROF_MODE test -f "$PROF_OUTPUT_FILE" || { - bundle exec ruby -r./lib/jekyll -rstackprof \ - -e "StackProf.run(mode: :${STACKPROF_MODE}, interval: 100, out: '${PROF_OUTPUT_FILE}') { ${TEST_SCRIPT} }" + bundle exec ruby -r./lib/jekyll -rstackprof -rjson \ + -e "StackProf.run(mode: :${STACKPROF_MODE}, interval: 100, out: '${PROF_OUTPUT_FILE}') { ${GC_BEFORE}; ${TEST_SCRIPT}; ${GC_AFTER}; }" } -bundle exec stackprof $PROF_OUTPUT_FILE $@ +set -x +bundle exec stackprof $PROF_OUTPUT_FILE $@ --sort-total From b1b0d00c5a0dfd31c3991bde976b9d10341abfde Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Wed, 28 Dec 2016 23:42:37 -0800 Subject: [PATCH 35/84] made updates - made updates from Parkr's review - update to Extensionless permalinks section - update to note about not using built-in perm styles in front matter - update for readability in places --- docs/_docs/permalinks.md | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/docs/_docs/permalinks.md b/docs/_docs/permalinks.md index d41d6162..b8fd5ec6 100644 --- a/docs/_docs/permalinks.md +++ b/docs/_docs/permalinks.md @@ -4,12 +4,11 @@ title: Permalinks permalink: /docs/permalinks/ --- -Jekyll supports a flexible way to build the permalinks for your pages, posts, and collections. A permalink is the URL for the page, post, or collection (excluding the domain name or directory folder). +Permalinks refer to the URLs (excluding the domain name or directory folder) for your pages, posts, or collections. +Jekyll supports a flexible way to build permalinks, allowing you to leverage various template variables or choose built-in permalink styles (such as `date`) that automatically use a template-variable pattern. You construct permalinks by creating a template URL where dynamic elements are represented by colon-prefixed keywords. The default template permalink is `/:categories/:year/:month/:day/:title.html`. Each of the colon-prefixed keywords is a template variable. -You’re free to construct your own permalink style using the available template variables or choose one of the built-in permalink styles (such as `date`) that automatically use a template-variable pattern. - ## Where to configure permalinks You can configure your site's permalinks through the [Configuration]({% link _docs/configuration.md %}) file or in the [Front Matter]({% link _docs/frontmatter.md %}) for each post, page, or collection. @@ -41,21 +40,14 @@ permalink: /mypageurl/ Even if your configuration file specifies the `date` style, the URL for this page would be `http://somedomain.com/mypageurl/`. -{% comment %}this note needs clarification -
-
Specifying permalinks through the YAML Front Matter
-

Built-in permalink styles are not recognized in YAML Front Matter. As a result, permalink: pretty will not work, but the equivalent /:categories/:year/:month/:day/:title/ using template variables will.

-
-{% endcomment %} - -When you use permalinks that omit the `.html` file extension (called "clean URLs") Jekyll builds the file as index.html placed inside a folder with the page's name. For example: +When you use permalinks that omit the `.html` file extension (called "pretty URLs") Jekyll builds the file as index.html placed inside a folder with the page's name. For example: ``` ├── mypageurl │   └── index.html ``` -Servers automatically load the index.html file inside of any folder, so users can simply navigate to `http://somedomain.com/mypageurl` to get to `mypageurl/index.html`. +With a URL such as `/mypageurl/`, servers automatically load the index.html file inside the folder, so users can simply navigate to `http://somedomain.com/mypageurl/` to get to `mypageurl/index.html`. ## Template variables for permalinks {#template-variables} @@ -241,6 +233,11 @@ Although you can specify a custom permalink pattern using [template variables](# Rather than typing `permalink: /:categories/:year/:month/:day/:title/`, you can just type `permalink: date`. +
+
Specifying permalinks through the YAML Front Matter
+

Built-in permalink styles are not recognized in YAML Front Matter. As a result, permalink: pretty will not work.

+
+ ## Permalink style examples with posts {#permalink-style-examples} Here are a few examples to clarify how permalink styles get applied with posts. @@ -291,7 +288,7 @@ Given a post named: `/2009-04-29-slap-chop.md`

/:year/:month/:title

-

See extensionless permalinks for details.

+

See Extensionless permalinks with no trailing slashes for details.

/2009/04/slap-chop

@@ -317,13 +314,13 @@ The path to the post or page in the built site differs for posts, pages, and col ### Posts -No matter how many subfolders you organize your posts into inside the `_posts` folder, all posts are pulled out of those subfolders and flattened into the `_site`'s root directory upon build. +The subfolders into which you may have organized your posts inside the `_posts` directory will not be part of the permalink. If you use a permalink style that omits the `.html` file extension, each post is rendered as an `index.html` file inside a folder with the post's name (for example, `categoryname/2016/12/01/mypostname/index.html`). ### Pages -Unlike posts, pages are *not* removed from their subfolder directories when you build your site. Pages remain in the same folder structure in which you organized your pages in the source directory, except that the structure is now mirrored in `_site`. (The only exception is if your page has a `permalink` declared its front matter — in that case, the structure honors the permalink setting instead of the source folder structure.) +Unlike posts, pages by default mimic the source directory structure exactly. (The only exception is if your page has a `permalink` declared its front matter — in that case, the structure honors the permalink setting instead of the source folder structure.) As with posts, if you use a permalink style that omits the `.html` file extension, each page is rendered as an `index.html` file inserted inside a folder with the page's name (for example, `mypage/index.html`). @@ -335,7 +332,7 @@ Collections have their own way of setting permalinks. Additionally, collections ## Flattening pages in \_site on build -If you want to flatten your pages (pull them out of subfolders) in the `_site` directory when your site builds (similar to posts), add the permalink property of each page's front matter: +If you want to flatten your pages (pull them out of subfolders) in the `_site` directory when your site builds (similar to posts), add the `permalink` property to the front matter of each page, with no path specified: ``` --- @@ -346,7 +343,7 @@ permalink: mypageurl.html ## Extensionless permalinks with no trailing slashes {#extensionless-permalinks} -Jekyll supports permalinks that contain neither a trailing slash nor a file extension, but this requires additional support from the web server to properly serve. When using extensionless permalinks, output files written to disk will still have the proper file extension (typically `.html`), so the web server must be able to map requests without file extensions to these files. +Jekyll supports permalinks that contain neither a trailing slash nor a file extension, but this requires additional support from the web server to properly serve. When using these types of permalinks, output files written to disk will still have the proper file extension (typically `.html`), so the web server must be able to map requests without file extensions to these files. Both [GitHub Pages](../github-pages/) and the Jekyll's built-in WEBrick server handle these requests properly without any additional work. @@ -368,4 +365,4 @@ try_files $uri $uri.html $uri/ =404; ## Linking without regard to permalink styles -You can create links in your topics to other posts, pages, or collection items in a way that is valid no matter what permalink configuration you choose. By using the `link` tag, if you change your permalinks, your links won't break. See [Linking to pages](../templates#link) for more details. +You can create links in your topics to other posts, pages, or collection items in a way that is valid no matter what permalink configuration you choose. By using the `link` tag, if you change your permalinks, your links won't break. See [Linking to pages](../templates#link) in Templates for more details. From 391bf5d33c09c6f7584b9bc470877e26bda29ab4 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Wed, 28 Dec 2016 23:46:25 -0800 Subject: [PATCH 36/84] made fixes made requested fixes --- docs/_docs/permalinks.md | 326 ++++----------------------------------- 1 file changed, 27 insertions(+), 299 deletions(-) diff --git a/docs/_docs/permalinks.md b/docs/_docs/permalinks.md index 31eeb30b..d15a9eb1 100644 --- a/docs/_docs/permalinks.md +++ b/docs/_docs/permalinks.md @@ -1,317 +1,45 @@ --- layout: docs -title: Permalinks -permalink: /docs/permalinks/ +title: Quick-start guide +permalink: /docs/quickstart/ --- -Jekyll supports a flexible way to build your site’s URLs. You can specify the -permalinks for your site through the [Configuration](../configuration/) or in -the [YAML Front Matter](../frontmatter/) for each post. You’re free to choose -one of the built-in styles to create your links or craft your own. The default -style is `date`. +If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGems](https://rubygems.org/pages/download) installed (see Jekyll's [requirements](/docs/installation/#requirements/)), you can create a new Jekyll site by doing the following: -Permalinks are constructed by creating a template URL where dynamic elements -are represented by colon-prefixed keywords. For example, the default `date` -permalink is defined according to the format `/:categories/:year/:month/:day/:title.html`. +```sh +# Install Jekyll and Bundler gems through RubyGems +~ $ gem install jekyll bundler -
-
Specifying permalinks through the YAML Front Matter
-

- Built-in permalink styles are not recognized in YAML Front Matter. So - permalink: pretty will not work, but the equivalent - /:categories/:year/:month/:day/:title/ - using template variables will. -

-
+# Create a new Jekyll site at ./myblog +~ $ jekyll new myblog -## Template variables +# Change into your new directory +~ $ cd myblog -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VariableDescription
-

year

-
-

Year from the Post’s filename

-
-

month

-
-

Month from the Post’s filename

-
-

i_month

-
-

Month from the Post’s filename without leading zeros.

-
-

day

-
-

Day from the Post’s filename

-
-

i_day

-
-

Day from the Post’s filename without leading zeros.

-
-

short_year

-
-

Year from the Post’s filename without the century.

-
-

hour

-
-

- Hour of the day, 24-hour clock, zero-padded from the post’s date front matter. (00..23) -

-
-

minute

-
-

- Minute of the hour from the post’s date front matter. (00..59) -

-
-

second

-
-

- Second of the minute from the post’s date front matter. (00..59) -

-
-

title

-
-

- Title from the document’s filename. May be overridden via - the document’s slug YAML front matter. -

-
-

slug

-
-

- Slugified title from the document’s filename ( any character - except numbers and letters is replaced as hyphen ). May be - overridden via the document’s slug YAML front matter. -

-
-

categories

-
-

- The specified categories for this Post. If a post has multiple - categories, Jekyll will create a hierarchy (e.g. /category1/category2). - Also Jekyll automatically parses out double slashes in the URLs, - so if no categories are present, it will ignore this. -

-
-
+# Build the site on the preview server +~/myblog $ bundle exec jekyll serve -## Built-in permalink styles +# Now browse to http://localhost:4000 +``` -While you can specify a custom permalink style using [template variables](#template-variables), -Jekyll also provides the following built-in styles for convenience. +## About Bundler -
- - - - - - - - - - - - - - - - - - - - - - - - - -
Permalink StyleURL Template
-

date

-
-

/:categories/:year/:month/:day/:title.html

-
-

pretty

-
-

/:categories/:year/:month/:day/:title/

-
-

ordinal

-
-

/:categories/:year/:y_day/:title.html

-
-

none

-
-

/:categories/:title.html

-
-
+`gem install jekyll bundler` installs the [jekyll](https://rubygems.org/gems/jekyll/) and [bundler](https://rubygems.org/gems/bundler) gems through [RubyGems](https://rubygems.org/). You need only to install the gems one time — not every time you create a new Jekyll project. Here are some additional details: -## Pages and collections +* `bundler` is a gem that manages other Ruby gems. It makes sure your gems and gem versions are compatible, and that you have all necessary dependencies each gem requires. +* The `Gemfile` and `Gemfile.lock` files inform Bundler about the gem requirements in your site. If your site doesn't have these Gemfiles, you can omit `bundle exec` and just run `jekyll serve`. -The `permalink` configuration setting specifies the permalink style used for -posts. Pages and collections each have their own default permalink style; the -default style for pages is `/:path/:basename` and the default for collections is -`/:collection/:path`. +* When you run `bundle exec jekyll serve`, Bundler uses the gems and versions as specified in `Gemfile.lock` to ensure your Jekyll site builds with no compatibility or dependency conflicts. -These styles are modified to match the suffix style specified in the post -permalink setting. For example, a permalink style of `pretty`, which contains a -trailing slash, will update page permalinks to also contain a trailing slash: -`/:path/:basename/`. A permalink style of `date`, which contains a trailing -file extension, will update page permalinks to also contain a file extension: -`/:path/:basename:output_ext`. The same is true for any custom permalink style. +## Options for creating a new site with Jekyll -The permalink for an individual page or collection document can always be -overridden in the [YAML Front Matter](../frontmatter/) for the page or document. -Additionally, permalinks for a given collection can be customized [in the -collections configuration](../collections/). +`jekyll new ` installs a new Jekyll site at the path specified (relative to current directory). In this case, Jekyll will be installed in a directory called `myblog`. Here are some additional details: -## Permalink style examples +* To install the Jekyll site into the directory you're currently in, run `jekyll new .` If the existing directory isn't empty, you can pass the `--force` option with `jekyll new . --force`. +* `jekyll new` automatically initiates `bundle install` to install the dependencies required. (If you don't want Bundler to install the gems, use `jekyll new myblog --skip-bundle`.) +* By default, the Jekyll site installed by `jekyll new` uses a gem-based theme called [Minima](https://github.com/jekyll/minima). With [gem-based themes](../themes), some of the directories and files are stored in the theme-gem, hidden from your immediate view. +* To learn about other parameters you can include with `jekyll new`, type `jekyll new --help`. -Given a post named: `/2009-04-29-slap-chop.md` +## Next steps -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
URL TemplateResulting Permalink URL
-

None specified, or permalink: date

-
-

/2009/04/29/slap-chop.html

-
-

pretty

-
-

/2009/04/29/slap-chop/

-
-

/:month-:day-:year/:title.html

-
-

/04-29-2009/slap-chop.html

-
-

/blog/:year/:month/:day/:title/

-
-

/blog/2009/04/29/slap-chop/

-
-

/:year/:month/:title

-

See extensionless permalinks for details.

-
-

/2009/04/slap-chop

-
-
- -## Extensionless permalinks - -Jekyll supports permalinks that contain neither a trailing slash nor a file -extension, but this requires additional support from the web server to properly -serve. When using extensionless permalinks, output files written to disk will -still have the proper file extension (typically `.html`), so the web server -must be able to map requests without file extensions to these files. - -Both [GitHub Pages](../github-pages/) and the Jekyll's built-in WEBrick server -handle these requests properly without any additional work. - -### Apache - -The Apache web server has very extensive support for content negotiation and can -handle extensionless URLs by setting the [multiviews][] option in your -`httpd.conf` or `.htaccess` file: - -[multiviews]: https://httpd.apache.org/docs/current/content-negotiation.html#multiviews - -{% highlight apache %} -Options +MultiViews -{% endhighlight %} - -### Nginx - -The [try_files][] directive allows you to specify a list of files to search for -to process a request. The following configuration will instruct nginx to search -for a file with an `.html` extension if an exact match for the requested URI is -not found. - -[try_files]: http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files - -{% highlight nginx %} -try_files $uri $uri.html $uri/ =404; -{% endhighlight %} +Building a Jekyll site with the default theme is just the first step. The real magic happens when you start creating blog posts, using the front matter to control templates and layouts, and taking advantage of all the awesome configuration options Jekyll makes available. From 6a2c7f271821af449ee3de4eb16ea72c47f949b0 Mon Sep 17 00:00:00 2001 From: Rob Crocombe Date: Thu, 29 Dec 2016 10:20:15 +0000 Subject: [PATCH 37/84] Add Jekyll-Post to plugins.md --- docs/_docs/plugins.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_docs/plugins.md b/docs/_docs/plugins.md index cc1995ad..775dabbf 100644 --- a/docs/_docs/plugins.md +++ b/docs/_docs/plugins.md @@ -918,6 +918,7 @@ LESS.js files during generation. - [jekyll-data](https://github.com/ashmaroli/jekyll-data): Read data files within Jekyll Theme Gems. - [jekyll-pinboard](https://github.com/snaptortoise/jekyll-pinboard-plugin): Access your Pinboard bookmarks within your Jekyll theme. - [jekyll-migrate-permalink](https://github.com/mpchadwick/jekyll-migrate-permalink): Adds a `migrate-permalink` sub-command to help deal with side effects of changing your permalink. +- [Jekyll-Post](https://github.com/robcrocombe/jekyll-post): A CLI tool to easily draft, edit, and publish Jekyll posts. #### Editors From 240ea135760d7a5943b1bd5aaaf68b19c9248e0e Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Sun, 25 Dec 2016 20:44:35 -0800 Subject: [PATCH 38/84] Added new includes.md topic to docs Added new includes.md topic. See https://github.com/jekyll/jekyll/pull/5630 for more details on the update. @jekyll/documentation @DirtyF --- docs/_docs/includes.md | 175 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 docs/_docs/includes.md diff --git a/docs/_docs/includes.md b/docs/_docs/includes.md new file mode 100644 index 00000000..dceece77 --- /dev/null +++ b/docs/_docs/includes.md @@ -0,0 +1,175 @@ +--- +layout: docs +title: Includes +permalink: /docs/includes/ +--- + +The `include` tag allows you to include the content from another file stored in the `_includes` folder: + +```liquid +{% raw %}{% include footer.html %}{% endraw %} +``` + +Jekyll will look for the referenced file (in this case, `footer.html`) in the `_includes` directory at the root of your source directory and insert its contents. + +### Including files relative to another file + +You can choose to include file fragments relative to the current file by using the `include_relative` tag: + +```liquid +{% raw %}{% include_relative somedir/footer.html %}{% endraw %} +``` + +You won't need to place your included content within the `_includes` directory. Instead, +the inclusion is specifically relative to the file where the tag is being used. For example, +if `_posts/2014-09-03-my-file.markdown` uses the `include_relative` tag, the included file +must be within the `_posts` directory or one of its subdirectories. + +Note that you cannot use the `../` syntax to specify an include location that refers to a higher-level directory. + +All the other capabilities of the `include` tag are available to the `include_relative` tag, +such as variables. + +### Using variables names for the include file + +The name of the file you want to embed can be specified as a variable instead of an actual file name. For example, suppose you defined a variable in your page's frontmatter like this: + +```yaml +--- +title: My page +my_variable: footer_company_a.html +--- +``` + +You could then reference that variable in your include: + +```liquid +{% raw %}{% include {{page.my_variable}} %}{% endraw %} +``` + +In this example, the include would insert the file `footer_company_a.html` from the `_includes/footer_company_a.html` directory. + +### Passing parameters to includes + +You can also pass parameters to an include. For example, suppose you have a file called `note.html` in your `_includes` folder that contains this formatting: + +```liquid +{% raw %}{% endraw %} +``` + +The {% raw %}`{{include.content}}`{% endraw %} is a parameter gets populated when you call the include and specify a value for that parameter, like this: + +```liquid +{% raw %}{% include note.html content="This is my sample note." %} {% endraw %} +``` + +The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{include.content}}`{% endraw %} parameter. + +Passing parameters to includes is especially helpful when you want to hide away complex formatting from your Markdown content. + +For example, suppose you have a special image syntax with complex formatting, and you don't want your authors to remember the complex formatting. As a result, you decide to simplify the formatting by using an include with parameters. Here's an example of the special image syntax you want to populate with an include: + +```html +
Jekyll logo
+This is the Jekyll logo
+``` + +You could templatize this content in your include and make each value available as a parameter, like this: + +```liquid +{% raw %}
{{include.caption}} +
{% endraw %} +``` + +This include contains 5 parameters: + +* `url` +* `max-width` +* `file` +* `alt` +* `caption` + +You could also use `if` tags to safeguard scenarios where either the parameter is optional or where the author doesn't include the parameter: + +```liquid +{% raw %}
{% if {{include.url}} %} +{% endif %}{% if {{include.url}} %}{% endif %} +{% if {{include.caption}} %}
{{include.caption}} +
{% endif %}
{% endraw %} +``` + +In this example, `{% raw %}if {{include.url}}{% endraw %}` will include the `url` only if the `url` parameter is specified in the include. You could also create default values using [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). + +Here's an example that passes all the parameters to this include (the include file is named `image.html`): + +```liquid +{% raw %}{% include image.html url="http://jekyllrb.com" +max-width="200px" file="logo.png" alt="Jekyll logo" +caption="This is the Jekyll logo." %} {% endraw %} +``` + +The result is the original HTML code shown earlier. + +You can create includes that act as templates for a variety of uses — inserting audio or video clips, alerts, special formatting, and more. + +However, note that you should avoid using too many includes, as this will slow down the build time of your site. For example, don't use includes every time you insert an image. (The above technique shows a use case for special images.) + +### Passing parameter variables to includes + +Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{site.product_name}}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) + +The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{site.product_name}} is now available."`{% endraw %} + +If you want to include this variable in your parameter that you pass to an include, you need to store the entire parameter as a variable before passing it to the include. You can use `capture` tags to create the variable: + +```liquid +{% raw %}{% capture download_note %}The latest version of +{{site.product_name}} is now available.{% endcapture %}{% endraw %} +``` + +Then pass this captured variable into the parameter for the include. Omit the quotation marks around the parameter content because it's no longer a string (it's a variable): + +```liquid +{% raw %}{% include note.html content=download_note %}{% endraw %} +``` + +### Passing references to YAML files as parameter values + +Instead of passing string variables to the include, you can pass a reference to a YAML data file stored in the `_data` folder. + +Here's an example. In the `_data` folder, suppose you have a YAML file called `profiles.yml`. Its content looks like this: + +```yaml +- name: John Doe + login_age: old + image: johndoe.jpg + +- name: Jane Doe + login_age: new + image: janedoe.jpg +``` + +In the `_includes` folder, assume you have a file called `spotlight.html` with this code: + +```liquid +{% raw %}{% for person in {{include.participants}} %} +{% if person.login_age == "new" %} +{{person.name}} +{% endif %} +{% endfor %}{% endraw %} +``` + +Now when you insert the `spotlight.html` include file, you can submit the YAML file as a parameter: + +``` +{% raw %}{% include spotlight.html participants=site.data.profiles %}{% endraw %} +``` + +In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{include.participants}}`{% endraw %} in the include, and the Liquid logic processes. The result will be `Jane Doe`. From 8289b6131616dab2abfcc4925ea166d6e99af600 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Mon, 26 Dec 2016 18:28:27 -0800 Subject: [PATCH 39/84] made requested updates - made `{{ }}` formatting more readable by adding spacing. - added formatting to code samples to properly reflect line breaks for readability --- docs/_docs/includes.md | 57 ++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/docs/_docs/includes.md b/docs/_docs/includes.md index dceece77..3a0b819d 100644 --- a/docs/_docs/includes.md +++ b/docs/_docs/includes.md @@ -44,7 +44,7 @@ my_variable: footer_company_a.html You could then reference that variable in your include: ```liquid -{% raw %}{% include {{page.my_variable}} %}{% endraw %} +{% raw %}{% include {{ page.my_variable }} %}{% endraw %} ``` In this example, the include would insert the file `footer_company_a.html` from the `_includes/footer_company_a.html` directory. @@ -55,35 +55,41 @@ You can also pass parameters to an include. For example, suppose you have a file ```liquid {% raw %}{% endraw %} ``` -The {% raw %}`{{include.content}}`{% endraw %} is a parameter gets populated when you call the include and specify a value for that parameter, like this: +The `{% raw %}{{ include.content }}{% endraw %}` is a parameter gets populated when you call the include and specify a value for that parameter, like this: ```liquid {% raw %}{% include note.html content="This is my sample note." %} {% endraw %} ``` -The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{include.content}}`{% endraw %} parameter. +The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{ include.content }}`{% endraw %} parameter. Passing parameters to includes is especially helpful when you want to hide away complex formatting from your Markdown content. For example, suppose you have a special image syntax with complex formatting, and you don't want your authors to remember the complex formatting. As a result, you decide to simplify the formatting by using an include with parameters. Here's an example of the special image syntax you want to populate with an include: ```html -
Jekyll logo
-This is the Jekyll logo
+
+ + Jekyll logo +
This is the Jekyll logo
+
``` You could templatize this content in your include and make each value available as a parameter, like this: ```liquid -{% raw %}
{{include.caption}} -
{% endraw %} +{% raw %}
+ + {{ include.alt }} +
{{ include.caption }}
+
{% endraw %} ``` This include contains 5 parameters: @@ -97,15 +103,18 @@ This include contains 5 parameters: You could also use `if` tags to safeguard scenarios where either the parameter is optional or where the author doesn't include the parameter: ```liquid -{% raw %}
{% if {{include.url}} %} -{% endif %}{% if {{include.url}} %}{% endif %} -{% if {{include.caption}} %}
{{include.caption}} -
{% endif %}
{% endraw %} +{% raw %}
+ {% if {{ include.url }} %}{% endif %} + {{ include.alt }}{% if {{ include.url }} %}{% endif %} + {% if {{ include.caption }} %} +
{{ include.caption }}
+ {% endif %} +
{% endraw %} ``` -In this example, `{% raw %}if {{include.url}}{% endraw %}` will include the `url` only if the `url` parameter is specified in the include. You could also create default values using [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). +In this example, `{% raw %}if {{ include.url }}{% endraw %}` will include the `url` only if the `url` parameter is specified in the include. You could also create default values using [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). Here's an example that passes all the parameters to this include (the include file is named `image.html`): @@ -123,15 +132,15 @@ However, note that you should avoid using too many includes, as this will slow d ### Passing parameter variables to includes -Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{site.product_name}}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) +Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{ site.product_name }}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) -The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{site.product_name}} is now available."`{% endraw %} +The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{ site.product_name }} is now available."`{% endraw %} If you want to include this variable in your parameter that you pass to an include, you need to store the entire parameter as a variable before passing it to the include. You can use `capture` tags to create the variable: ```liquid {% raw %}{% capture download_note %}The latest version of -{{site.product_name}} is now available.{% endcapture %}{% endraw %} +{{ site.product_name }} is now available.{% endcapture %}{% endraw %} ``` Then pass this captured variable into the parameter for the include. Omit the quotation marks around the parameter content because it's no longer a string (it's a variable): @@ -159,9 +168,9 @@ Here's an example. In the `_data` folder, suppose you have a YAML file called `p In the `_includes` folder, assume you have a file called `spotlight.html` with this code: ```liquid -{% raw %}{% for person in {{include.participants}} %} +{% raw %}{% for person in {{ include.participants }} %} {% if person.login_age == "new" %} -{{person.name}} +{{ person.name }} {% endif %} {% endfor %}{% endraw %} ``` @@ -172,4 +181,4 @@ Now when you insert the `spotlight.html` include file, you can submit the YAML f {% raw %}{% include spotlight.html participants=site.data.profiles %}{% endraw %} ``` -In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{include.participants}}`{% endraw %} in the include, and the Liquid logic processes. The result will be `Jane Doe`. +In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{ include.participants }}`{% endraw %} in the include, and the Liquid logic processes. The result will be `Jane Doe`. From 56a7038a7edd5141c76e4b295a7566ba5e2b1f03 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Tue, 27 Dec 2016 11:03:23 -0800 Subject: [PATCH 40/84] Updated to remove spacing from include variables It turns out Liquid throws an error when you write `{% if {{ include.url }} %}` instead of `{% if {{include.url}} %}`. I updated the examples here to omit the spacing. To avoid inconsistency, I just omitted the spacing from all curly braces. Also added a note explaining the issue and put the blame on Liquid. --- docs/_docs/includes.md | 46 ++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/docs/_docs/includes.md b/docs/_docs/includes.md index 3a0b819d..1a60ce0d 100644 --- a/docs/_docs/includes.md +++ b/docs/_docs/includes.md @@ -32,7 +32,7 @@ such as variables. ### Using variables names for the include file -The name of the file you want to embed can be specified as a variable instead of an actual file name. For example, suppose you defined a variable in your page's frontmatter like this: +The name of the file you want to embed can be specified as a variable instead of an actual file name. For example, suppose you defined a variable in your page's front matter like this: ```yaml --- @@ -44,7 +44,7 @@ my_variable: footer_company_a.html You could then reference that variable in your include: ```liquid -{% raw %}{% include {{ page.my_variable }} %}{% endraw %} +{% raw %}{% include {{page.my_variable}} %}{% endraw %} ``` In this example, the include would insert the file `footer_company_a.html` from the `_includes/footer_company_a.html` directory. @@ -56,17 +56,17 @@ You can also pass parameters to an include. For example, suppose you have a file ```liquid {% raw %}{% endraw %} ``` -The `{% raw %}{{ include.content }}{% endraw %}` is a parameter gets populated when you call the include and specify a value for that parameter, like this: +The `{% raw %}{{include.content}}{% endraw %}` is a parameter that gets populated when you call the include and specify a value for that parameter, like this: ```liquid {% raw %}{% include note.html content="This is my sample note." %} {% endraw %} ``` -The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{ include.content }}`{% endraw %} parameter. +The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{include.content}}`{% endraw %} parameter. Passing parameters to includes is especially helpful when you want to hide away complex formatting from your Markdown content. @@ -85,10 +85,10 @@ You could templatize this content in your include and make each value available ```liquid {% raw %}
- - {{ include.alt }} -
{{ include.caption }}
+
+ {{include.alt}} +
{{include.caption}}
{% endraw %} ``` @@ -104,17 +104,17 @@ You could also use `if` tags to safeguard scenarios where either the parameter i ```liquid {% raw %}
- {% if {{ include.url }} %}{% endif %} - {{ include.alt }}{% if {{ include.url }} %}{% endif %} - {% if {{ include.caption }} %} -
{{ include.caption }}
+ {% if {{include.url}} %}{% endif %} + {{include.alt}}{% if {{include.url}} %}{% endif %} + {% if {{include.caption}} %} +
{{include.caption}}
{% endif %}
{% endraw %} ``` -In this example, `{% raw %}if {{ include.url }}{% endraw %}` will include the `url` only if the `url` parameter is specified in the include. You could also create default values using [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). +In this example, `{% raw %}if {{include.url}}{% endraw %}` will include the `url` only if the `url` parameter is specified in the include. You could also create default values using [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). Here's an example that passes all the parameters to this include (the include file is named `image.html`): @@ -130,17 +130,19 @@ You can create includes that act as templates for a variety of uses — inse However, note that you should avoid using too many includes, as this will slow down the build time of your site. For example, don't use includes every time you insert an image. (The above technique shows a use case for special images.) +Additionally, if you have a include variable inside an `if` statement, such as `{% raw %}{% if {{include.url}} %}{% endraw %}`, don't use spaces inside the curly braces. For example, avoid this syntax: `{% raw %}{% if {{ include.url }} %}{% endraw %}`. Liquid will consider this extra spacing an error. (Outside of `if` statements, the spacing for include variables doesn't matter.) + ### Passing parameter variables to includes -Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{ site.product_name }}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) +Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{site.product_name}}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) -The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{ site.product_name }} is now available."`{% endraw %} +The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{site.product_name}} is now available."`{% endraw %} If you want to include this variable in your parameter that you pass to an include, you need to store the entire parameter as a variable before passing it to the include. You can use `capture` tags to create the variable: ```liquid {% raw %}{% capture download_note %}The latest version of -{{ site.product_name }} is now available.{% endcapture %}{% endraw %} +{{site.product_name}} is now available.{% endcapture %}{% endraw %} ``` Then pass this captured variable into the parameter for the include. Omit the quotation marks around the parameter content because it's no longer a string (it's a variable): @@ -168,9 +170,9 @@ Here's an example. In the `_data` folder, suppose you have a YAML file called `p In the `_includes` folder, assume you have a file called `spotlight.html` with this code: ```liquid -{% raw %}{% for person in {{ include.participants }} %} +{% raw %}{% for person in {{include.participants}} %} {% if person.login_age == "new" %} -{{ person.name }} +{{person.name}} {% endif %} {% endfor %}{% endraw %} ``` @@ -181,4 +183,4 @@ Now when you insert the `spotlight.html` include file, you can submit the YAML f {% raw %}{% include spotlight.html participants=site.data.profiles %}{% endraw %} ``` -In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{ include.participants }}`{% endraw %} in the include, and the Liquid logic processes. The result will be `Jane Doe`. +In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{include.participants}}`{% endraw %} in the include, and the Liquid logic processes. The result will be `Jane Doe`. From acff6cd269ea516ac8aaf4922f57c8f2be2367db Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Tue, 27 Dec 2016 21:39:56 -0800 Subject: [PATCH 41/84] Removed erroneous liquid code, added back spacing - removed erroneous liquid code with conditional include parameters - added back spacing in {{ }} tags --- docs/_docs/includes.md | 52 ++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 35 deletions(-) diff --git a/docs/_docs/includes.md b/docs/_docs/includes.md index 1a60ce0d..94c56894 100644 --- a/docs/_docs/includes.md +++ b/docs/_docs/includes.md @@ -44,7 +44,7 @@ my_variable: footer_company_a.html You could then reference that variable in your include: ```liquid -{% raw %}{% include {{page.my_variable}} %}{% endraw %} +{% raw %}{% include {{ page.my_variable }} %}{% endraw %} ``` In this example, the include would insert the file `footer_company_a.html` from the `_includes/footer_company_a.html` directory. @@ -56,21 +56,21 @@ You can also pass parameters to an include. For example, suppose you have a file ```liquid {% raw %}{% endraw %} ``` -The `{% raw %}{{include.content}}{% endraw %}` is a parameter that gets populated when you call the include and specify a value for that parameter, like this: +The `{% raw %}{{ include.content }}{% endraw %}` is a parameter that gets populated when you call the include and specify a value for that parameter, like this: ```liquid {% raw %}{% include note.html content="This is my sample note." %} {% endraw %} ``` -The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{include.content}}`{% endraw %} parameter. +The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{ include.content }}`{% endraw %} parameter. Passing parameters to includes is especially helpful when you want to hide away complex formatting from your Markdown content. -For example, suppose you have a special image syntax with complex formatting, and you don't want your authors to remember the complex formatting. As a result, you decide to simplify the formatting by using an include with parameters. Here's an example of the special image syntax you want to populate with an include: +For example, suppose you have a special image syntax with complex formatting, and you don't want your authors to remember the complex formatting. As a result, you decide to simplify the formatting by using an include with parameters. Here's an example of the special image syntax you might want to populate with an include: ```html
@@ -85,10 +85,10 @@ You could templatize this content in your include and make each value available ```liquid {% raw %}
- - {{include.alt}} -
{{include.caption}}
+
+ {{ include.alt }} +
{{ include.caption }}
{% endraw %} ``` @@ -100,22 +100,6 @@ This include contains 5 parameters: * `alt` * `caption` -You could also use `if` tags to safeguard scenarios where either the parameter is optional or where the author doesn't include the parameter: - -```liquid -{% raw %}
- {% if {{include.url}} %}{% endif %} - {{include.alt}}{% if {{include.url}} %}{% endif %} - {% if {{include.caption}} %} -
{{include.caption}}
- {% endif %} -
{% endraw %} -``` - -In this example, `{% raw %}if {{include.url}}{% endraw %}` will include the `url` only if the `url` parameter is specified in the include. You could also create default values using [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). - Here's an example that passes all the parameters to this include (the include file is named `image.html`): ```liquid @@ -126,23 +110,21 @@ caption="This is the Jekyll logo." %} {% endraw %} The result is the original HTML code shown earlier. -You can create includes that act as templates for a variety of uses — inserting audio or video clips, alerts, special formatting, and more. +To safeguard situations where users don't supply a value for the parameter, you can use [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default). -However, note that you should avoid using too many includes, as this will slow down the build time of your site. For example, don't use includes every time you insert an image. (The above technique shows a use case for special images.) - -Additionally, if you have a include variable inside an `if` statement, such as `{% raw %}{% if {{include.url}} %}{% endraw %}`, don't use spaces inside the curly braces. For example, avoid this syntax: `{% raw %}{% if {{ include.url }} %}{% endraw %}`. Liquid will consider this extra spacing an error. (Outside of `if` statements, the spacing for include variables doesn't matter.) +Overall, you can create includes that act as templates for a variety of uses — inserting audio or video clips, alerts, special formatting, and more. However, note that you should avoid using too many includes, as this will slow down the build time of your site. For example, don't use includes every time you insert an image. (The above technique shows a use case for special images.) ### Passing parameter variables to includes -Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{site.product_name}}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) +Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{ site.product_name }}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.) -The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{site.product_name}} is now available."`{% endraw %} +The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{ site.product_name }} is now available."`{% endraw %} If you want to include this variable in your parameter that you pass to an include, you need to store the entire parameter as a variable before passing it to the include. You can use `capture` tags to create the variable: ```liquid {% raw %}{% capture download_note %}The latest version of -{{site.product_name}} is now available.{% endcapture %}{% endraw %} +{{ site.product_name }} is now available.{% endcapture %}{% endraw %} ``` Then pass this captured variable into the parameter for the include. Omit the quotation marks around the parameter content because it's no longer a string (it's a variable): @@ -170,9 +152,9 @@ Here's an example. In the `_data` folder, suppose you have a YAML file called `p In the `_includes` folder, assume you have a file called `spotlight.html` with this code: ```liquid -{% raw %}{% for person in {{include.participants}} %} +{% raw %}{% for person in {{ include.participants }} %} {% if person.login_age == "new" %} -{{person.name}} +{{ person.name }} {% endif %} {% endfor %}{% endraw %} ``` @@ -183,4 +165,4 @@ Now when you insert the `spotlight.html` include file, you can submit the YAML f {% raw %}{% include spotlight.html participants=site.data.profiles %}{% endraw %} ``` -In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{include.participants}}`{% endraw %} in the include, and the Liquid logic processes. The result will be `Jane Doe`. +In this instance, `site.data.profiles` gets inserted in place of {% raw %}`{{ include.participants }}`{% endraw %} in the include file, and the Liquid logic processes. The result will be `Jane Doe`. From 57d6d5986feb912fd4c4241a29d9a86980a9d91f Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Thu, 29 Dec 2016 08:27:42 -0800 Subject: [PATCH 42/84] update quickstart.md I must have just updated the wrong doc or branch in the last commit. i hope this fixes it. --- docs/_docs/quickstart.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_docs/quickstart.md b/docs/_docs/quickstart.md index 8c509fab..d15a9eb1 100644 --- a/docs/_docs/quickstart.md +++ b/docs/_docs/quickstart.md @@ -27,7 +27,7 @@ If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGem `gem install jekyll bundler` installs the [jekyll](https://rubygems.org/gems/jekyll/) and [bundler](https://rubygems.org/gems/bundler) gems through [RubyGems](https://rubygems.org/). You need only to install the gems one time — not every time you create a new Jekyll project. Here are some additional details: * `bundler` is a gem that manages other Ruby gems. It makes sure your gems and gem versions are compatible, and that you have all necessary dependencies each gem requires. -* The `Gemfile` and `Gemfile.lock` files inform Bundler about the gem requirements in your theme. If your theme doesn't have these Gemfiles, you can omit `bundle exec` and just run `jekyll serve`. +* The `Gemfile` and `Gemfile.lock` files inform Bundler about the gem requirements in your site. If your site doesn't have these Gemfiles, you can omit `bundle exec` and just run `jekyll serve`. * When you run `bundle exec jekyll serve`, Bundler uses the gems and versions as specified in `Gemfile.lock` to ensure your Jekyll site builds with no compatibility or dependency conflicts. @@ -38,7 +38,7 @@ If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGem * To install the Jekyll site into the directory you're currently in, run `jekyll new .` If the existing directory isn't empty, you can pass the `--force` option with `jekyll new . --force`. * `jekyll new` automatically initiates `bundle install` to install the dependencies required. (If you don't want Bundler to install the gems, use `jekyll new myblog --skip-bundle`.) * By default, the Jekyll site installed by `jekyll new` uses a gem-based theme called [Minima](https://github.com/jekyll/minima). With [gem-based themes](../themes), some of the directories and files are stored in the theme-gem, hidden from your immediate view. -* To learn about other parameters you can include with `jekyll new`, type ` jekyll new --help`. +* To learn about other parameters you can include with `jekyll new`, type `jekyll new --help`. ## Next steps From 192e79ed1e84298ffc07c3ce4ca4ffa2e6bd0534 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Thu, 29 Dec 2016 08:57:39 -0800 Subject: [PATCH 43/84] reset permalinks to same state it was in in patch-3 branch. i couldn't seem to remove it from the previous commit. --- docs/_docs/permalinks.md | 326 +++++++++++++++++++++++++++++++++++---- 1 file changed, 299 insertions(+), 27 deletions(-) diff --git a/docs/_docs/permalinks.md b/docs/_docs/permalinks.md index d15a9eb1..557a53f9 100644 --- a/docs/_docs/permalinks.md +++ b/docs/_docs/permalinks.md @@ -1,45 +1,317 @@ --- layout: docs -title: Quick-start guide -permalink: /docs/quickstart/ +title: Permalinks +permalink: /docs/permalinks/ --- -If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGems](https://rubygems.org/pages/download) installed (see Jekyll's [requirements](/docs/installation/#requirements/)), you can create a new Jekyll site by doing the following: +Jekyll supports a flexible way to build your site’s URLs. You can specify the +permalinks for your site through the [Configuration](../configuration/) or in +the [YAML Front Matter](../frontmatter/) for each post. You’re free to choose +one of the built-in styles to create your links or craft your own. The default +style is `date`. -```sh -# Install Jekyll and Bundler gems through RubyGems -~ $ gem install jekyll bundler +Permalinks are constructed by creating a template URL where dynamic elements +are represented by colon-prefixed keywords. For example, the default `date` +permalink is defined according to the format `/:categories/:year/:month/:day/:title.html`. -# Create a new Jekyll site at ./myblog -~ $ jekyll new myblog +
+
Specifying permalinks through the YAML Front Matter
+

+ Built-in permalink styles are not recognized in YAML Front Matter. So + permalink: pretty will not work, but the equivalent + /:categories/:year/:month/:day/:title/ + using template variables will. +

+
-# Change into your new directory -~ $ cd myblog +## Template variables -# Build the site on the preview server -~/myblog $ bundle exec jekyll serve +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariableDescription
+

year

+
+

Year from the Post’s filename

+
+

month

+
+

Month from the Post’s filename

+
+

i_month

+
+

Month from the Post’s filename without leading zeros.

+
+

day

+
+

Day from the Post’s filename

+
+

i_day

+
+

Day from the Post’s filename without leading zeros.

+
+

short_year

+
+

Year from the Post’s filename without the century.

+
+

hour

+
+

+ Hour of the day, 24-hour clock, zero-padded from the post’s date front matter. (00..23) +

+
+

minute

+
+

+ Minute of the hour from the post’s date front matter. (00..59) +

+
+

second

+
+

+ Second of the minute from the post’s date front matter. (00..59) +

+
+

title

+
+

+ Title from the document’s filename. May be overridden via + the document’s slug YAML front matter. +

+
+

slug

+
+

+ Slugified title from the document’s filename ( any character + except numbers and letters is replaced as hyphen ). May be + overridden via the document’s slug YAML front matter. +

+
+

categories

+
+

+ The specified categories for this Post. If a post has multiple + categories, Jekyll will create a hierarchy (e.g. /category1/category2). + Also Jekyll automatically parses out double slashes in the URLs, + so if no categories are present, it will ignore this. +

+
+
-# Now browse to http://localhost:4000 -``` +## Built-in permalink styles -## About Bundler +While you can specify a custom permalink style using [template variables](#template-variables), +Jekyll also provides the following built-in styles for convenience. -`gem install jekyll bundler` installs the [jekyll](https://rubygems.org/gems/jekyll/) and [bundler](https://rubygems.org/gems/bundler) gems through [RubyGems](https://rubygems.org/). You need only to install the gems one time — not every time you create a new Jekyll project. Here are some additional details: +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Permalink StyleURL Template
+

date

+
+

/:categories/:year/:month/:day/:title.html

+
+

pretty

+
+

/:categories/:year/:month/:day/:title/

+
+

ordinal

+
+

/:categories/:year/:y_day/:title.html

+
+

none

+
+

/:categories/:title.html

+
+
-* `bundler` is a gem that manages other Ruby gems. It makes sure your gems and gem versions are compatible, and that you have all necessary dependencies each gem requires. -* The `Gemfile` and `Gemfile.lock` files inform Bundler about the gem requirements in your site. If your site doesn't have these Gemfiles, you can omit `bundle exec` and just run `jekyll serve`. +## Pages and collections -* When you run `bundle exec jekyll serve`, Bundler uses the gems and versions as specified in `Gemfile.lock` to ensure your Jekyll site builds with no compatibility or dependency conflicts. +The `permalink` configuration setting specifies the permalink style used for +posts. Pages and collections each have their own default permalink style; the +default style for pages is `/:path/:basename` and the default for collections is +`/:collection/:path`. -## Options for creating a new site with Jekyll +These styles are modified to match the suffix style specified in the post +permalink setting. For example, a permalink style of `pretty`, which contains a +trailing slash, will update page permalinks to also contain a trailing slash: +`/:path/:basename/`. A permalink style of `date`, which contains a trailing +file extension, will update page permalinks to also contain a file extension: +`/:path/:basename:output_ext`. The same is true for any custom permalink style. -`jekyll new ` installs a new Jekyll site at the path specified (relative to current directory). In this case, Jekyll will be installed in a directory called `myblog`. Here are some additional details: +The permalink for an individual page or collection document can always be +overridden in the [YAML Front Matter](../frontmatter/) for the page or document. +Additionally, permalinks for a given collection can be customized [in the +collections configuration](../collections/). -* To install the Jekyll site into the directory you're currently in, run `jekyll new .` If the existing directory isn't empty, you can pass the `--force` option with `jekyll new . --force`. -* `jekyll new` automatically initiates `bundle install` to install the dependencies required. (If you don't want Bundler to install the gems, use `jekyll new myblog --skip-bundle`.) -* By default, the Jekyll site installed by `jekyll new` uses a gem-based theme called [Minima](https://github.com/jekyll/minima). With [gem-based themes](../themes), some of the directories and files are stored in the theme-gem, hidden from your immediate view. -* To learn about other parameters you can include with `jekyll new`, type `jekyll new --help`. +## Permalink style examples -## Next steps +Given a post named: `/2009-04-29-slap-chop.md` -Building a Jekyll site with the default theme is just the first step. The real magic happens when you start creating blog posts, using the front matter to control templates and layouts, and taking advantage of all the awesome configuration options Jekyll makes available. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
URL TemplateResulting Permalink URL
+

None specified, or permalink: date

+
+

/2009/04/29/slap-chop.html

+
+

pretty

+
+

/2009/04/29/slap-chop/

+
+

/:month-:day-:year/:title.html

+
+

/04-29-2009/slap-chop.html

+
+

/blog/:year/:month/:day/:title/

+
+

/blog/2009/04/29/slap-chop/

+
+

/:year/:month/:title

+

See extensionless permalinks for details.

+
+

/2009/04/slap-chop

+
+
+ +## Extensionless permalinks + +Jekyll supports permalinks that contain neither a trailing slash nor a file +extension, but this requires additional support from the web server to properly +serve. When using extensionless permalinks, output files written to disk will +still have the proper file extension (typically `.html`), so the web server +must be able to map requests without file extensions to these files. + +Both [GitHub Pages](../github-pages/) and the Jekyll's built-in WEBrick server +handle these requests properly without any additional work. + +### Apache + +The Apache web server has very extensive support for content negotiation and can +handle extensionless URLs by setting the [multiviews][] option in your +`httpd.conf` or `.htaccess` file: + +[multiviews]: https://httpd.apache.org/docs/current/content-negotiation.html#multiviews + +{% highlight apache %} +Options +MultiViews +{% endhighlight %} + +### Nginx + +The [try_files][] directive allows you to specify a list of files to search for +to process a request. The following configuration will instruct nginx to search +for a file with an `.html` extension if an exact match for the requested URI is +not found. + +[try_files]: http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files + +{% highlight nginx %} +try_files $uri $uri.html $uri/ =404; +{% endhighlight %} From 0014b1d9f07bc802de4adbc7b462b958c66451eb Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Thu, 29 Dec 2016 19:02:54 -0800 Subject: [PATCH 44/84] Update history to reflect merge of #5689 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 3bd4af8e..fde5160e 100644 --- a/History.markdown +++ b/History.markdown @@ -12,6 +12,7 @@ * Switch to `https` when possible. (#5611) * Update `_font-awesome.scss` to move .woff file before .ttf (#5614) * Update documentation on updating FontAwesome Iconset (#5655) + * Improve quickstart docs (#5689) ### Minor Enhancements From 0197b65e711fc8cab22170b43db06414d764a33e Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sat, 31 Dec 2016 13:44:17 -0800 Subject: [PATCH 45/84] Update history to reflect merge of #5705 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index fde5160e..834ddf9c 100644 --- a/History.markdown +++ b/History.markdown @@ -13,6 +13,7 @@ * Update `_font-awesome.scss` to move .woff file before .ttf (#5614) * Update documentation on updating FontAwesome Iconset (#5655) * Improve quickstart docs (#5689) + * Add Jekyll-Post to list of plugins (#5705) ### Minor Enhancements From b704df0245ef467017ac945d73f77dc278b1c3a4 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 1 Jan 2017 06:51:40 -0800 Subject: [PATCH 46/84] Update history to reflect merge of #5683 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 834ddf9c..f06792cd 100644 --- a/History.markdown +++ b/History.markdown @@ -44,6 +44,7 @@ * Improve Permalinks documentation. (#5653) * Fix typo in Variables doc page (#5657) * Fix a couple of typos in the docs (#5658) + * Update windows.md (#5683) ## 3.3.1 / 2016-11-14 From da1a36eff9b310c86b6295a1a6257e0d82c45acd Mon Sep 17 00:00:00 2001 From: Chase Date: Sun, 1 Jan 2017 18:20:45 -0500 Subject: [PATCH 47/84] update Classifier-Reborn to 2.1.0 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index fa254dff..eda95e5e 100644 --- a/Gemfile +++ b/Gemfile @@ -73,7 +73,7 @@ group :jekyll_optional_dependencies do gem "toml", "~> 0.1.0" platform :ruby, :mswin, :mingw, :x64_mingw do - gem "classifier-reborn", "~> 2.0" + gem "classifier-reborn", "~> 2.1.0" gem "liquid-c", "~> 3.0" gem "pygments.rb", "~> 0.6.0" gem "rdiscount", "~> 2.0" From 6ab6de7093e5319d164fed2ed068dd517583f185 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 1 Jan 2017 21:24:28 -0800 Subject: [PATCH 48/84] Update history to reflect merge of #5711 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index f06792cd..b6366cdb 100644 --- a/History.markdown +++ b/History.markdown @@ -35,6 +35,7 @@ * Rubocop -a on lib/jekyll (#5666) * Bump to rake 12.0 (#5670) * Rubocop Gemfile (#5671) + * update Classifier-Reborn to 2.1.0 (#5711) ### Documentation From de6d62b2e36ee110ab4e5807e9c78c1d99aa7d65 Mon Sep 17 00:00:00 2001 From: Chayoung You Date: Mon, 2 Jan 2017 22:07:03 +0900 Subject: [PATCH 49/84] Use the current year for the LICENSE of theme --- lib/theme_template/LICENSE.txt.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/theme_template/LICENSE.txt.erb b/lib/theme_template/LICENSE.txt.erb index df803135..38a0eb4e 100644 --- a/lib/theme_template/LICENSE.txt.erb +++ b/lib/theme_template/LICENSE.txt.erb @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 <%= user_name %> +Copyright (c) <%= Time.now.year %> <%= user_name %> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 7dce4e427036bc7f3a4c0d5d859adc85dfd68620 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 2 Jan 2017 08:17:08 -0800 Subject: [PATCH 50/84] Update history to reflect merge of #5712 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index b6366cdb..b294d518 100644 --- a/History.markdown +++ b/History.markdown @@ -19,6 +19,7 @@ * Add connector param to array_to_sentence_string filter (#5597) * Adds group_by_exp filter (#5513) + * Use the current year for the LICENSE of theme (#5712) ### Bug Fixes From fb75f4031c800224796e1d95c892488a9f83e027 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 2 Jan 2017 08:59:24 -0800 Subject: [PATCH 51/84] Update history to reflect merge of #5693 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index b294d518..c40f0ee0 100644 --- a/History.markdown +++ b/History.markdown @@ -47,6 +47,7 @@ * Fix typo in Variables doc page (#5657) * Fix a couple of typos in the docs (#5658) * Update windows.md (#5683) + * Improve permalinks docs (#5693) ## 3.3.1 / 2016-11-14 From 9fb63552644d2a4ba05e7f9d59be263ac2ca1377 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 2 Jan 2017 23:14:27 +0100 Subject: [PATCH 52/84] bump year - Adding Jekyll contributors, following @benbalter advice. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 94dbfc39..e177b1bf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2008-2016 Tom Preston-Werner +Copyright (c) 2008-2017 Tom Preston-Werner and Jekyll contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 7cded91a7cf1c761a0059c7e589f2cfb1149f182 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 3 Jan 2017 00:30:54 -0800 Subject: [PATCH 53/84] Update history to reflect merge of #5713 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index c40f0ee0..46e7ba82 100644 --- a/History.markdown +++ b/History.markdown @@ -20,6 +20,7 @@ * Add connector param to array_to_sentence_string filter (#5597) * Adds group_by_exp filter (#5513) * Use the current year for the LICENSE of theme (#5712) + * Update License (#5713) ### Bug Fixes From be12be34119312b2d518c9448cee435c941b19bb Mon Sep 17 00:00:00 2001 From: Skylar Challand Date: Thu, 5 Jan 2017 15:04:42 -0500 Subject: [PATCH 54/84] Add undocumented --unpublished build option via https://github.com/jekyll/jekyll/blob/57fd5f887da1189a16bdfbb982d75f725c38d725/lib/jekyll/command.rb#L63-L64 --- docs/_docs/configuration.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/_docs/configuration.md b/docs/_docs/configuration.md index 9dca5cea..9df1c85f 100644 --- a/docs/_docs/configuration.md +++ b/docs/_docs/configuration.md @@ -221,6 +221,16 @@ class="flag">flags (specified on the command-line) that control them.

--future

+ + +

Unpublished

+

Render posts that were marked as unpublished.

+ + +

unpublished: BOOL

+

--unpublished

+ +

LSI

From 4b51c1da587051a8a222a103d9fd196285d4d89d Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Thu, 5 Jan 2017 17:08:04 -0600 Subject: [PATCH 55/84] Use `assert_nil` --- test/test_front_matter_defaults.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_front_matter_defaults.rb b/test/test_front_matter_defaults.rb index 93cbf4b4..30c713ac 100644 --- a/test/test_front_matter_defaults.rb +++ b/test/test_front_matter_defaults.rb @@ -21,7 +21,7 @@ class TestFrontMatterDefaults < JekyllUnitTest should "affect only the specified path and type" do assert_equal @affected.data["key"], "val" - assert_equal @not_affected.data["key"], nil + assert_nil @not_affected.data["key"] end end @@ -45,7 +45,7 @@ class TestFrontMatterDefaults < JekyllUnitTest should "affect only the specified path" do assert_equal @affected.data["key"], "val" - assert_equal @not_affected.data["key"], nil + assert_nil @not_affected.data["key"] end end @@ -69,7 +69,7 @@ class TestFrontMatterDefaults < JekyllUnitTest should "affect only the specified path and all types" do assert_equal @affected.data["key"], "val" - assert_equal @not_affected.data["key"], nil + assert_nil @not_affected.data["key"] end end From 6fb05e07999e9dcd69eaf0597cb33ce10bda1b01 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Thu, 5 Jan 2017 17:44:54 -0600 Subject: [PATCH 56/84] Use Addressable instead of URI to decode --- lib/jekyll/filters.rb | 4 ++-- lib/jekyll/url.rb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index 43e01df1..808632ba 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -1,4 +1,4 @@ -require "uri" +require "addressable/uri" require "json" require "date" require "liquid" @@ -152,7 +152,7 @@ module Jekyll # # Returns the escaped String. def uri_escape(input) - URI.escape(input) + Addressable::URI.encode(input) end # Replace any whitespace in the input string with a single space diff --git a/lib/jekyll/url.rb b/lib/jekyll/url.rb index 4504574f..c630b539 100644 --- a/lib/jekyll/url.rb +++ b/lib/jekyll/url.rb @@ -1,3 +1,4 @@ +require "addressable/uri" require "uri" # Public: Methods that generate a URL for a resource such as a Post or a Page. @@ -159,7 +160,7 @@ module Jekyll # # Returns the unescaped path. def self.unescape_path(path) - URI.unescape(path.encode("utf-8")) + Addressable::URI.unencode(path.encode("utf-8")) end end end From 5652c10305f204299544869e95f41d3b5a451328 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Thu, 5 Jan 2017 18:01:00 -0600 Subject: [PATCH 57/84] Try to replace `URI.escape` with Addressable --- lib/jekyll/url.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/url.rb b/lib/jekyll/url.rb index c630b539..072ea8cd 100644 --- a/lib/jekyll/url.rb +++ b/lib/jekyll/url.rb @@ -1,5 +1,4 @@ require "addressable/uri" -require "uri" # Public: Methods that generate a URL for a resource such as a Post or a Page. # @@ -146,7 +145,8 @@ module Jekyll # pct-encoded = "%" HEXDIG HEXDIG # sub-delims = "!" / "$" / "&" / "'" / "(" / ")" # / "*" / "+" / "," / ";" / "=" - URI.escape(path, %r{[^a-zA-Z\d\-._~!$&'()*+,;=:@\/]}).encode("utf-8") + path = Addressable::URI.encode(path) + path.encode("utf-8") end # Unescapes a URL path segment From 1e4b779ab372f610fb6c510c7570122146357171 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Thu, 5 Jan 2017 18:34:44 -0600 Subject: [PATCH 58/84] Escape # --- lib/jekyll/url.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/url.rb b/lib/jekyll/url.rb index 072ea8cd..aefbebc9 100644 --- a/lib/jekyll/url.rb +++ b/lib/jekyll/url.rb @@ -146,7 +146,7 @@ module Jekyll # sub-delims = "!" / "$" / "&" / "'" / "(" / ")" # / "*" / "+" / "," / ";" / "=" path = Addressable::URI.encode(path) - path.encode("utf-8") + path.encode("utf-8").sub("#", "%23") end # Unescapes a URL path segment From 657e502a72cb8f699e2179fbc3f669b76e567665 Mon Sep 17 00:00:00 2001 From: muratayusuke Date: Sun, 25 Dec 2016 14:09:57 +0900 Subject: [PATCH 59/84] Add jekyll-numbered-headings --- docs/_docs/plugins.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_docs/plugins.md b/docs/_docs/plugins.md index 775dabbf..0eda5ca1 100644 --- a/docs/_docs/plugins.md +++ b/docs/_docs/plugins.md @@ -919,6 +919,7 @@ LESS.js files during generation. - [jekyll-pinboard](https://github.com/snaptortoise/jekyll-pinboard-plugin): Access your Pinboard bookmarks within your Jekyll theme. - [jekyll-migrate-permalink](https://github.com/mpchadwick/jekyll-migrate-permalink): Adds a `migrate-permalink` sub-command to help deal with side effects of changing your permalink. - [Jekyll-Post](https://github.com/robcrocombe/jekyll-post): A CLI tool to easily draft, edit, and publish Jekyll posts. +- [jekyll-numbered-headings](https://github.com/muratayusuke/jekyll-numbered-headings): Adds ordered number to headings. #### Editors From 91776d1dc7cc21019286d069f88457dc10ef125e Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Fri, 6 Jan 2017 01:56:29 -0800 Subject: [PATCH 60/84] Update history to reflect merge of #5688 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 46e7ba82..269eeae8 100644 --- a/History.markdown +++ b/History.markdown @@ -14,6 +14,7 @@ * Update documentation on updating FontAwesome Iconset (#5655) * Improve quickstart docs (#5689) * Add Jekyll-Post to list of plugins (#5705) + * Add jekyll-numbered-headings (#5688) ### Minor Enhancements From 08cec6889abc6073a4ac47eea160d8e820bddcf0 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Fri, 6 Jan 2017 02:14:53 -0800 Subject: [PATCH 61/84] Update history to reflect merge of #5720 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 269eeae8..d0bec0a1 100644 --- a/History.markdown +++ b/History.markdown @@ -50,6 +50,7 @@ * Fix a couple of typos in the docs (#5658) * Update windows.md (#5683) * Improve permalinks docs (#5693) + * Document --unpublished build option (#5720) ## 3.3.1 / 2016-11-14 From e126d161352086fe80bfc4be1dc6db1ae754d38c Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sat, 7 Jan 2017 03:37:48 -0800 Subject: [PATCH 62/84] Update history to reflect merge of #5726 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index d0bec0a1..9df69b01 100644 --- a/History.markdown +++ b/History.markdown @@ -22,6 +22,7 @@ * Adds group_by_exp filter (#5513) * Use the current year for the LICENSE of theme (#5712) * Update License (#5713) + * Use Addressable instead of URI to decode (#5726) ### Bug Fixes From 61e5aa7728d95b41eccb06fd162b7f03bd799d97 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 8 Jan 2017 04:50:02 -0800 Subject: [PATCH 63/84] Update history to reflect merge of #5544 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 9df69b01..8335a37f 100644 --- a/History.markdown +++ b/History.markdown @@ -15,6 +15,7 @@ * Improve quickstart docs (#5689) * Add Jekyll-Post to list of plugins (#5705) * Add jekyll-numbered-headings (#5688) + * Docs: move permalinks from documents into config (#5544) ### Minor Enhancements From 0f9a4ac07292bd4db035fb1e250af3c20391e13c Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 8 Jan 2017 06:02:31 -0800 Subject: [PATCH 64/84] Update history to reflect merge of #5692 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 8335a37f..3b570492 100644 --- a/History.markdown +++ b/History.markdown @@ -53,6 +53,7 @@ * Update windows.md (#5683) * Improve permalinks docs (#5693) * Document --unpublished build option (#5720) + * Improve pages docs (#5692) ## 3.3.1 / 2016-11-14 From dd397b6c4b24da613bce20c303151a9292cb4a78 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 8 Jan 2017 06:06:08 -0800 Subject: [PATCH 65/84] Update history to reflect merge of #5696 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 3b570492..b75a9f15 100644 --- a/History.markdown +++ b/History.markdown @@ -54,6 +54,7 @@ * Improve permalinks docs (#5693) * Document --unpublished build option (#5720) * Improve pages docs (#5692) + * Added new includes.md topic to docs (#5696) ## 3.3.1 / 2016-11-14 From 6cd388b2ab03658789bb093ef84ebdf67dfadfd8 Mon Sep 17 00:00:00 2001 From: Longwelwind Date: Sun, 8 Jan 2017 23:12:45 +0100 Subject: [PATCH 66/84] Replace a dead link with a web-archived one --- docs/_docs/extras.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/extras.md b/docs/_docs/extras.md index 83e79963..9064d967 100644 --- a/docs/_docs/extras.md +++ b/docs/_docs/extras.md @@ -15,7 +15,7 @@ Kramdown comes with optional support for LaTeX to PNG rendering via [MathJax](ht ``` -For more information about getting started, check out [this excellent blog post](http://gastonsanchez.com/opinion/2014/02/16/Mathjax-with-jekyll/). +For more information about getting started, check out [this excellent blog post](https://web.archive.org/web/20160522225559/http://gastonsanchez.com/opinion/2014/02/16/Mathjax-with-jekyll). ## Alternative Markdown Processors From 5ef6edb97770f9fc73c1a161d129a37daca499f1 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 8 Jan 2017 14:51:30 -0800 Subject: [PATCH 67/84] Update history to reflect merge of #5738 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index b75a9f15..baf346a1 100644 --- a/History.markdown +++ b/History.markdown @@ -55,6 +55,7 @@ * Document --unpublished build option (#5720) * Improve pages docs (#5692) * Added new includes.md topic to docs (#5696) + * Replace a dead link with a web-archived one (#5738) ## 3.3.1 / 2016-11-14 From 0ebc832e1b21b712f108ad0892c869be2893ef85 Mon Sep 17 00:00:00 2001 From: Kurt Anderson Date: Mon, 9 Jan 2017 08:01:58 -0500 Subject: [PATCH 68/84] Remove duplicate paragraph. --- docs/_docs/github-pages.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/_docs/github-pages.md b/docs/_docs/github-pages.md index 710f702e..0a00f2fa 100644 --- a/docs/_docs/github-pages.md +++ b/docs/_docs/github-pages.md @@ -132,12 +132,6 @@ stored in a specially named `gh-pages` branch or in a `docs` folder on the will become available under a subpath of your user pages subdomain, such as `username.github.io/project` (unless a custom domain is specified). -The Jekyll project repository itself is a perfect example: the -[master branch]({{ site.repository }}) contains the actual software project -for Jekyll, however the Jekyll website (that you’re looking at right now) is -contained in the [docs folder]({{ site.repository }}/tree/master/docs) of the -same repository. - The Jekyll project repository itself is a perfect example of this branch structure—the [master branch]({{ site.repository }}) contains the actual software project for Jekyll, and the Jekyll website that you’re From 74fe613072d377c747ab37a4cc47f08f91a922b3 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 9 Jan 2017 05:16:12 -0800 Subject: [PATCH 69/84] Update history to reflect merge of #5740 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index baf346a1..c0764538 100644 --- a/History.markdown +++ b/History.markdown @@ -56,6 +56,7 @@ * Improve pages docs (#5692) * Added new includes.md topic to docs (#5696) * Replace a dead link with a web-archived one (#5738) + * Remove duplicate paragraph. (#5740) ## 3.3.1 / 2016-11-14 From 8a5672fdffd87e586c2f97b5f77b7ca7aa7c53c2 Mon Sep 17 00:00:00 2001 From: Kenton Hansen Date: Mon, 10 Oct 2016 15:55:40 -0500 Subject: [PATCH 70/84] Addition of a sample "typical post" So, I thought this section in the docs would be a good place to put the anatomy of a post .md file. --- site/_docs/posts.md | 255 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 site/_docs/posts.md diff --git a/site/_docs/posts.md b/site/_docs/posts.md new file mode 100644 index 00000000..bc8628c9 --- /dev/null +++ b/site/_docs/posts.md @@ -0,0 +1,255 @@ +--- +layout: docs +title: Writing posts +permalink: /docs/posts/ +--- + +One of Jekyll’s best aspects is that it is “blog aware”. What does this mean, +exactly? Well, simply put, it means that blogging is baked into Jekyll’s +functionality. If you write articles and publish them online, you can publish +and maintain a blog simply by managing a folder of text-files on your computer. +Compared to the hassle of configuring and maintaining databases and web-based +CMS systems, this will be a welcome change! + +## The Posts Folder + +As explained on the [directory structure](../structure/) page, the `_posts` +folder is where your blog posts will live. These files are generally +[Markdown](https://daringfireball.net/projects/markdown/) or HTML, but can +be other formats with the proper converter installed. +All posts must have [YAML Front Matter](../frontmatter/), and they will be +converted from their source format into an HTML page that is part of your +static site. + +### Creating Post Files + +To create a new post, all you need to do is create a file in the `_posts` +directory. How you name files in this folder is important. Jekyll requires blog +post files to be named according to the following format: + +```sh +YEAR-MONTH-DAY-title.MARKUP +``` + +Where `YEAR` is a four-digit number, `MONTH` and `DAY` are both two-digit +numbers, and `MARKUP` is the file extension representing the format used in the +file. For example, the following are examples of valid post filenames: + +```sh +2011-12-31-new-years-eve-is-awesome.md +2012-09-12-how-to-write-a-blog.md +``` + +
+
ProTip™: Link to other posts
+

+ Use the post_url + tag to link to other posts without having to worry about the URL's + breaking when the site permalink style changes. +

+
+ +### Content Formats + +All blog post files must begin with [YAML Front Matter](../frontmatter/). After +that, it's simply a matter of deciding which format you prefer. Jekyll supports +[Markdown](https://daringfireball.net/projects/markdown/) out of the box, +and has [myriad extensions for other formats as well](/docs/plugins/#converters-1), +including the popular [Textile](http://redcloth.org/textile) format. These +formats each have their own way of marking up different types of content +within a post, so you should familiarize yourself with these formats and +decide which one best suits your needs. + +
+
Be aware of character sets
+

+ Content processors can modify certain characters to make them look nicer. + For example, the smart extension in Redcarpet converts standard, + ASCII quotation characters to curly, Unicode ones. In order for the browser + to display those characters properly, define the charset meta value by + including <meta charset="utf-8"> in the + <head> of your layout. +

+
+ +## Including images and resources + +Chances are, at some point, you'll want to include images, downloads, or other +digital assets along with your text content. While the syntax for linking to +these resources differs between Markdown and Textile, the problem of working +out where to store these files in your site is something everyone will face. + +Because of Jekyll’s flexibility, there are many solutions to how to do this. +One common solution is to create a folder in the root of the project directory +called something like `assets` or `downloads`, into which any images, downloads +or other resources are placed. Then, from within any post, they can be linked +to using the site’s root as the path for the asset to include. Again, this will +depend on the way your site’s (sub)domain and path are configured, but here are +some examples (in Markdown) of how you could do this using the `site.url` +variable in a post. + +Including an image asset in a post: + +```text +... which is shown in the screenshot below: +![My helpful screenshot]({% raw %}{{ site.url }}{% endraw %}/assets/screenshot.jpg) +``` + +Linking to a PDF for readers to download: + +```text +... you can [get the PDF]({% raw %}{{ site.url }}{% endraw %}/assets/mydoc.pdf) directly. +``` + +
+
ProTip™: Link using just the site root URL
+

+ You can skip the {% raw %}{{ site.url }}{% endraw %} variable + if you know your site will only ever be displayed at the + root URL of your domain. In this case you can reference assets directly with + just /path/file.jpg. +

+
+ +## A typical post + +Jekyll can handle many different iterations of the idea you might associate with a "post," however a standard blog style post, including an Title, Layout, Publishing Date, and Categories might look like this: + +``` +--- +layout: post +title: "Welcome to Jekyll!" +date: 2015-11-17 16:16:01 -0600 +categories: jekyll update +--- +You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. + +To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. + +``` +Everything in between the first and second `---` are part of the YAML Front Matter, and everything after the second `---` will be rendered with Markdown and show up as "Content." + +## Displaying an index of posts + +It’s all well and good to have posts in a folder, but a blog is no use unless +you have a list of posts somewhere. Creating an index of posts on another page +(or in a [template](../templates/)) is easy, thanks to the [Liquid template +language](https://docs.shopify.com/themes/liquid/basics) and its tags. Here’s a +basic example of how to create a list of links to your blog posts: + +```html + +``` + +Of course, you have full control over how (and where) you display your posts, +and how you structure your site. You should read more about [how templates +work](../templates/) with Jekyll if you want to know more. + +Note that the `post` variable only exists inside the `for` loop above. If +you wish to access the currently-rendering page/posts's variables (the +variables of the post/page that has the `for` loop in it), use the `page` +variable instead. + +## Post excerpts + +Each post automatically takes the first block of text, from the beginning of +the content to the first occurrence of `excerpt_separator`, and sets it as the `post.excerpt`. +Take the above example of an index of posts. Perhaps you want to include +a little hint about the post's content by adding the first paragraph of each of +your posts: + +```html + +``` + +Because Jekyll grabs the first paragraph you will not need to wrap the excerpt +in `p` tags, which is already done for you. These tags can be removed with the +following if you'd prefer: + +```html +{% raw %}{{ post.excerpt | remove: '

' | remove: '

' }}{% endraw %} +``` + +If you don't like the automatically-generated post excerpt, it can be +explicitly overridden by adding an `excerpt` value to your post's YAML +Front Matter. Alternatively, you can choose to define a custom +`excerpt_separator` in the post's YAML front matter: + +```text +--- +excerpt_separator: +--- + +Excerpt + +Out-of-excerpt +``` + +You can also set the `excerpt_separator` globally in your `_config.yml` +configuration file. + +Completely disable excerpts by setting your `excerpt_separator` to `""`. + +Also, as with any output generated by Liquid tags, you can pass the +`| strip_html` filter to remove any html tags in the output. This is +particularly helpful if you wish to output a post excerpt as a +`meta="description"` tag within the post `head`, or anywhere else having +html tags along with the content is not desirable. + +## Highlighting code snippets + +Jekyll also has built-in support for syntax highlighting of code snippets using +either Pygments or Rouge, and including a code snippet in any post is easy. +Just use the dedicated Liquid tag as follows: + +```text +{% raw %}{% highlight ruby %}{% endraw %} +def show + @widget = Widget(params[:id]) + respond_to do |format| + format.html # show.html.erb + format.json { render json: @widget } + end +end +{% raw %}{% endhighlight %}{% endraw %} +``` + +And the output will look like this: + +```ruby +def show + @widget = Widget(params[:id]) + respond_to do |format| + format.html # show.html.erb + format.json { render json: @widget } + end +end +``` + +
+
ProTip™: Show line numbers
+

+ You can make code snippets include line-numbers by adding the word + linenos to the end of the opening highlight tag like this: + {% raw %}{% highlight ruby linenos %}{% endraw %}. +

+
+ +These basics should be enough to get you started writing your first posts. When +you’re ready to dig into what else is possible, you might be interested in +doing things like [customizing post permalinks](../permalinks/) or +using [custom variables](../variables/) in your posts and elsewhere on your +site. From b1291605b36d978f0fab9fcc7de48879a67ace86 Mon Sep 17 00:00:00 2001 From: Kenton Hansen Date: Mon, 10 Oct 2016 16:46:42 -0500 Subject: [PATCH 71/84] Changes to 'bundle exec jekyll serve' Updated to be consistent with the rest of documentation. --- site/_docs/posts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/posts.md b/site/_docs/posts.md index bc8628c9..d4d8f15d 100644 --- a/site/_docs/posts.md +++ b/site/_docs/posts.md @@ -122,7 +122,7 @@ title: "Welcome to Jekyll!" date: 2015-11-17 16:16:01 -0600 categories: jekyll update --- -You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. +You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `bundle exec jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. From e60769731afc143ca3e2b7fc082be5ec17e16ad9 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 9 Jan 2017 15:25:59 +0100 Subject: [PATCH 72/84] Report modifications to docs --- docs/_docs/posts.md | 18 ++++ site/_docs/posts.md | 255 -------------------------------------------- 2 files changed, 18 insertions(+), 255 deletions(-) delete mode 100644 site/_docs/posts.md diff --git a/docs/_docs/posts.md b/docs/_docs/posts.md index 40aa8365..d4d8f15d 100644 --- a/docs/_docs/posts.md +++ b/docs/_docs/posts.md @@ -111,6 +111,24 @@ Linking to a PDF for readers to download:

+## A typical post + +Jekyll can handle many different iterations of the idea you might associate with a "post," however a standard blog style post, including an Title, Layout, Publishing Date, and Categories might look like this: + +``` +--- +layout: post +title: "Welcome to Jekyll!" +date: 2015-11-17 16:16:01 -0600 +categories: jekyll update +--- +You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `bundle exec jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. + +To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. + +``` +Everything in between the first and second `---` are part of the YAML Front Matter, and everything after the second `---` will be rendered with Markdown and show up as "Content." + ## Displaying an index of posts It’s all well and good to have posts in a folder, but a blog is no use unless diff --git a/site/_docs/posts.md b/site/_docs/posts.md deleted file mode 100644 index d4d8f15d..00000000 --- a/site/_docs/posts.md +++ /dev/null @@ -1,255 +0,0 @@ ---- -layout: docs -title: Writing posts -permalink: /docs/posts/ ---- - -One of Jekyll’s best aspects is that it is “blog aware”. What does this mean, -exactly? Well, simply put, it means that blogging is baked into Jekyll’s -functionality. If you write articles and publish them online, you can publish -and maintain a blog simply by managing a folder of text-files on your computer. -Compared to the hassle of configuring and maintaining databases and web-based -CMS systems, this will be a welcome change! - -## The Posts Folder - -As explained on the [directory structure](../structure/) page, the `_posts` -folder is where your blog posts will live. These files are generally -[Markdown](https://daringfireball.net/projects/markdown/) or HTML, but can -be other formats with the proper converter installed. -All posts must have [YAML Front Matter](../frontmatter/), and they will be -converted from their source format into an HTML page that is part of your -static site. - -### Creating Post Files - -To create a new post, all you need to do is create a file in the `_posts` -directory. How you name files in this folder is important. Jekyll requires blog -post files to be named according to the following format: - -```sh -YEAR-MONTH-DAY-title.MARKUP -``` - -Where `YEAR` is a four-digit number, `MONTH` and `DAY` are both two-digit -numbers, and `MARKUP` is the file extension representing the format used in the -file. For example, the following are examples of valid post filenames: - -```sh -2011-12-31-new-years-eve-is-awesome.md -2012-09-12-how-to-write-a-blog.md -``` - -
-
ProTip™: Link to other posts
-

- Use the post_url - tag to link to other posts without having to worry about the URL's - breaking when the site permalink style changes. -

-
- -### Content Formats - -All blog post files must begin with [YAML Front Matter](../frontmatter/). After -that, it's simply a matter of deciding which format you prefer. Jekyll supports -[Markdown](https://daringfireball.net/projects/markdown/) out of the box, -and has [myriad extensions for other formats as well](/docs/plugins/#converters-1), -including the popular [Textile](http://redcloth.org/textile) format. These -formats each have their own way of marking up different types of content -within a post, so you should familiarize yourself with these formats and -decide which one best suits your needs. - -
-
Be aware of character sets
-

- Content processors can modify certain characters to make them look nicer. - For example, the smart extension in Redcarpet converts standard, - ASCII quotation characters to curly, Unicode ones. In order for the browser - to display those characters properly, define the charset meta value by - including <meta charset="utf-8"> in the - <head> of your layout. -

-
- -## Including images and resources - -Chances are, at some point, you'll want to include images, downloads, or other -digital assets along with your text content. While the syntax for linking to -these resources differs between Markdown and Textile, the problem of working -out where to store these files in your site is something everyone will face. - -Because of Jekyll’s flexibility, there are many solutions to how to do this. -One common solution is to create a folder in the root of the project directory -called something like `assets` or `downloads`, into which any images, downloads -or other resources are placed. Then, from within any post, they can be linked -to using the site’s root as the path for the asset to include. Again, this will -depend on the way your site’s (sub)domain and path are configured, but here are -some examples (in Markdown) of how you could do this using the `site.url` -variable in a post. - -Including an image asset in a post: - -```text -... which is shown in the screenshot below: -![My helpful screenshot]({% raw %}{{ site.url }}{% endraw %}/assets/screenshot.jpg) -``` - -Linking to a PDF for readers to download: - -```text -... you can [get the PDF]({% raw %}{{ site.url }}{% endraw %}/assets/mydoc.pdf) directly. -``` - -
-
ProTip™: Link using just the site root URL
-

- You can skip the {% raw %}{{ site.url }}{% endraw %} variable - if you know your site will only ever be displayed at the - root URL of your domain. In this case you can reference assets directly with - just /path/file.jpg. -

-
- -## A typical post - -Jekyll can handle many different iterations of the idea you might associate with a "post," however a standard blog style post, including an Title, Layout, Publishing Date, and Categories might look like this: - -``` ---- -layout: post -title: "Welcome to Jekyll!" -date: 2015-11-17 16:16:01 -0600 -categories: jekyll update ---- -You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `bundle exec jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. - -To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. - -``` -Everything in between the first and second `---` are part of the YAML Front Matter, and everything after the second `---` will be rendered with Markdown and show up as "Content." - -## Displaying an index of posts - -It’s all well and good to have posts in a folder, but a blog is no use unless -you have a list of posts somewhere. Creating an index of posts on another page -(or in a [template](../templates/)) is easy, thanks to the [Liquid template -language](https://docs.shopify.com/themes/liquid/basics) and its tags. Here’s a -basic example of how to create a list of links to your blog posts: - -```html - -``` - -Of course, you have full control over how (and where) you display your posts, -and how you structure your site. You should read more about [how templates -work](../templates/) with Jekyll if you want to know more. - -Note that the `post` variable only exists inside the `for` loop above. If -you wish to access the currently-rendering page/posts's variables (the -variables of the post/page that has the `for` loop in it), use the `page` -variable instead. - -## Post excerpts - -Each post automatically takes the first block of text, from the beginning of -the content to the first occurrence of `excerpt_separator`, and sets it as the `post.excerpt`. -Take the above example of an index of posts. Perhaps you want to include -a little hint about the post's content by adding the first paragraph of each of -your posts: - -```html - -``` - -Because Jekyll grabs the first paragraph you will not need to wrap the excerpt -in `p` tags, which is already done for you. These tags can be removed with the -following if you'd prefer: - -```html -{% raw %}{{ post.excerpt | remove: '

' | remove: '

' }}{% endraw %} -``` - -If you don't like the automatically-generated post excerpt, it can be -explicitly overridden by adding an `excerpt` value to your post's YAML -Front Matter. Alternatively, you can choose to define a custom -`excerpt_separator` in the post's YAML front matter: - -```text ---- -excerpt_separator: ---- - -Excerpt - -Out-of-excerpt -``` - -You can also set the `excerpt_separator` globally in your `_config.yml` -configuration file. - -Completely disable excerpts by setting your `excerpt_separator` to `""`. - -Also, as with any output generated by Liquid tags, you can pass the -`| strip_html` filter to remove any html tags in the output. This is -particularly helpful if you wish to output a post excerpt as a -`meta="description"` tag within the post `head`, or anywhere else having -html tags along with the content is not desirable. - -## Highlighting code snippets - -Jekyll also has built-in support for syntax highlighting of code snippets using -either Pygments or Rouge, and including a code snippet in any post is easy. -Just use the dedicated Liquid tag as follows: - -```text -{% raw %}{% highlight ruby %}{% endraw %} -def show - @widget = Widget(params[:id]) - respond_to do |format| - format.html # show.html.erb - format.json { render json: @widget } - end -end -{% raw %}{% endhighlight %}{% endraw %} -``` - -And the output will look like this: - -```ruby -def show - @widget = Widget(params[:id]) - respond_to do |format| - format.html # show.html.erb - format.json { render json: @widget } - end -end -``` - -
-
ProTip™: Show line numbers
-

- You can make code snippets include line-numbers by adding the word - linenos to the end of the opening highlight tag like this: - {% raw %}{% highlight ruby linenos %}{% endraw %}. -

-
- -These basics should be enough to get you started writing your first posts. When -you’re ready to dig into what else is possible, you might be interested in -doing things like [customizing post permalinks](../permalinks/) or -using [custom variables](../variables/) in your posts and elsewhere on your -site. From 86fc58491c494c6acfb25d5e6a8d9f4a4c6c754f Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 9 Jan 2017 06:36:52 -0800 Subject: [PATCH 73/84] Update history to reflect merge of #5473 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index c0764538..b578b9bf 100644 --- a/History.markdown +++ b/History.markdown @@ -57,6 +57,7 @@ * Added new includes.md topic to docs (#5696) * Replace a dead link with a web-archived one (#5738) * Remove duplicate paragraph. (#5740) + * Addition of a sample "typical post" (#5473) ## 3.3.1 / 2016-11-14 From 0c9c236c4863c996043d7eed068a324d4e421bf9 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 9 Jan 2017 21:31:57 +0100 Subject: [PATCH 74/84] rubocup -a --- Rakefile | 68 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/Rakefile b/Rakefile index 58aecfaf..5353717e 100644 --- a/Rakefile +++ b/Rakefile @@ -1,13 +1,13 @@ -require 'rubygems' -require 'rake' -require 'rdoc' -require 'date' -require 'yaml' +require "rubygems" +require "rake" +require "rdoc" +require "date" +require "yaml" -$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[lib])) -require 'jekyll/version' +$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "lib")) +require "jekyll/version" -Dir.glob('rake/**.rake').each { |f| import f } +Dir.glob("rake/**.rake").each { |f| import f } ############################################################################# # @@ -36,21 +36,21 @@ def gemspec_file end def gem_file - "#{name}-#{Gem::Version.new(version).to_s}.gem" + "#{name}-#{Gem::Version.new(version)}.gem" end def normalize_bullets(markdown) - markdown.gsub(/\n\s{2}\*{1}/, "\n-") + markdown.gsub(%r!\n\s{2}\*{1}!, "\n-") end def linkify_prs(markdown) - markdown.gsub(/#(\d+)/) do |word| + markdown.gsub(%r!#(\d+)!) do |word| "[#{word}]({{ site.repository }}/issues/#{word.delete("#")})" end end def linkify_users(markdown) - markdown.gsub(/(@\w+)/) do |username| + markdown.gsub(%r!(@\w+)!) do |username| "[#{username}](https://github.com/#{username.delete("@")})" end end @@ -60,13 +60,13 @@ def linkify(markdown) end def liquid_escape(markdown) - markdown.gsub(/(`{[{%].+[}%]}`)/, "{% raw %}\\1{% endraw %}") + markdown.gsub(%r!(`{[{%].+[}%]}`)!, "{% raw %}\\1{% endraw %}") end def custom_release_header_anchors(markdown) - header_regexp = /^(\d{1,2})\.(\d{1,2})\.(\d{1,2}) \/ \d{4}-\d{2}-\d{2}/ - section_regexp = /^### \w+ \w+$/ - markdown.split(/^##\s/).map do |release_notes| + header_regexp = %r!^(\d{1,2})\.(\d{1,2})\.(\d{1,2}) \/ \d{4}-\d{2}-\d{2}! + section_regexp = %r!^### \w+ \w+$! + markdown.split(%r!^##\s!).map do |release_notes| _, major, minor, patch = *release_notes.match(header_regexp) release_notes .gsub(header_regexp, "\\0\n{: #v\\1-\\2-\\3}") @@ -75,11 +75,11 @@ def custom_release_header_anchors(markdown) end def sluffigy(header) - header.gsub(/#/, '').strip.downcase.gsub(/\s+/, '-') + header.delete("#").strip.downcase.gsub(%r!\s+!, "-") end def remove_head_from_history(markdown) - index = markdown =~ /^##\s+\d+\.\d+\.\d+/ + index = markdown =~ %r!^##\s+\d+\.\d+\.\d+! markdown[index..-1] end @@ -88,13 +88,17 @@ def converted_history(markdown) custom_release_header_anchors( liquid_escape( linkify( - normalize_bullets(markdown))))) + normalize_bullets(markdown) + ) + ) + ) + ) end def siteify_file(file, overrides_front_matter = {}) - abort "You seem to have misplaced your #{file} file. I can haz?" unless File.exists?(file) + abort "You seem to have misplaced your #{file} file. I can haz?" unless File.exist?(file) title = begin - File.read(file).match(/\A# (.*)$/)[1] + File.read(file).match(%r!\A# (.*)$!)[1] rescue File.basename(file, ".*").downcase.capitalize end @@ -115,7 +119,7 @@ def content_for(file) when "History.markdown" converted_history(contents) else - contents.gsub(/\A# .*\n\n?/, "") + contents.gsub(%r!\A# .*\n\n?!, "") end end @@ -128,23 +132,23 @@ end multitask :default => [:test, :features] task :spec => :test -require 'rake/testtask' +require "rake/testtask" Rake::TestTask.new(:test) do |test| - test.libs << 'lib' << 'test' - test.pattern = 'test/**/test_*.rb' + test.libs << "lib" << "test" + test.pattern = "test/**/test_*.rb" test.verbose = true end -require 'rdoc/task' +require "rdoc/task" Rake::RDocTask.new do |rdoc| - rdoc.rdoc_dir = 'rdoc' + rdoc.rdoc_dir = "rdoc" rdoc.title = "#{name} #{version}" - rdoc.rdoc_files.include('README*') - rdoc.rdoc_files.include('lib/**/*.rb') + rdoc.rdoc_files.include("README*") + rdoc.rdoc_files.include("lib/**/*.rb") end begin - require 'cucumber/rake/task' + require "cucumber/rake/task" Cucumber::Rake::Task.new(:features) do |t| t.profile = "travis" end @@ -152,9 +156,9 @@ begin t.profile = "html_report" end rescue LoadError - desc 'Cucumber rake task not available' + desc "Cucumber rake task not available" task :features do - abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' + abort "Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin" end end From 8bf9c37cf5f03fe6975f462531959d4bc5978a5b Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 9 Jan 2017 21:32:11 +0100 Subject: [PATCH 75/84] rubocop -a --- jekyll.gemspec | 52 +++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/jekyll.gemspec b/jekyll.gemspec index 734df2e4..ca12fa0d 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -1,42 +1,42 @@ # coding: utf-8 -lib = File.expand_path('../lib', __FILE__) +lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'jekyll/version' +require "jekyll/version" Gem::Specification.new do |s| s.specification_version = 2 if s.respond_to? :specification_version= - s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version= - s.rubygems_version = '2.2.2' - s.required_ruby_version = '>= 2.0.0' + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.rubygems_version = "2.2.2" + s.required_ruby_version = ">= 2.0.0" - s.name = 'jekyll' + s.name = "jekyll" s.version = Jekyll::VERSION - s.license = 'MIT' + s.license = "MIT" - s.summary = 'A simple, blog aware, static site generator.' - s.description = 'Jekyll is a simple, blog aware, static site generator.' + s.summary = "A simple, blog aware, static site generator." + s.description = "Jekyll is a simple, blog aware, static site generator." - s.authors = ['Tom Preston-Werner'] - s.email = 'tom@mojombo.com' - s.homepage = 'https://github.com/jekyll/jekyll' + s.authors = ["Tom Preston-Werner"] + s.email = "tom@mojombo.com" + s.homepage = "https://github.com/jekyll/jekyll" all_files = `git ls-files -z`.split("\x0") - s.files = all_files.grep(%r{^(exe|lib)/|^.rubocop.yml$}) - s.executables = all_files.grep(%r{^exe/}) { |f| File.basename(f) } + s.files = all_files.grep(%r!^(exe|lib)/|^.rubocop.yml$!) + s.executables = all_files.grep(%r!^exe/!) { |f| File.basename(f) } s.bindir = "exe" - s.require_paths = ['lib'] + s.require_paths = ["lib"] - s.rdoc_options = ['--charset=UTF-8'] - s.extra_rdoc_files = %w[README.markdown LICENSE] + s.rdoc_options = ["--charset=UTF-8"] + s.extra_rdoc_files = %w(README.markdown LICENSE) - s.add_runtime_dependency('liquid', '~> 3.0') - s.add_runtime_dependency('kramdown', '~> 1.3') - s.add_runtime_dependency('mercenary', '~> 0.3.3') - s.add_runtime_dependency('safe_yaml', '~> 1.0') - s.add_runtime_dependency('colorator', '~> 1.0') - s.add_runtime_dependency('rouge', '~> 1.7') - s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0') - s.add_runtime_dependency('jekyll-watch', '~> 1.1') + s.add_runtime_dependency("liquid", "~> 3.0") + s.add_runtime_dependency("kramdown", "~> 1.3") + s.add_runtime_dependency("mercenary", "~> 0.3.3") + s.add_runtime_dependency("safe_yaml", "~> 1.0") + s.add_runtime_dependency("colorator", "~> 1.0") + s.add_runtime_dependency("rouge", "~> 1.7") + s.add_runtime_dependency("jekyll-sass-converter", "~> 1.0") + s.add_runtime_dependency("jekyll-watch", "~> 1.1") s.add_runtime_dependency("pathutil", "~> 0.9") - s.add_runtime_dependency('addressable', '~> 2.4') + s.add_runtime_dependency("addressable", "~> 2.4") end From 10b96b26bc82bfbedfe4be4a3914b50b4532fb6e Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 9 Jan 2017 21:39:19 +0100 Subject: [PATCH 76/84] Sort dependencies --- jekyll.gemspec | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/jekyll.gemspec b/jekyll.gemspec index 734df2e4..b36bed9f 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -29,14 +29,14 @@ Gem::Specification.new do |s| s.rdoc_options = ['--charset=UTF-8'] s.extra_rdoc_files = %w[README.markdown LICENSE] - s.add_runtime_dependency('liquid', '~> 3.0') - s.add_runtime_dependency('kramdown', '~> 1.3') - s.add_runtime_dependency('mercenary', '~> 0.3.3') - s.add_runtime_dependency('safe_yaml', '~> 1.0') - s.add_runtime_dependency('colorator', '~> 1.0') - s.add_runtime_dependency('rouge', '~> 1.7') - s.add_runtime_dependency('jekyll-sass-converter', '~> 1.0') - s.add_runtime_dependency('jekyll-watch', '~> 1.1') + s.add_runtime_dependency("addressable", "~> 2.4") + s.add_runtime_dependency("colorator", "~> 1.0") + s.add_runtime_dependency("jekyll-sass-converter", "~> 1.0") + s.add_runtime_dependency("jekyll-watch", "~> 1.1") + s.add_runtime_dependency("kramdown", "~> 1.3") + s.add_runtime_dependency("liquid", "~> 3.0") + s.add_runtime_dependency("mercenary", "~> 0.3.3") s.add_runtime_dependency("pathutil", "~> 0.9") - s.add_runtime_dependency('addressable', '~> 2.4') + s.add_runtime_dependency("rouge", "~> 1.7") + s.add_runtime_dependency("safe_yaml", "~> 1.0") end From 335d9b3881fc5f8ef6ebf5ce3a392d9c80420e4b Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 9 Jan 2017 21:39:42 +0100 Subject: [PATCH 77/84] sort gems --- docs/_config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index 32ae74bb..cc7476e2 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -28,14 +28,14 @@ twitter: logo: /img/logo-2x.png gems: - - jekyll-feed - - jekyll-redirect-from - - jemoji - - jekyll-sitemap - - jekyll-seo-tag - jekyll-avatar + - jekyll-feed - jekyll-mentions + - jekyll-redirect-from + - jekyll-seo-tag + - jekyll-sitemap + - jemoji exclude: - - README.md - .gitignore + - README.md From fb83ebadf61326bb628d6baa72b8db7711db6e6d Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 9 Jan 2017 14:10:03 -0800 Subject: [PATCH 78/84] Update history to reflect merge of #5745 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index b578b9bf..d5891406 100644 --- a/History.markdown +++ b/History.markdown @@ -41,6 +41,7 @@ * Bump to rake 12.0 (#5670) * Rubocop Gemfile (#5671) * update Classifier-Reborn to 2.1.0 (#5711) + * Rubocop: fix Rakefile and gemspec (#5745) ### Documentation From 47550935cb63d9432bb773fdd9e96ed926058e8d Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 9 Jan 2017 14:14:03 -0800 Subject: [PATCH 79/84] Update history to reflect merge of #5725 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index d5891406..8ff70c6b 100644 --- a/History.markdown +++ b/History.markdown @@ -42,6 +42,7 @@ * Rubocop Gemfile (#5671) * update Classifier-Reborn to 2.1.0 (#5711) * Rubocop: fix Rakefile and gemspec (#5745) + * Use `assert_nil` (#5725) ### Documentation From 4ef69b948c4d903047e4992cc68e5dfbc15b5717 Mon Sep 17 00:00:00 2001 From: yoostk Date: Tue, 10 Jan 2017 15:03:46 +0900 Subject: [PATCH 80/84] Fix a minor grammatical mistake on themes' document --- docs/_docs/themes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/themes.md b/docs/_docs/themes.md index c7d6d574..81a77d20 100644 --- a/docs/_docs/themes.md +++ b/docs/_docs/themes.md @@ -67,7 +67,7 @@ Add your template files in the corresponding folders, complete the `.gemspec` an Theme layouts and includes work just like they work in any Jekyll site. Place layouts in your theme's `/_layouts` folder, and place includes in your themes `/_includes` folder. -For example, if your theme has a `/_layouts/page.html` file, and a page has `layout: page` in its YAML front matter, Jekyll will first look to the site's `_layouts` folder for a the `page` layout, and if none exists, will use your theme's `page` layout. +For example, if your theme has a `/_layouts/page.html` file, and a page has `layout: page` in its YAML front matter, Jekyll will first look to the site's `_layouts` folder for the `page` layout, and if none exists, will use your theme's `page` layout. ### Assets From c48daa9d5b5768acdc0e30908844fc7ae604e1ef Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Tue, 10 Jan 2017 10:34:16 +0100 Subject: [PATCH 81/84] normalize whitespace --- jekyll.gemspec | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/jekyll.gemspec b/jekyll.gemspec index 4ddac2fa..71b5f31e 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -29,15 +29,14 @@ Gem::Specification.new do |s| s.rdoc_options = ["--charset=UTF-8"] s.extra_rdoc_files = %w(README.markdown LICENSE) - s.add_runtime_dependency("addressable", "~> 2.4") - s.add_runtime_dependency("colorator", "~> 1.0") + s.add_runtime_dependency("addressable", "~> 2.4") + s.add_runtime_dependency("colorator", "~> 1.0") s.add_runtime_dependency("jekyll-sass-converter", "~> 1.0") - s.add_runtime_dependency("jekyll-watch", "~> 1.1") - s.add_runtime_dependency("kramdown", "~> 1.3") - s.add_runtime_dependency("liquid", "~> 3.0") - s.add_runtime_dependency("mercenary", "~> 0.3.3") - s.add_runtime_dependency("pathutil", "~> 0.9") - s.add_runtime_dependency("rouge", "~> 1.7") - s.add_runtime_dependency("safe_yaml", "~> 1.0") - + s.add_runtime_dependency("jekyll-watch", "~> 1.1") + s.add_runtime_dependency("kramdown", "~> 1.3") + s.add_runtime_dependency("liquid", "~> 3.0") + s.add_runtime_dependency("mercenary", "~> 0.3.3") + s.add_runtime_dependency("pathutil", "~> 0.9") + s.add_runtime_dependency("rouge", "~> 1.7") + s.add_runtime_dependency("safe_yaml", "~> 1.0") end From f785d6f8d14ffb65588f4536a2ddc86bf8b3b6dc Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 10 Jan 2017 01:45:46 -0800 Subject: [PATCH 82/84] Update history to reflect merge of #5748 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 8ff70c6b..de38e96d 100644 --- a/History.markdown +++ b/History.markdown @@ -60,6 +60,7 @@ * Replace a dead link with a web-archived one (#5738) * Remove duplicate paragraph. (#5740) * Addition of a sample "typical post" (#5473) + * Fix a minor grammatical mistake on themes' document (#5748) ## 3.3.1 / 2016-11-14 From 0210022c757e6d931db508e160217c2088a39e64 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 10 Jan 2017 01:46:18 -0800 Subject: [PATCH 83/84] Update history to reflect merge of #5746 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index de38e96d..61315abe 100644 --- a/History.markdown +++ b/History.markdown @@ -24,6 +24,7 @@ * Use the current year for the LICENSE of theme (#5712) * Update License (#5713) * Use Addressable instead of URI to decode (#5726) + * Sort gems (#5746) ### Bug Fixes From 22368896fb6776766e82b746fb96bb55fcbbdd0d Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 10 Jan 2017 12:17:42 -0500 Subject: [PATCH 84/84] Rearrange some pieces of History.markdown. --- History.markdown | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/History.markdown b/History.markdown index 61315abe..887a2165 100644 --- a/History.markdown +++ b/History.markdown @@ -1,5 +1,20 @@ ## HEAD +### Minor Enhancements + + * Add connector param to `array_to_sentence_string` filter (#5597) + * Adds `group_by_exp` filter (#5513) + * Use the current year for the LICENSE of theme (#5712) + * Update License (#5713) + * Use Addressable instead of URI to decode (#5726) + +### Bug Fixes + + * Escaped regular expressions when using `post_url`. (#5605) + * fix date parsing in file names to be stricter (#5609) + * Add a module to re-define `ENV["TZ"]` in Windows (#5612) + * Use each instead of map to actually return nothing (#5668) + ### Site Enhancements * Remove instructions to install Jekyll 2 on Windows (#5582) @@ -16,22 +31,7 @@ * Add Jekyll-Post to list of plugins (#5705) * Add jekyll-numbered-headings (#5688) * Docs: move permalinks from documents into config (#5544) - -### Minor Enhancements - - * Add connector param to array_to_sentence_string filter (#5597) - * Adds group_by_exp filter (#5513) - * Use the current year for the LICENSE of theme (#5712) - * Update License (#5713) - * Use Addressable instead of URI to decode (#5726) - * Sort gems (#5746) - -### Bug Fixes - - * Escaped regular expressions when using post_url. (#5605) - * fix date parsing in file names to be stricter (#5609) - * Add a module to re-define `ENV["TZ"]` in Windows (#5612) - * Use each instead of map to actually return nothing (#5668) + * Sort gems in `docs/_config.yml` (#5746) ### Development Fixes @@ -44,6 +44,7 @@ * update Classifier-Reborn to 2.1.0 (#5711) * Rubocop: fix Rakefile and gemspec (#5745) * Use `assert_nil` (#5725) + * Sort gems in `jekyll.gemspec` (#5746) ### Documentation