Merge pull request 7205
This commit is contained in:
Mike Neumegen 2018-09-01 01:39:57 -07:00 committed by jekyllbot
parent 3aa41a6055
commit 805f438f24
126 changed files with 4501 additions and 3775 deletions

View File

@ -457,7 +457,7 @@
* add SUPPORT file for GitHub (#6324) * add SUPPORT file for GitHub (#6324)
* Rename CODE_OF_CONDUCT to show in banner (#6325) * Rename CODE_OF_CONDUCT to show in banner (#6325)
* Docs : illustrate page.id for a collection's document (#6329) * Docs : illustrate page.id for a collection's document (#6329)
* Docs: post's date can be overriden in YAML front matter (#6334) * Docs: post's date can be overriden in front matter (#6334)
* Docs: `site.url` behavior on development and production environments (#6270) * Docs: `site.url` behavior on development and production environments (#6270)
* Fix typo in site.url section of variables.md :-[ (#6337) * Fix typo in site.url section of variables.md :-[ (#6337)
* Docs: updates (#6343) * Docs: updates (#6343)
@ -1123,7 +1123,7 @@
* Fix typo on Chocolatey name in Windows documentation (#4686) * Fix typo on Chocolatey name in Windows documentation (#4686)
* Use the correct URL, Fixes #4698 (#4699) * Use the correct URL, Fixes #4698 (#4699)
* Add jekyll-paspagon plugin (#4700) * Add jekyll-paspagon plugin (#4700)
* Bold-italicize note in assets documentation about needing yaml front matter (#4706) * Bold-italicize note in assets documentation about needing front matter (#4706)
* Highlight the `script/` calls in the Contributing documentation (#4712) * Highlight the `script/` calls in the Contributing documentation (#4712)
* Add Hawkins to the list of third-party plugins (#4755) * Add Hawkins to the list of third-party plugins (#4755)
* Fix a typo in pagination doc (#4763) * Fix a typo in pagination doc (#4763)
@ -1291,7 +1291,7 @@
* Drop: fix hash setter precedence (#4312) * Drop: fix hash setter precedence (#4312)
* utils: `has_yaml_header?` should accept files with extraneous spaces (#4290) * utils: `has_yaml_header?` should accept files with extraneous spaces (#4290)
* Escape html from site.title and page.title in site template (#4307) * Escape html from site.title and page.title in site template (#4307)
* Allow custom file extensions if defined in `permalink` YAML front matter (#4314) * Allow custom file extensions if defined in `permalink` front matter (#4314)
* Fix deep_merge_hashes! handling of drops and hashes (#4359) * Fix deep_merge_hashes! handling of drops and hashes (#4359)
* Page should respect output extension of its permalink (#4373) * Page should respect output extension of its permalink (#4373)
* Disable auto-regeneration when running server detached (#4376) * Disable auto-regeneration when running server detached (#4376)
@ -1511,7 +1511,7 @@
* Fix nav items alignment when on multiple rows (#3264) * Fix nav items alignment when on multiple rows (#3264)
* Highlight: Only Strip Newlines/Carriage Returns, not Spaces (#3278) * Highlight: Only Strip Newlines/Carriage Returns, not Spaces (#3278)
* Find variables in front matter defaults by searching with relative file path. (#2774) * Find variables in front matter defaults by searching with relative file path. (#2774)
* Allow variables (e.g `:categories`) in YAML front matter permalinks (#3320) * Allow variables (e.g `:categories`) in front matter permalinks (#3320)
* Handle nil URL placeholders in permalinks (#3325) * Handle nil URL placeholders in permalinks (#3325)
* Template: Fix nav items alignment when in "burger" mode (#3329) * Template: Fix nav items alignment when in "burger" mode (#3329)
* Template: Remove `!important` from nav SCSS introduced in #3329 (#3375) * Template: Remove `!important` from nav SCSS introduced in #3329 (#3375)
@ -1528,7 +1528,7 @@
* Add WOFF2 font MIME type to Jekyll server MIME types (#3647) * Add WOFF2 font MIME type to Jekyll server MIME types (#3647)
* Be smarter about extracting the extname in `StaticFile` (#3632) * Be smarter about extracting the extname in `StaticFile` (#3632)
* Process metadata for all dependencies (#3608) * Process metadata for all dependencies (#3608)
* Show error message if the YAML front matter on a page/post is invalid. (#3643) * Show error message if the front matter on a page/post is invalid. (#3643)
* Upgrade redcarpet to 3.2 (Security fix: OSVDB-120415) (#3652) * Upgrade redcarpet to 3.2 (Security fix: OSVDB-120415) (#3652)
* Create #mock_expects that goes directly to RSpec Mocks. (#3658) * Create #mock_expects that goes directly to RSpec Mocks. (#3658)
* Open `.jekyll-metadata` in binary mode to read binary Marshal data (#3713) * Open `.jekyll-metadata` in binary mode to read binary Marshal data (#3713)
@ -1606,7 +1606,7 @@
* Add a Resources link to tutorial on building dynamic navbars (#3185) * Add a Resources link to tutorial on building dynamic navbars (#3185)
* Semantic structure improvements to the post and page layouts (#3251) * Semantic structure improvements to the post and page layouts (#3251)
* Add new AsciiDoc plugin to list of third-party plugins. (#3277) * Add new AsciiDoc plugin to list of third-party plugins. (#3277)
* Specify that all transformable collection documents must contain YAML front matter (#3271) * Specify that all transformable collection documents must contain front matter (#3271)
* Assorted accessibility fixes (#3256) * Assorted accessibility fixes (#3256)
* Update configuration docs to mention `keep_files` for `destination` (#3288, #3296) * Update configuration docs to mention `keep_files` for `destination` (#3288, #3296)
* Break when we successfully generate nav link to save CPU cycles. (#3291) * Break when we successfully generate nav link to save CPU cycles. (#3291)
@ -2143,7 +2143,7 @@
* Clean up the `<head>` in the site template (#2186) * Clean up the `<head>` in the site template (#2186)
* Permit YAML blocks to end with three dots to better conform with the YAML spec (#2110) * Permit YAML blocks to end with three dots to better conform with the YAML spec (#2110)
* Use `File.exist?` instead of deprecated `File.exists?` (#2214) * Use `File.exist?` instead of deprecated `File.exists?` (#2214)
* Require newline after start of YAML Front Matter header (#2211) * Require newline after start of front matter header (#2211)
* Add the ability for pages to be marked as `published: false` (#1492) * Add the ability for pages to be marked as `published: false` (#1492)
* Add `Jekyll::LiquidExtensions` with `.lookup_variable` method for easy looking up of variable values in a Liquid context. (#2253) * Add `Jekyll::LiquidExtensions` with `.lookup_variable` method for easy looking up of variable values in a Liquid context. (#2253)
* Remove literal lang name from class (#2292) * Remove literal lang name from class (#2292)
@ -2821,7 +2821,7 @@
* Bullet-proof `limit_posts` option (#1004) * Bullet-proof `limit_posts` option (#1004)
* Read in YAML as UTF-8 to accept non-ASCII chars (#836) * Read in YAML as UTF-8 to accept non-ASCII chars (#836)
* Fix the CLI option `--plugins` to actually accept dirs and files (#993) * Fix the CLI option `--plugins` to actually accept dirs and files (#993)
* Allow 'excerpt' in YAML front matter to override the extracted excerpt (#946) * Allow 'excerpt' in front matter to override the extracted excerpt (#946)
* Fix cascade problem with site.baseurl, site.port and site.host. (#935) * Fix cascade problem with site.baseurl, site.port and site.host. (#935)
* Filter out directories with valid post names (#875) * Filter out directories with valid post names (#875)
* Fix symlinked static files not being correctly built in unsafe mode (#909) * Fix symlinked static files not being correctly built in unsafe mode (#909)
@ -2833,7 +2833,7 @@
* Patch for multibyte URI problem with `jekyll serve` (#723) * Patch for multibyte URI problem with `jekyll serve` (#723)
* Order plugin execution by priority (#864) * Order plugin execution by priority (#864)
* Fixed Page#dir and Page#url for edge cases (#536) * Fixed Page#dir and Page#url for edge cases (#536)
* Fix broken `post_url` with posts with a time in their YAML front matter (#831) * Fix broken `post_url` with posts with a time in their front matter (#831)
* Look for plugins under the source directory (#654) * Look for plugins under the source directory (#654)
* Tumblr Migrator: finds `_posts` dir correctly, fixes truncation of long post names (#775) * Tumblr Migrator: finds `_posts` dir correctly, fixes truncation of long post names (#775)
* Force Categories to be Strings (#767) * Force Categories to be Strings (#767)
@ -3024,7 +3024,7 @@
* Bug Fixes * Bug Fixes
* Require redcloth >= 4.2.1 in tests (#92) * Require redcloth >= 4.2.1 in tests (#92)
* Don't break on triple dashes in yaml front matter (#93) * Don't break on triple dashes in front matter (#93)
### Minor Enhancements ### Minor Enhancements
@ -3056,7 +3056,7 @@
* Added --paginate option to the executable along with a paginator object for the payload (@calavera) * Added --paginate option to the executable along with a paginator object for the payload (@calavera)
* Upgraded RedCloth to 4.2.1, which makes `<notextile>` tags work once again. * Upgraded RedCloth to 4.2.1, which makes `<notextile>` tags work once again.
* Configuration options set in config.yml are now available through the site payload (@vilcans) * Configuration options set in config.yml are now available through the site payload (@vilcans)
* Posts can now have an empty YAML front matter or none at all (@ bahuvrihi) * Posts can now have an empty front matter or none at all (@ bahuvrihi)
* Bug Fixes * Bug Fixes
* Fixing Ruby 1.9 issue that requires `#to_s` on the err object (@Chrononaut) * Fixing Ruby 1.9 issue that requires `#to_s` on the err object (@Chrononaut)
* Fixes for pagination and ordering posts on the same day (@ujh) * Fixes for pagination and ordering posts on the same day (@ujh)
@ -3064,7 +3064,7 @@
* Index.html file should always have index.html permalink (@eugenebolshakov) * Index.html file should always have index.html permalink (@eugenebolshakov)
* Added trailing slash to pretty permalink style so Apache is happy (@eugenebolshakov) * Added trailing slash to pretty permalink style so Apache is happy (@eugenebolshakov)
* Bad markdown processor in config fails sooner and with better message (@ gcnovus) * Bad markdown processor in config fails sooner and with better message (@ gcnovus)
* Allow CRLFs in yaml front matter (@juretta) * Allow CRLFs in front matter (@juretta)
* Added Date#xmlschema for Ruby versions < 1.9 * Added Date#xmlschema for Ruby versions < 1.9
## 0.5.1 / 2009-05-06 ## 0.5.1 / 2009-05-06
@ -3143,7 +3143,7 @@
* Added post categories based on directories containing `_posts` (@mreid) * Added post categories based on directories containing `_posts` (@mreid)
* Added post topics based on directories underneath `_posts` * Added post topics based on directories underneath `_posts`
* Added new date filter that shows the full month name (@mreid) * Added new date filter that shows the full month name (@mreid)
* Merge Post's YAML front matter into its to_liquid payload (@remi) * Merge Post's front matter into its to_liquid payload (@remi)
* Restrict includes to regular files underneath `_includes` * Restrict includes to regular files underneath `_includes`
* Bug Fixes * Bug Fixes
* Change YAML delimiter matcher so as to not chew up 2nd level markdown headers (@mreid) * Change YAML delimiter matcher so as to not chew up 2nd level markdown headers (@mreid)

View File

@ -7,7 +7,7 @@
[![Test Coverage](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/test_coverage)][coverage] [![Test Coverage](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/test_coverage)][coverage]
[![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)][hakiri] [![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)][hakiri]
[![Backers on Open Collective](https://opencollective.com/jekyll/backers/badge.svg)](#backers) [![Backers on Open Collective](https://opencollective.com/jekyll/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/jekyll/sponsors/badge.svg)](#sponsors) [![Sponsors on Open Collective](https://opencollective.com/jekyll/sponsors/badge.svg)](#sponsors)
[ruby-gems]: https://rubygems.org/gems/jekyll [ruby-gems]: https://rubygems.org/gems/jekyll
[codeclimate]: https://codeclimate.com/github/jekyll/jekyll [codeclimate]: https://codeclimate.com/github/jekyll/jekyll
@ -50,7 +50,7 @@ these terms, please let one of our [core team members](https://jekyllrb.com/team
## Diving In ## Diving In
* [Migrate](http://import.jekyllrb.com/docs/home/) from your previous system * [Migrate](http://import.jekyllrb.com/docs/home/) from your previous system
* Learn how the [YAML Front Matter](https://jekyllrb.com/docs/frontmatter/) works * Learn how [Front Matter](https://jekyllrb.com/docs/front-matter/) works
* Put information on your site with [Variables](https://jekyllrb.com/docs/variables/) * Put information on your site with [Variables](https://jekyllrb.com/docs/variables/)
* Customize the [Permalinks](https://jekyllrb.com/docs/permalinks/) your posts are generated with * Customize the [Permalinks](https://jekyllrb.com/docs/permalinks/) your posts are generated with
* Use the built-in [Liquid Extensions](https://jekyllrb.com/docs/templates/) to make your life easier * Use the built-in [Liquid Extensions](https://jekyllrb.com/docs/templates/) to make your life easier

View File

@ -1,53 +0,0 @@
- title: Getting Started
docs:
- home
- quickstart
- installation
- windows
- usage
- structure
- configuration
- title: Your Content
docs:
- frontmatter
- posts
- drafts
- pages
- static-files
- variables
- collections
- datafiles
- assets
- migrations
- title: Customization
docs:
- templates
- includes
- permalinks
- pagination
- plugins
- themes
- extras
- title: Deployment
docs:
- github-pages
- deployment-methods
- continuous-integration
- title: Miscellaneous
docs:
- troubleshooting
- sites
- resources
- upgrading/0-to-2
- upgrading/2-to-3
- title: Meta
docs:
- contributing
- maintaining
- conduct
- history

36
docs/_data/docs_nav.yml Normal file
View File

@ -0,0 +1,36 @@
- title: Getting Started
docs:
- link: /docs/
- link: /docs/ruby-101/
- link: /docs/installation/
- link: /docs/community/
- link: /docs/step-by-step/01-setup/
- title: Build
docs:
- link: /docs/usage/
- link: /docs/configuration/
- title: Content
docs:
- link: /docs/pages/
- link: /docs/posts/
- link: /docs/front-matter/
- link: /docs/collections/
- link: /docs/datafiles/
- link: /docs/assets/
- link: /docs/static-files/
- title: Site Structure
docs:
- link: /docs/structure/
- link: /docs/liquid/
- link: /docs/variables/
- link: /docs/includes/
- link: /docs/layouts/
- link: /docs/permalinks/
- link: /docs/themes/
- link: /docs/pagination/
- title: Guides
docs:
- link: /docs/plugins/
- link: /docs/migrations/
- link: /docs/upgrading/
- link: /docs/deployment/

View File

@ -53,7 +53,7 @@
year: 2016 year: 2016
- speaker: Amy Johnston - speaker: Amy Johnston
twitter_handle: amybeukenex twitter_handle: AmyJohnstonXL
youtube_id: HR12JiUI2Zc youtube_id: HR12JiUI2Zc
topic: Jekyll for Technical Documentation topic: Jekyll for Technical Documentation
year: 2016 year: 2016
@ -83,7 +83,7 @@
year: 2016 year: 2016
- speaker: Julio Faerman - speaker: Julio Faerman
twitter_handle: jmfaerman twitter_handle: juliodevrel
youtube_id: SOMonG8Iqak youtube_id: SOMonG8Iqak
topic: Jekyll on AWS topic: Jekyll on AWS
year: 2016 year: 2016
@ -131,7 +131,7 @@
year: 2016 year: 2016
- speaker: Nils Borchers - speaker: Nils Borchers
twitter_handle: nilsborchers twitter_handle: nilsbo
youtube_id: DtNMjuv6Rbo youtube_id: DtNMjuv6Rbo
topic: Building a living brand guide with Jekyll and Hologram topic: Building a living brand guide with Jekyll and Hologram
year: 2016 year: 2016

View File

@ -0,0 +1,15 @@
- title: Home
link: /
show_on_mobile: true
- title: Docs
link: /docs/
show_on_mobile: true
- title: Resources
link: /resources/
show_on_mobile: true
- title: Showcase
link: /showcase/
show_on_mobile: false
- title: News
link: /news/
show_on_mobile: true

222
docs/_data/showcase.yml Normal file
View File

@ -0,0 +1,222 @@
- name: Tom Preston Werner Blog
url: http://tom.preston-werner.com/
categories:
- personal
- blog
- name: GitHub On Demand Training
url: https://services.github.com/on-demand/
categories:
- software
- knowledgebase
- name: MvvmCross
url: https://www.mvvmcross.com/
categories:
- software
- marketing-site
- name: Vidgrid
url: https://www.vidgrid.com/
categories:
- software
- marketing-site
- name: Bitcoin
url: https://bitcoin.org/en/
categories:
- software
- marketing-site
- name: Mapwize
url: https://www.mapwize.io/
categories:
- software
- marketing-site
- name: Auth0 Blog
url: https://auth0.com/blog/
categories:
- software
- blog
- name: AWS Amplify
url: https://aws-amplify.github.io/amplify-js/
categories:
- open-source
- marketing-site
- name: Yeoman
url: http://yeoman.io/
categories:
- open-source
- marketing-site
- name: Ionic Framwork
url: https://ionicframework.com/
categories:
- software
- marketing-site
- name: Release Management Blog
url: https://release.mozilla.org/
categories:
- software
- blog
- name: Freedom of Information Act
url: https://www.foia.gov/
categories:
- government
- name: Art & About Sydney
url: https://www.artandabout.com.au/
categories:
- government
- name: Passbolt Help
url: https://help.passbolt.com/
categories:
- knowledgebase
- name: We are COLLINS
url: https://www.wearecollins.com/
categories:
- agency
- name: Light Burn
url: https://lightburn.co/
categories:
- agency
- name: italia.it
url: https://developers.italia.it/
categories:
- community
- name: Sydney New Years Eve
url: https://www.sydneynewyearseve.com/
categories:
- government
- name: Login.gov
url: https://login.gov/
categories:
- government
- name: plainlanguage.gov
url: https://plainlanguage.gov/
categories:
- government
- name: U.S. Web Design Standards
url: https://standards.usa.gov/
categories:
- government
- name: Grantmaker Search
url: https://www.grantmakers.io/
categories:
- marketing-site
- name: Rehan Butt
url: http://rehanbutt.com/
categories:
- personal
- portfolio
- name: The Markdown Guide
url: https://www.markdownguide.org/
categories:
- knowledgebase
- name: PROBOT
url: https://probot.github.io/
categories:
- documentation
- name: Matt Grey
url: https://himatt.com/
categories:
- personal
- portfolio
- name: frame.ai
url: https://frame.ai/
categories:
- software
- marketing-site
- name: SiteLeaf
url: https://siteleaf.com
categories:
- software
- marketing-site
- name: CloudCannon
url: https://cloudcannon.com/
categories:
- software
- marketing-site
- name: AdHawk
url: https://www.tryadhawk.com/
categories:
- agency
- name: City of Boston Budget
url: https://budget.boston.gov/
categories:
- government
- name: Lattice
url: https://latticehq.com/
categories:
- software
- marketing-site
- name: MailTape
url: https://www.mailta.pe/
categories:
- other
- name: Digital Democracy
url: http://www.digital-democracy.org/
categories:
- other
- name: HTML Reference
url: http://htmlreference.io/
categories:
- documentation
- name: CSS Reference
url: http://cssreference.io/
categories:
- documentation
- name: Sketch App
url: https://sketchapp.com/
categories:
- software
- marketing-site
- name: Chain
url: https://chain.com/
categories:
- marketing-site
- name: Pattern Lab
url: http://patternlab.io/
categories:
- documentation
- name: Netflix Devices
url: https://devices.netflix.com/en/
categories:
- marketing-site
- name: Ruby on Rails
url: http://rubyonrails.org/
categories:
- marketing-site
- documentation
- name: IBM MobileFirst Foundation
url: https://mobilefirstplatform.ibmcloud.com/
categories:
- documentation
- name: 18F
url: https://18f.gsa.gov/
categories:
- agency
- government
- name: Mapbox
url: https://mapbox.com/
categories:
- marketing-site
- name: Development Seed
url: https://developmentseed.org/
categories:
- agency
- name: White House Social and Behavioral Sciences Team
url: https://sbst.gov/
categories:
- government
- name: UN World Statistics
url: https://worldstatisticsday.org
categories:
- government
- name: Vesterheim Norwegian-American Museum
url: http://vesterheim.org/
categories:
- marketing-site
- name: TwitchCon
url: https://www.twitchcon.com/
categories:
- marketing-site
- conference
- name: Twitch Developer Documentation
url: https://dev.twitch.tv/
categories:
- marketing-site
- documentation

View File

@ -3,10 +3,11 @@ title: Assets
permalink: /docs/assets/ permalink: /docs/assets/
--- ---
Jekyll provides built-in support for Sass and can work with CoffeeScript via Jekyll provides built-in support for [Sass](https://sass-lang.com/)
a Ruby gem. In order to use them, you must first create a file with the and can work with [CoffeeScript](https://coffeescript.org/) via a Ruby gem.
proper extension name (one of `.sass`, `.scss`, or `.coffee`) and ***start the In order to use them, you must first create a file with the proper extension
file with two lines of triple dashes***, like this: name (one of `.sass`, `.scss`, or `.coffee`) and
***start the file with two lines of triple dashes***, like this:
```sass ```sass
--- ---
@ -42,8 +43,7 @@ them to be in the output file, such as `<source>/css`. For an example, take
a look at [this example site using Sass support in Jekyll][example-sass]. a look at [this example site using Sass support in Jekyll][example-sass].
If you are using Sass `@import` statements, you'll need to ensure that your If you are using Sass `@import` statements, you'll need to ensure that your
`sass_dir` is set to the base directory that contains your Sass files. You `sass_dir` is set to the base directory that contains your Sass files:
can do that thusly:
```yaml ```yaml
sass: sass:
@ -61,7 +61,7 @@ The Sass converter will default the `sass_dir` configuration option to
Note that the <code>sass_dir</code> becomes the load path for Sass imports, Note that the <code>sass_dir</code> becomes the load path for Sass imports,
nothing more. This means that Jekyll does not know about these files nothing more. This means that Jekyll does not know about these files
directly, so any files here should not contain the YAML Front Matter as directly, so any files here should not contain the front matter as
described above nor will they be transformed as described above. This described above nor will they be transformed as described above. This
folder should only contain imports. folder should only contain imports.
@ -89,5 +89,5 @@ To enable Coffeescript in Jekyll 3.0 and up you must
```yaml ```yaml
plugins: plugins:
- jekyll-coffeescript - jekyll-coffeescript
``` ```

View File

@ -3,47 +3,25 @@ title: Collections
permalink: /docs/collections/ permalink: /docs/collections/
--- ---
Not everything is a post or a page. Maybe you want to document the various Collections are a great way to group related content like members of a team or
methods in your open source project, members of a team, or talks at a talks at a conference.
conference. Collections allow you to define a new type of document that behave
like Pages or Posts do normally, but also have their own unique properties and
namespace.
## Using Collections ## Setup
To start using collections, follow these 3 steps: To use a Collection you first need to define it in your `_config.yml`. For
example here's a collection of staff members:
* [Step 1: Tell Jekyll to read in your collection](#step1)
* [Step 2: Add your content](#step2)
* [Step 3: Optionally render your collection's documents into independent files](#step3)
### Step 1: Tell Jekyll to read in your collection {#step1}
Add the following to your site's `_config.yml` file, replacing `my_collection`
with the name of your collection:
```yaml ```yaml
collections: collections:
- my_collection - staff_members
``` ```
You can optionally specify metadata for your collection in the configuration: You can optionally specify metadata for your collection in the configuration:
```yaml ```yaml
collections: collections:
my_collection: staff_members:
foo: bar people: true
```
Default attributes can also be set for a collection:
```yaml
defaults:
- scope:
path: ""
type: my_collection
values:
layout: page
``` ```
<div class="note"> <div class="note">
@ -61,13 +39,24 @@ defaults:
<p>If you specify a directory to store all your collections in the same place with <code>collections_dir: my_collections</code>, then you will need to move your <code>_drafts</code> and <code>_posts</code> directory to <code>my_collections/_drafts</code> and <code>my_collections/_posts</code>. Note that, the name of your collections directory cannot start with an underscore (`_`).</p> <p>If you specify a directory to store all your collections in the same place with <code>collections_dir: my_collections</code>, then you will need to move your <code>_drafts</code> and <code>_posts</code> directory to <code>my_collections/_drafts</code> and <code>my_collections/_posts</code>. Note that, the name of your collections directory cannot start with an underscore (`_`).</p>
</div> </div>
### Step 2: Add your content {#step2} ## Add content
Create a corresponding folder (e.g. `<source>/_my_collection`) and add Create a corresponding folder (e.g. `<source>/_staff_members`) and add
documents. YAML front matter is processed if the front matter exists, and everything documents. Front matter is processed if the front matter exists, and everything
after the front matter is pushed into the document's `content` attribute. If no YAML front after the front matter is pushed into the document's `content` attribute. If no front
matter is provided, Jekyll will not generate the file in your collection. matter is provided, Jekyll will not generate the file in your collection.
For example here's how you would add an staff member to the collection set above.
The filename is `./_staff_members/jane.md` with the following content:
```markdown
---
name: Jane Doe
position: Developer
---
Jane has worked on Jekyll for the past *five years*.
```
<div class="note info"> <div class="note info">
<h5>Be sure to name your directories correctly</h5> <h5>Be sure to name your directories correctly</h5>
<p> <p>
@ -76,190 +65,57 @@ your <code>_config.yml</code> file, with the addition of the preceding <code>_</
</p> </p>
</div> </div>
### Step 3: Optionally render your collection's documents into independent files {#step3} ## Output
If you'd like Jekyll to create a public-facing, rendered version of each Now you can iterate over `site.staff_members` on a page and output the content
document in your collection, set the `output` key to `true` in your collection for each staff member. Similar to posts, the body of the document is accessed
metadata in your `_config.yml`: using the `content` variable:
```yaml
collections:
my_collection:
output: true
```
This will produce a file for each document in the collection.
For example, if you have `_my_collection/some_subdir/some_doc.md`,
it will be rendered using Liquid and the Markdown converter of your
choice and written out to `<dest>/my_collection/some_subdir/some_doc.html`.
If you wish a specific page to be shown when accessing `/my_collection/`,
simply add `permalink: /my_collection/index.html` to a page.
To list items from the collection, on that page or any other, you can use:
{% raw %} {% raw %}
```liquid ```liquid
{% for item in site.my_collection %} {% for staff_member in site.staff_members %}
<h2>{{ item.title }}</h2> <h2>{{ staff_member.name }} - {{ staff_member.position }}</h2>
<p>{{ item.description }}</p> <p>{{ staff_member.content | markdownify }}</p>
<p><a href="{{ item.url }}">{{ item.title }}</a></p>
{% endfor %} {% endfor %}
``` ```
{% endraw %} {% endraw %}
<div class="note info">
<h5>Don't forget to add YAML for processing</h5>
<p>
Files in collections that do not have front matter are treated as
<a href="/docs/static-files">static files</a> and simply copied to their
output location without processing.
</p>
</div>
## Configuring permalinks for collections {#permalinks} If you'd like Jekyll to create a rendered page for each document in your
collection, you can set the `output` key to `true` in your collection
If you wish to specify a custom pattern for the URLs where your Collection pages metadata in `_config.yml`:
will reside, you may do so with the [`permalink` property](../permalinks/):
```yaml ```yaml
collections: collections:
my_collection: staff_members:
output: true output: true
permalink: /:collection/:name
``` ```
### Examples You can link to the generated page using the `url` attribute:
For a collection with the following source file structure,
{% raw %}
```liquid
{% for staff_member in site.staff_members %}
<h2>
<a href="{{ staff_member.url }}">
{{ staff_member.name }} - {{ staff_member.position }}
</a>
</h2>
<p>{{ staff_member.content | markdownify }}</p>
{% endfor %}
``` ```
_my_collection/ {% endraw %}
└── some_subdir
└── some_doc.md
```
each of the following `permalink` configurations will produce the document structure shown below it. ## Permalinks
* **Default** There are special [permalink variables for collections](/docs/permalinks/) to
Same as `permalink: /:collection/:path`. help you control the output url for the entire collection.
```
_site/
├── my_collection
│   └── some_subdir
│   └── some_doc.html
...
```
* `permalink: pretty`
Same as `permalink: /:collection/:path/`.
```
_site/
├── my_collection
│   └── some_subdir
│   └── some_doc
│   └── index.html
...
```
* `permalink: /doc/:path`
```
_site/
├── doc
│   └── some_subdir
│   └── some_doc.html
...
```
* `permalink: /doc/:name`
```
_site/
├── doc
│   └── some_doc.html
...
```
* `permalink: /:name`
```
_site/
├── some_doc.html
...
```
### Template Variables
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>:collection</code></p>
</td>
<td>
<p>Label of the containing collection.</p>
</td>
</tr>
<tr>
<td>
<p><code>:path</code></p>
</td>
<td>
<p>Path to the document relative to the collection's directory.</p>
</td>
</tr>
<tr>
<td>
<p><code>:name</code></p>
</td>
<td>
<p>The document's base filename, with every sequence of spaces
and non-alphanumeric characters replaced by a hyphen.</p>
</td>
</tr>
<tr>
<td>
<p><code>:title</code></p>
</td>
<td>
<p>
The <code>:title</code> template variable will take the
<code>slug</code> <a href="/docs/frontmatter/">front matter</a>
variable value if any is present in the document; if none is
defined then <code>:title</code> will be equivalent to
<code>:name</code>, aka the slug generated from the filename.
</p>
</td>
</tr>
<tr>
<td>
<p><code>:output_ext</code></p>
</td>
<td>
<p>Extension of the output file. (Included by default and usually unnecessary.)</p>
</td>
</tr>
</tbody>
</table>
</div>
## Liquid Attributes ## Liquid Attributes
### Collections ### Collections
Each collection is accessible as a field on the `site` variable. For example, if Collections are also available under `site.collections`, with the metadata
you want to access the `albums` collection found in `_albums`, you'd use
`site.albums`.
Each collection is itself an array of documents (e.g., `site.albums` is an array of documents, much like `site.pages` and
`site.posts`). See the table below for how to access attributes of those documents.
The collections are also available under `site.collections`, with the metadata
you specified in your `_config.yml` (if present) and the following information: you specified in your `_config.yml` (if present) and the following information:
<div class="mobile-side-scroller"> <div class="mobile-side-scroller">
@ -365,7 +221,7 @@ you specified in your `_config.yml` (if present) and the following information:
### Documents ### Documents
In addition to any YAML Front Matter provided in the document's corresponding In addition to any front matter provided in the document's corresponding
file, each document has the following attributes: file, each document has the following attributes:
<div class="mobile-side-scroller"> <div class="mobile-side-scroller">
@ -383,9 +239,9 @@ file, each document has the following attributes:
</td> </td>
<td> <td>
<p> <p>
The (unrendered) content of the document. If no YAML Front Matter is The (unrendered) content of the document. If no front matter is
provided, Jekyll will not generate the file in your collection. If provided, Jekyll will not generate the file in your collection. If
YAML Front Matter is used, then this is all the contents of the file front matter is used, then this is all the contents of the file
after the terminating after the terminating
`---` of the front matter. `---` of the front matter.
</p> </p>
@ -455,51 +311,3 @@ file, each document has the following attributes:
</tbody> </tbody>
</table> </table>
</div> </div>
## Accessing Collection Attributes
Attributes from the YAML front matter can be accessed as data anywhere in the
site. Using the above example for configuring a collection as `site.albums`,
you might have front matter in an individual file structured as follows (which
must use a supported markup format, and cannot be saved with a `.yaml`
extension):
```yaml
title: "Josquin: Missa De beata virgine and Missa Ave maris stella"
artist: "The Tallis Scholars"
director: "Peter Phillips"
works:
- title: "Missa De beata virgine"
composer: "Josquin des Prez"
tracks:
- title: "Kyrie"
duration: "4:25"
- title: "Gloria"
duration: "9:53"
- title: "Credo"
duration: "9:09"
- title: "Sanctus & Benedictus"
duration: "7:47"
- title: "Agnus Dei I, II & III"
duration: "6:49"
```
Every album in the collection could be listed on a single page with a template:
```liquid
{% raw %}
{% for album in site.albums %}
<h2>{{ album.title }}</h2>
<p>Performed by {{ album.artist }}{% if album.director %}, directed by {{ album.director }}{% endif %}</p>
{% for work in album.works %}
<h3>{{ work.title }}</h3>
<p>Composed by {{ work.composer }}</p>
<ul>
{% for track in work.tracks %}
<li>{{ track.title }} ({{ track.duration }})</li>
{% endfor %}
</ul>
{% endfor %}
{% endfor %}
{% endraw %}
```

View File

@ -0,0 +1,8 @@
---
title: Report a bug
permalink: "/docs/community/bug/"
---
If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository &mdash; First [look for the plugin on rubygems](https://rubygems.org/) then click on the `Homepage` link to access the plugin repository.
If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new).

View File

@ -0,0 +1,38 @@
---
title: Community
permalink: /docs/community/
redirect_from: "/help/index.html"
---
## Jekyll Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
[Read the full code of conduct](/docs/conduct/)
## Where to get support
If you're looking for support for Jekyll, there are a lot of options:
* Read [Jekyll Documentation](https://jekyllrb.com/docs/)
* If you have a question about using Jekyll, start a discussion on [the Jekyll Forum](https://talk.jekyllrb.com/) or [StackOverflow](https://stackoverflow.com/questions/tagged/jekyll)
* Chat with Jekyllers &mdash; Join [our Gitter channel](https://gitter.im/jekyll/jekyll) or [our IRC channel on Freenode](irc:irc.freenode.net/jekyll)
There are a bunch of helpful community members on these services that should be willing to point you in the right direction.
**Reminder: Jekyll's issue tracker is not a support forum.**
## Ways to contribute
* [How to Contribute](/docs/contributing/)
* [How to file a bug](/docs/community/bug/)
* [Guide for maintaining Jekyll](/docs/maintaining/)
## Jekyllconf
[Watch videos](/jekyllconf/) from members of the Jekyll community speak about interesting use cases, tricks theyve learned or meta Jekyll topics.
## Jekyll on Twitter
The [official Jekyll Twitter account](https://twitter.com/jekyllrb).

View File

@ -3,831 +3,16 @@ title: Configuration
permalink: /docs/configuration/ permalink: /docs/configuration/
--- ---
Jekyll allows you to concoct your sites in any way you can dream up, and its Jekyll gives you a lot of flexibility to customize how it builds your site. These
thanks to the powerful and flexible configuration options that this is possible. options can either be specified in a `_config.yml` file placed in your sites
These options can either be specified in a `_config.yml` file placed in your root directory, or can be specified as flags for the `jekyll` executable in the
sites root directory, or can be specified as flags for the `jekyll` executable terminal.
in the terminal.
* [Configuration Options](/docs/configuration/options/)
## Configuration Settings * [Default Configuration](/docs/configuration/default/)
* [Front Matter Defaults](/docs/configuration/front-matter-defaults/)
### Global Configuration * [Environments](/docs/configuration/environments/)
* [Markdown Options](/docs/configuration/markdown/)
The table below lists the available settings for Jekyll, and the various <code * [Liquid Options](/docs/configuration/liquid/)
class="option">options</code> (specified in the configuration file) and <code * [Webrick Options](/docs/configuration/webrick/)
class="flag">flags</code> (specified on the command-line) that control them. * [Incremental Regeneration](/docs/configuration/incremental-regeneration/)
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Setting</th>
<th>
<span class="option">Options</span> and <span class="flag">Flags</span>
</th>
</tr>
</thead>
<tbody>
<tr class="setting">
<td>
<p class="name"><strong>Site Source</strong></p>
<p class="description">Change the directory where Jekyll will read files</p>
</td>
<td class="align-center">
<p><code class="option">source: DIR</code></p>
<p><code class="flag">-s, --source DIR</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Site Destination</strong></p>
<p class="description">Change the directory where Jekyll will write files</p>
</td>
<td class="align-center">
<p><code class="option">destination: DIR</code></p>
<p><code class="flag">-d, --destination DIR</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Safe</strong></p>
<p class="description">Disable <a href="../plugins/">custom plugins, and ignore symbolic links</a>.</p>
</td>
<td class="align-center">
<p><code class="option">safe: BOOL</code></p>
<p><code class="flag">--safe</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Exclude</strong></p>
<p class="description">
Exclude directories and/or files from the
conversion. These exclusions are relative to the site's
source directory and cannot be outside the source directory.
</p>
</td>
<td class="align-center">
<p><code class="option">exclude: [DIR, FILE, ...]</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Include</strong></p>
<p class="description">
Force inclusion of directories and/or files in the conversion.
<code>.htaccess</code> is a good example since dotfiles are excluded
by default.
</p>
</td>
<td class="align-center">
<p><code class="option">include: [DIR, FILE, ...]</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Keep files</strong></p>
<p class="description">
When clobbering the site destination, keep the selected files.
Useful for files that are not generated by jekyll; e.g. files or
assets that are generated by your build tool.
The paths are relative to the <code>destination</code>.
</p>
</td>
<td class="align-center">
<p><code class="option">keep_files: [DIR, FILE, ...]</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Time Zone</strong></p>
<p class="description">
Set the time zone for site generation. This sets the <code>TZ</code>
environment variable, which Ruby uses to handle time and date
creation and manipulation. Any entry from the
<a href="https://en.wikipedia.org/wiki/Tz_database">IANA Time Zone
Database</a> is valid, e.g. <code>America/New_York</code>. A list of all
available values can be found <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">
here</a>. When serving on a local machine, the default time zone is set by your operating system. But when served on a remote host/server, the default time zone depends on the server's setting or location.
</p>
</td>
<td class="align-center">
<p><code class="option">timezone: TIMEZONE</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Encoding</strong></p>
<p class="description">
Set the encoding of files by name (only available for Ruby
1.9 or later).
The default value is <code>utf-8</code> starting in 2.0.0,
and <code>nil</code> before 2.0.0, which will yield the Ruby
default of <code>ASCII-8BIT</code>.
Available encodings can be shown by the
command <code>ruby -e 'puts Encoding::list.join("\n")'</code>.
</p>
</td>
<td class="align-center">
<p><code class="option">encoding: ENCODING</code></p>
</td>
</tr>
<tr>
<td>
<p class='name'><strong>Defaults</strong></p>
<p class='description'>
Set defaults for <a href="../frontmatter/" title="YAML Front Matter">YAML Front Matter</a>
variables.
</p>
</td>
<td class='align-center'>
<p>see <a href="#front-matter-defaults" title="details">below</a></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note warning">
<h5>Destination folders are cleaned on site builds</h5>
<p>
The contents of <code>&lt;destination&gt;</code> are automatically
cleaned, by default, when the site is built. Files or folders that are not
created by your site will be removed. Some files could be retained
by specifying them within the <code>&lt;keep_files&gt;</code> configuration directive.
</p>
<p>
Do not use an important location for <code>&lt;destination&gt;</code>; instead, use it as
a staging area and copy files from there to your web server.
</p>
</div>
### Build Command Options
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Setting</th>
<th><span class="option">Options</span> and <span class="flag">Flags</span></th>
</tr>
</thead>
<tbody>
<tr class="setting">
<td>
<p class="name"><strong>Regeneration</strong></p>
<p class="description">Enable auto-regeneration of the site when files are modified.</p>
</td>
<td class="align-center">
<p><code class="flag">-w, --[no-]watch</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Configuration</strong></p>
<p class="description">Specify config files instead of using <code>_config.yml</code> automatically. Settings in later files override settings in earlier files.</p>
</td>
<td class="align-center">
<p><code class="flag">--config FILE1[,FILE2,...]</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Drafts</strong></p>
<p class="description">Process and render draft posts.</p>
</td>
<td class="align-center">
<p><code class="option">show_drafts: BOOL</code></p>
<p><code class="flag">--drafts</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Environment</strong></p>
<p class="description">Use a specific environment value in the build.</p>
</td>
<td class="align-center">
<p><code class="flag">JEKYLL_ENV=production</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Future</strong></p>
<p class="description">Publish posts or collection documents with a future date.</p>
</td>
<td class="align-center">
<p><code class="option">future: BOOL</code></p>
<p><code class="flag">--future</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Unpublished</strong></p>
<p class="description">Render posts that were marked as unpublished.</p>
</td>
<td class="align-center">
<p><code class="option">unpublished: BOOL</code></p>
<p><code class="flag">--unpublished</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>LSI</strong></p>
<p class="description">Produce an index for related posts. Requires the <a href="http://www.classifier-reborn.com/">classifier-reborn</a> plugin.</p>
</td>
<td class="align-center">
<p><code class="option">lsi: BOOL</code></p>
<p><code class="flag">--lsi</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Limit Posts</strong></p>
<p class="description">Limit the number of posts to parse and publish.</p>
</td>
<td class="align-center">
<p><code class="option">limit_posts: NUM</code></p>
<p><code class="flag">--limit_posts NUM</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Force polling</strong></p>
<p class="description">Force watch to use polling.</p>
</td>
<td class="align-center">
<p><code class="flag">--force_polling</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Verbose output</strong></p>
<p class="description">Print verbose output.</p>
</td>
<td class="align-center">
<p><code class="flag">-V, --verbose</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Silence Output</strong></p>
<p class="description">Silence the normal output from Jekyll
during a build</p>
</td>
<td class="align-center">
<p><code class="flag">-q, --quiet</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Incremental build</strong></p>
<p class="description">
Enable the experimental incremental build feature. Incremental build only
re-builds posts and pages that have changed, resulting in significant performance
improvements for large sites, but may also break site generation in certain
cases.
</p>
</td>
<td class="align-center">
<p><code class="option">incremental: BOOL</code></p>
<p><code class="flag">-I, --incremental</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Liquid profiler</strong></p>
<p class="description">
Generate a Liquid rendering profile to help you identify performance bottlenecks.
</p>
</td>
<td class="align-center">
<p><code class="option">profile: BOOL</code></p>
<p><code class="flag">--profile</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Strict Front Matter</strong></p>
<p class="description">
Cause a build to fail if there is a YAML syntax error in a page's front matter.
</p>
</td>
<td class="align-center">
<p><code class="option">strict_front_matter: BOOL</code></p>
<p><code class="flag">--strict_front_matter</code></p>
</td>
</tr>
</tbody>
</table>
</div>
### Serve Command Options
In addition to the options below, the `serve` sub-command can accept any of the options
for the `build` sub-command, which are then applied to the site build which occurs right
before your site is served.
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Setting</th>
<th><span class="option">Options</span> and <span class="flag">Flags</span></th>
</tr>
</thead>
<tbody>
<tr class="setting">
<td>
<p class="name"><strong>Local Server Port</strong></p>
<p class="description">Listen on the given port.</p>
</td>
<td class="align-center">
<p><code class="option">port: PORT</code></p>
<p><code class="flag">--port PORT</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Local Server Hostname</strong></p>
<p class="description">Listen at the given hostname.</p>
</td>
<td class="align-center">
<p><code class="option">host: HOSTNAME</code></p>
<p><code class="flag">--host HOSTNAME</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Base URL</strong></p>
<p class="description">Serve the website from the given base URL</p>
</td>
<td class="align-center">
<p><code class="option">baseurl: URL</code></p>
<p><code class="flag">--baseurl URL</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Detach</strong></p>
<p class="description">Detach the server from the terminal</p>
</td>
<td class="align-center">
<p><code class="option">detach: BOOL</code></p>
<p><code class="flag">-B, --detach</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Skips the initial site build.</strong></p>
<p class="description">Skips the initial site build which occurs before the server is started.</p>
</td>
<td class="align-center">
<p><code class="flag">--skip-initial-build</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>X.509 (SSL) Private Key</strong></p>
<p class="description">SSL Private Key.</p>
</td>
<td class="align-center">
<p><code class="flag">--ssl-key</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>X.509 (SSL) Certificate</strong></p>
<p class="description">SSL Public certificate.</p>
</td>
<td class="align-center">
<p><code class="flag">--ssl-cert</code></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note warning">
<h5>Do not use tabs in configuration files</h5>
<p>
This will either lead to parsing errors, or Jekyll will revert to the
default settings. Use spaces instead.
</p>
</div>
## Custom WEBrick Headers
You can provide custom headers for your site by adding them to `_config.yml`
```yaml
# File: _config.yml
webrick:
headers:
My-Header: My-Value
My-Other-Header: My-Other-Value
```
### Defaults
We provide by default `Content-Type` and `Cache-Control` response headers: one
dynamic in order to specify the nature of the data being served, the other
static in order to disable caching so that you don't have to fight with Chrome's
aggressive caching when you are in development mode.
## Specifying a Jekyll environment at build time
In the build (or serve) arguments, you can specify a Jekyll environment and value. The build will then apply this value in any conditional statements in your content.
For example, suppose you set this conditional statement in your code:
```liquid
{% raw %}
{% if jekyll.environment == "production" %}
{% include disqus.html %}
{% endif %}
{% endraw %}
```
When you build your Jekyll site, the content inside the `if` statement won't be run unless you also specify a `production` environment in the build command, like this:
```sh
JEKYLL_ENV=production jekyll build
```
Specifying an environment value allows you to make certain content available only within specific environments.
The default value for `JEKYLL_ENV` is `development`. Therefore if you omit `JEKYLL_ENV` from the build arguments, the default value will be `JEKYLL_ENV=development`. Any content inside `{% raw %}{% if jekyll.environment == "development" %}{% endraw %}` tags will automatically appear in the build.
Your environment values can be anything you want (not just `development` or `production`). Some elements you might want to hide in development environments include Disqus comment forms or Google Analytics. Conversely, you might want to expose an "Edit me in GitHub" button in a development environment but not include it in production environments.
By specifying the option in the build command, you avoid having to change values in your configuration files when moving from one environment to another.
## Front Matter defaults
Using [YAML Front Matter](../frontmatter/) is one way that you can specify configuration in the pages and posts for your site. Setting things like a default layout, or customizing the title, or specifying a more precise date/time for the post can all be added to your page or post front matter.
Often times, you will find that you are repeating a lot of configuration options. Setting the same layout in each file, adding the same category - or categories - to a post, etc. You can even add custom variables like author names, which might be the same for the majority of posts on your blog.
Instead of repeating this configuration each time you create a new post or page, Jekyll provides a way to set these defaults in the site configuration. To do this, you can specify site-wide defaults using the `defaults` key in the `_config.yml` file in your project's root directory.
The `defaults` key holds an array of scope/values pairs that define what defaults should be set for a particular file path, and optionally, a file type in that path.
Let's say that you want to add a default layout to all pages and posts in your site. You would add this to your `_config.yml` file:
```yaml
defaults:
-
scope:
path: "" # an empty string here means all files in the project
values:
layout: "default"
```
<div class="note info">
<h5>Please stop and rerun `jekyll serve` command.</h5>
<p>
The <code>_config.yml</code> master configuration file contains global configurations
and variable definitions that are read once at execution time. Changes made to <code>_config.yml</code>
during automatic regeneration are not loaded until the next execution.
</p>
<p>
Note <a href="../datafiles">Data Files</a> are included and reloaded during automatic regeneration.
</p>
</div>
Here, we are scoping the `values` to any file that exists in the path `scope`. Since the path is set as an empty string, it will apply to **all files** in your project. You probably don't want to set a layout on every file in your project - like css files, for example - so you can also specify a `type` value under the `scope` key.
```yaml
defaults:
-
scope:
path: "" # an empty string here means all files in the project
type: "posts" # previously `post` in Jekyll 2.2.
values:
layout: "default"
```
Now, this will only set the layout for files where the type is `posts`.
The different types that are available to you are `pages`, `posts`, `drafts` or any collection in your site. While `type` is optional, you must specify a value for `path` when creating a `scope/values` pair.
As mentioned earlier, you can set multiple scope/values pairs for `defaults`.
```yaml
defaults:
-
scope:
path: ""
type: "pages"
values:
layout: "my-site"
-
scope:
path: "projects"
type: "pages" # previously `page` in Jekyll 2.2.
values:
layout: "project" # overrides previous default layout
author: "Mr. Hyde"
```
With these defaults, all pages would use the `my-site` layout. Any html files that exist in the `projects/` folder will use the `project` layout, if it exists. Those files will also have the `page.author` [liquid variable](../variables/) set to `Mr. Hyde`.
```yaml
collections:
my_collection:
output: true
defaults:
-
scope:
path: ""
type: "my_collection" # a collection in your site, in plural form
values:
layout: "default"
```
In this example, the `layout` is set to `default` inside the
[collection](../collections/) with the name `my_collection`.
### Glob patterns in Front Matter defaults
It is also possible to use glob patterns (currently limited to patterns that contain `*`) when matching defaults. For example, it is possible to set specific layout for each `special-page.html` in any subfolder of `section` folder. {%- include docs_version_badge.html version="3.7.0" -%}
```yaml
collections:
my_collection:
output: true
defaults:
-
scope:
path: "section/*/special-page.html"
values:
layout: "specific-layout"
```
<div class="note warning">
<h5>Globbing and Performance</h5>
<p>
Please note that globbing a path is known to have a negative effect on
performance and is currently not optimized, especially on Windows.
Globbing a path will increase your build times in proportion to the size
of the associated collection directory.
</p>
</div>
### Precedence
Jekyll will apply all of the configuration settings you specify in the `defaults` section of your `_config.yml` file. However, you can choose to override settings from other scope/values pair by specifying a more specific path for the scope.
You can see that in the second to last example above. First, we set the default page layout to `my-site`. Then, using a more specific path, we set the default layout for pages in the `projects/` path to `project`. This can be done with any value that you would set in the page or post front matter.
Finally, if you set defaults in the site configuration by adding a `defaults` section to your `_config.yml` file, you can override those settings in a post or page file. All you need to do is specify the settings in the post or page front matter. For example:
```yaml
# In _config.yml
...
defaults:
-
scope:
path: "projects"
type: "pages"
values:
layout: "project"
author: "Mr. Hyde"
category: "project"
...
```
```yaml
# In projects/foo_project.md
---
author: "John Smith"
layout: "foobar"
---
The post text goes here...
```
The `projects/foo_project.md` would have the `layout` set to `foobar` instead
of `project` and the `author` set to `John Smith` instead of `Mr. Hyde` when
the site is built.
## Default Configuration
Jekyll runs with the following configuration options by default. Alternative
settings for these options can be explicitly specified in the configuration
file or on the command-line.
<div class="note warning">
<h5>There are two unsupported kramdown options</h5>
<p>
Please note that both <code>remove_block_html_tags</code> and
<code>remove_span_html_tags</code> are currently unsupported in Jekyll due
to the fact that they are not included within the kramdown HTML converter.
</p>
</div>
```yaml
# Where things are
source: .
destination: ./_site
collections_dir: .
plugins_dir: _plugins
layouts_dir: _layouts
data_dir: _data
includes_dir: _includes
collections:
posts:
output: true
# Handling Reading
safe: false
include: [".htaccess"]
exclude: ["Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"]
keep_files: [".git", ".svn"]
encoding: "utf-8"
markdown_ext: "markdown,mkdown,mkdn,mkd,md"
strict_front_matter: false
# Filtering Content
show_drafts: null
limit_posts: 0
future: false
unpublished: false
# Plugins
whitelist: []
plugins: []
# Conversion
markdown: kramdown
highlighter: rouge
lsi: false
excerpt_separator: "\n\n"
incremental: false
# Serving
detach: false
port: 4000
host: 127.0.0.1
baseurl: "" # does not include hostname
show_dir_listing: false
# Outputting
permalink: date
paginate_path: /page:num
timezone: null
quiet: false
verbose: false
defaults: []
liquid:
error_mode: warn
strict_filters: false
strict_variables: false
# Markdown Processors
rdiscount:
extensions: []
redcarpet:
extensions: []
kramdown:
auto_ids: true
entity_output: as_char
toc_levels: 1..6
smart_quotes: lsquo,rsquo,ldquo,rdquo
input: GFM
hard_wrap: false
footnote_nr: 1
show_warnings: false
```
## Liquid Options
Liquid's response to errors can be configured by setting `error_mode`. The
options are
- `lax` --- Ignore all errors.
- `warn` --- Output a warning on the console for each error.
- `strict` --- Output an error message and stop the build.
You can also configure Liquid's renderer to catch non-assigned variables and
non-existing filters by setting `strict_variables` and / or `strict_filters`
to `true` respectively. {% include docs_version_badge.html version="3.8.0" %}
Do note that while `error_mode` configures Liquid's parser, the `strict_variables`
and `strict_filters` options configure Liquid's renderer and are consequently,
mutually exclusive.
## Markdown Options
The various Markdown renderers supported by Jekyll sometimes have extra options
available.
### Redcarpet
Redcarpet can be configured by providing an `extensions` sub-setting, whose
value should be an array of strings. Each string should be the name of one of
the `Redcarpet::Markdown` class's extensions; if present in the array, it will
set the corresponding extension to `true`.
Jekyll handles two special Redcarpet extensions:
- `no_fenced_code_blocks` --- By default, Jekyll sets the `fenced_code_blocks`
extension (for delimiting code blocks with triple tildes or triple backticks)
to `true`, probably because GitHub's eager adoption of them is starting to make
them inescapable. Redcarpet's normal `fenced_code_blocks` extension is inert
when used with Jekyll; instead, you can use this inverted version of the
extension for disabling fenced code.
Note that you can also specify a language for highlighting after the first
delimiter:
```ruby
# ...ruby code
```
With both fenced code blocks and highlighter enabled, this will statically
highlight the code; without any syntax highlighter, it will add a
`class="LANGUAGE"` attribute to the `<code>` element, which can be used as a
hint by various JavaScript code highlighting libraries.
- `smart` --- This pseudo-extension turns on SmartyPants, which converts
straight quotes to curly quotes and runs of hyphens to em (`---`) and en (`--`) dashes.
All other extensions retain their usual names from Redcarpet, and no renderer
options aside from `smart` can be specified in Jekyll. [A list of available
extensions can be found in the Redcarpet README file.][redcarpet_extensions]
Make sure you're looking at the README for the right version of
Redcarpet: Jekyll currently uses v3.2.x. The most commonly used
extensions are:
- `tables`
- `no_intra_emphasis`
- `autolink`
[redcarpet_extensions]: https://github.com/vmg/redcarpet/blob/v3.2.2/README.markdown#and-its-like-really-simple-to-use
### Custom Markdown Processors
If you're interested in creating a custom markdown processor, you're in luck! Create a new class in the `Jekyll::Converters::Markdown` namespace:
```ruby
class Jekyll::Converters::Markdown::MyCustomProcessor
def initialize(config)
require 'funky_markdown'
@config = config
rescue LoadError
STDERR.puts 'You are missing a library required for Markdown. Please run:'
STDERR.puts ' $ [sudo] gem install funky_markdown'
raise FatalException.new("Missing dependency: funky_markdown")
end
def convert(content)
::FunkyMarkdown.new(content).convert
end
end
```
Once you've created your class and have it properly set up either as a plugin
in the `_plugins` folder or as a gem, specify it in your `_config.yml`:
```yaml
markdown: MyCustomProcessor
```
## Incremental Regeneration
<div class="note warning">
<h5>Incremental regeneration is still an experimental feature</h5>
<p>
While incremental regeneration will work for the most common cases, it will
not work correctly in every scenario. Please be extremely cautious when
using the feature, and report any problems not listed below by
<a href="https://github.com/jekyll/jekyll/issues/new">opening an issue on GitHub</a>.
</p>
</div>
Incremental regeneration helps shorten build times by only generating documents
and pages that were updated since the previous build. It does this by keeping
track of both file modification times and inter-document dependencies in the
`.jekyll-metadata` file.
Under the current implementation, incremental regeneration will only generate a
document or page if either it, or one of its dependencies, is modified. Currently,
the only types of dependencies tracked are includes (using the
{% raw %}`{% include %}`{% endraw %} tag) and layouts. This means that plain
references to other documents (for example, the common case of iterating over
`site.posts` in a post listings page) will not be detected as a dependency.
To remedy some of these shortfalls, putting `regenerate: true` in the front-matter
of a document will force Jekyll to regenerate it regardless of whether it has been
modified. Note that this will generate the specified document only; references
to other documents' contents will not work since they won't be re-rendered.
Incremental regeneration can be enabled via the `--incremental` flag (`-I` for
short) from the command-line or by setting `incremental: true` in your
configuration file.

View File

@ -0,0 +1,86 @@
---
title: Default Configuration
permalink: "/docs/configuration/default/"
---
Jekyll runs with the following configuration options by default. Alternative
settings for these options can be explicitly specified in the configuration
file or on the command-line.
```yaml
# Where things are
source : .
destination : ./_site
collections_dir : .
plugins_dir : _plugins
layouts_dir : _layouts
data_dir : _data
includes_dir : _includes
collections:
posts:
output : true
# Handling Reading
safe : false
include : [".htaccess"]
exclude : ["Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"]
keep_files : [".git", ".svn"]
encoding : "utf-8"
markdown_ext : "markdown,mkdown,mkdn,mkd,md"
strict_front_matter : false
# Filtering Content
show_drafts : null
limit_posts : 0
future : false
unpublished : false
# Plugins
whitelist : []
plugins : []
# Conversion
markdown : kramdown
highlighter : rouge
lsi : false
excerpt_separator : "\n\n"
incremental : false
# Serving
detach : false
port : 4000
host : 127.0.0.1
baseurl : "" # does not include hostname
show_dir_listing : false
# Outputting
permalink : date
paginate_path : /page:num
timezone : null
quiet : false
verbose : false
defaults : []
liquid:
error_mode : warn
strict_filters : false
strict_variables : false
# Markdown Processors
rdiscount:
extensions : []
redcarpet:
extensions : []
kramdown:
auto_ids : true
entity_output : as_char
toc_levels : 1..6
smart_quotes : lsquo,rsquo,ldquo,rdquo
input : GFM
hard_wrap : false
footnote_nr : 1
show_warnings : false
```

View File

@ -0,0 +1,43 @@
---
title: Environments
permalink: "/docs/configuration/environments/"
---
In the `build` (or `serve`) arguments, you can specify a Jekyll environment
and value. The build will then apply this value in any conditional statements
in your content.
For example, suppose you set this conditional statement in your code:
{% raw %}
```liquid
{% if jekyll.environment == "production" %}
{% include disqus.html %}
{% endif %}
```
{% endraw %}
When you build your Jekyll site, the content inside the `if` statement won't be
run unless you also specify a `production` environment in the build command,
like this:
```sh
JEKYLL_ENV=production jekyll build
```
Specifying an environment value allows you to make certain content available
only within specific environments.
The default value for `JEKYLL_ENV` is `development`. Therefore if you omit
`JEKYLL_ENV` from the build arguments, the default value will be
`JEKYLL_ENV=development`. Any content inside
{% raw %}`{% if jekyll.environment == "development" %}`{% endraw %} tags will
automatically appear in the build.
Your environment values can be anything you want (not just `development` or
`production`). Some elements you might want to hide in development
environments include Disqus comment forms or Google Analytics. Conversely,
you might want to expose an "Edit me in GitHub" button in a development
environment but not include it in production environments.
By specifying the option in the build command, you avoid having to change
values in your configuration files when moving from one environment to another.

View File

@ -0,0 +1,152 @@
---
title: Front Matter Defaults
permalink: "/docs/configuration/front-matter-defaults/"
---
Using [front matter](/docs/front-matter/) is one way that you can specify configuration in the pages and posts for your site. Setting things like a default layout, or customizing the title, or specifying a more precise date/time for the post can all be added to your page or post front matter.
Often times, you will find that you are repeating a lot of configuration options. Setting the same layout in each file, adding the same category - or categories - to a post, etc. You can even add custom variables like author names, which might be the same for the majority of posts on your blog.
Instead of repeating this configuration each time you create a new post or page, Jekyll provides a way to set these defaults in the site configuration. To do this, you can specify site-wide defaults using the `defaults` key in the `_config.yml` file in your project's root directory.
The `defaults` key holds an array of scope/values pairs that define what defaults should be set for a particular file path, and optionally, a file type in that path.
Let's say that you want to add a default layout to all pages and posts in your site. You would add this to your `_config.yml` file:
```yaml
defaults:
-
scope:
path: "" # an empty string here means all files in the project
values:
layout: "default"
```
<div class="note info">
<h5>Stop and rerun `jekyll serve` command.</h5>
<p>
The <code>_config.yml</code> master configuration file contains global configurations
and variable definitions that are read once at execution time. Changes made to <code>_config.yml</code>
during automatic regeneration are not loaded until the next execution.
</p>
<p>
Note <a href="/docs/datafiles">Data Files</a> are included and reloaded during automatic regeneration.
</p>
</div>
Here, we are scoping the `values` to any file that exists in the path `scope`. Since the path is set as an empty string, it will apply to **all files** in your project. You probably don't want to set a layout on every file in your project - like css files, for example - so you can also specify a `type` value under the `scope` key.
```yaml
defaults:
-
scope:
path: "" # an empty string here means all files in the project
type: "posts" # previously `post` in Jekyll 2.2.
values:
layout: "default"
```
Now, this will only set the layout for files where the type is `posts`.
The different types that are available to you are `pages`, `posts`, `drafts` or any collection in your site. While `type` is optional, you must specify a value for `path` when creating a `scope/values` pair.
As mentioned earlier, you can set multiple scope/values pairs for `defaults`.
```yaml
defaults:
-
scope:
path: ""
type: "pages"
values:
layout: "my-site"
-
scope:
path: "projects"
type: "pages" # previously `page` in Jekyll 2.2.
values:
layout: "project" # overrides previous default layout
author: "Mr. Hyde"
```
With these defaults, all pages would use the `my-site` layout. Any html files that exist in the `projects/` folder will use the `project` layout, if it exists. Those files will also have the `page.author` [liquid variable](/docs/variables/) set to `Mr. Hyde`.
```yaml
collections:
my_collection:
output: true
defaults:
-
scope:
path: ""
type: "my_collection" # a collection in your site, in plural form
values:
layout: "default"
```
In this example, the `layout` is set to `default` inside the
[collection](/docs/collections/) with the name `my_collection`.
### Glob patterns in Front Matter defaults
It is also possible to use glob patterns (currently limited to patterns that contain `*`) when matching defaults. For example, it is possible to set specific layout for each `special-page.html` in any subfolder of `section` folder. {%- include docs_version_badge.html version="3.7.0" -%}
```yaml
collections:
my_collection:
output: true
defaults:
-
scope:
path: "section/*/special-page.html"
values:
layout: "specific-layout"
```
<div class="note warning">
<h5>Globbing and Performance</h5>
<p>
Please note that globbing a path is known to have a negative effect on
performance and is currently not optimized, especially on Windows.
Globbing a path will increase your build times in proportion to the size
of the associated collection directory.
</p>
</div>
### Precedence
Jekyll will apply all of the configuration settings you specify in the `defaults` section of your `_config.yml` file. However, you can choose to override settings from other scope/values pair by specifying a more specific path for the scope.
You can see that in the second to last example above. First, we set the default page layout to `my-site`. Then, using a more specific path, we set the default layout for pages in the `projects/` path to `project`. This can be done with any value that you would set in the page or post front matter.
Finally, if you set defaults in the site configuration by adding a `defaults` section to your `_config.yml` file, you can override those settings in a post or page file. All you need to do is specify the settings in the post or page front matter. For example:
```yaml
# In _config.yml
...
defaults:
-
scope:
path: "projects"
type: "pages"
values:
layout: "project"
author: "Mr. Hyde"
category: "project"
...
```
```yaml
# In projects/foo_project.md
---
author: "John Smith"
layout: "foobar"
---
The post text goes here...
```
The `projects/foo_project.md` would have the `layout` set to `foobar` instead
of `project` and the `author` set to `John Smith` instead of `Mr. Hyde` when
the site is built.

View File

@ -0,0 +1,36 @@
---
title: Default Configuration
permalink: "/docs/configuration/incremental-regeneration/"
---
## Incremental Regeneration
<div class="note warning">
<h5>Incremental regeneration is still an experimental feature</h5>
<p>
While incremental regeneration will work for the most common cases, it will
not work correctly in every scenario. Please be extremely cautious when
using the feature, and report any problems not listed below by
<a href="https://github.com/jekyll/jekyll/issues/new">opening an issue on GitHub</a>.
</p>
</div>
Incremental regeneration helps shorten build times by only generating documents
and pages that were updated since the previous build. It does this by keeping
track of both file modification times and inter-document dependencies in the
`.jekyll-metadata` file.
Under the current implementation, incremental regeneration will only generate a
document or page if either it, or one of its dependencies, is modified. Currently,
the only types of dependencies tracked are includes (using the
{% raw %}`{% include %}`{% endraw %} tag) and layouts. This means that plain
references to other documents (for example, the common case of iterating over
`site.posts` in a post listings page) will not be detected as a dependency.
To remedy some of these shortfalls, putting `regenerate: true` in the front-matter
of a document will force Jekyll to regenerate it regardless of whether it has been
modified. Note that this will generate the specified document only; references
to other documents' contents will not work since they won't be re-rendered.
Incremental regeneration can be enabled via the `--incremental` flag (`-I` for
short) from the command-line or by setting `incremental: true` in your
configuration file.

View File

@ -0,0 +1,18 @@
---
title: Liquid Options
permalink: "/docs/configuration/liquid/"
---
Liquid's response to errors can be configured by setting `error_mode`. The
options are
- `lax` --- Ignore all errors.
- `warn` --- Output a warning on the console for each error.
- `strict` --- Output an error message and stop the build.
You can also configure Liquid's renderer to catch non-assigned variables and
non-existing filters by setting `strict_variables` and / or `strict_filters`
to `true` respectively. {% include docs_version_badge.html version="3.8.0" %}
Do note that while `error_mode` configures Liquid's parser, the `strict_variables`
and `strict_filters` options configure Liquid's renderer and are consequently,
mutually exclusive.

View File

@ -0,0 +1,124 @@
---
title: Markdown Options
permalink: "/docs/configuration/markdown/"
---
The various Markdown renderers supported by Jekyll sometimes have extra options
available.
### Kramdown
Kramdown is the default Markdown renderer for Jekyll. Below is a list of the
currently supported options:
* **auto_id_prefix** - Prefix used for automatically generated header IDs
* **auto_id_stripping** - Strip all formatting from header text for automatic ID generation
* **auto_ids** - Use automatic header ID generation
* **coderay_bold_every** - Defines how often a line number should be made bold
* **coderay_css** - Defines how the highlighted code gets styled
* **coderay_default_lang** - Sets the default language for highlighting code blocks
* **coderay_line_number_start** - The start value for the line numbers
* **coderay_line_numbers** - Defines how and if line numbers should be shown
* **coderay_tab_width** - The tab width used in highlighted code
* **coderay_wrap** - Defines how the highlighted code should be wrapped
* **enable_coderay** - Use coderay for syntax highlighting
* **entity_output** - Defines how entities are output
* **footnote_backlink** - Defines the text that should be used for the footnote backlinks
* **footnote_backlink_inline** - Specifies whether the footnote backlink should always be inline
* **footnote_nr** - The number of the first footnote
* **gfm_quirks** - Enables a set of GFM specific quirks
* **hard_wrap** - Interprets line breaks literally
* **header_offset** - Sets the output offset for headers
* **html_to_native** - Convert HTML elements to native elements
* **line_width** - Defines the line width to be used when outputting a document
* **link_defs** - Pre-defines link definitions
* **math_engine** - Set the math engine
* **math_engine_opts** - Set the math engine options
* **parse_block_html** - Process kramdown syntax in block HTML tags
* **parse_span_html** - Process kramdown syntax in span HTML tags
* **smart_quotes** - Defines the HTML entity names or code points for smart quote output
* **syntax_highlighter** - Set the syntax highlighter
* **syntax_highlighter_opts** - Set the syntax highlighter options
* **toc_levels** - Defines the levels that are used for the table of contents
* **transliterated_header_ids** - Transliterate the header text before generating the ID
* **typographic_symbols** - Defines a mapping from typographical symbol to output characters
<div class="note warning">
<h5>There are two unsupported kramdown options</h5>
<p>
Please note that both <code>remove_block_html_tags</code> and
<code>remove_span_html_tags</code> are currently unsupported in Jekyll due
to the fact that they are not included within the kramdown HTML converter.
</p>
</div>
For more details about these options have a look at the [Kramdown configuration documentation](https://kramdown.gettalong.org/options.html).
### Redcarpet
Redcarpet can be configured by providing an `extensions` sub-setting, whose
value should be an array of strings. Each string should be the name of one of
the `Redcarpet::Markdown` class's extensions; if present in the array, it will
set the corresponding extension to `true`.
Jekyll handles two special Redcarpet extensions:
- `no_fenced_code_blocks` --- By default, Jekyll sets the `fenced_code_blocks`
extension (for delimiting code blocks with triple tildes or triple backticks)
to `true`, probably because GitHub's eager adoption of them is starting to make
them inescapable. Redcarpet's normal `fenced_code_blocks` extension is inert
when used with Jekyll; instead, you can use this inverted version of the
extension for disabling fenced code.
Note that you can also specify a language for highlighting after the first
delimiter:
```ruby
# ...ruby code
```
With both fenced code blocks and highlighter enabled, this will statically
highlight the code; without any syntax highlighter, it will add a
`class="LANGUAGE"` attribute to the `<code>` element, which can be used as a
hint by various JavaScript code highlighting libraries.
- `smart` --- This pseudo-extension turns on SmartyPants, which converts
straight quotes to curly quotes and runs of hyphens to em (`---`) and en (`--`) dashes.
All other extensions retain their usual names from Redcarpet, and no renderer
options aside from `smart` can be specified in Jekyll. [A list of available
extensions can be found in the Redcarpet README file.](https://github.com/vmg/redcarpet/blob/v3.2.2/README.markdown#and-its-like-really-simple-to-use)
Make sure you're looking at the README for the right version of
Redcarpet: Jekyll currently uses v3.2.x. The most commonly used
extensions are:
- `tables`
- `no_intra_emphasis`
- `autolink`
### Custom Markdown Processors
If you're interested in creating a custom markdown processor, you're in luck! Create a new class in the `Jekyll::Converters::Markdown` namespace:
```ruby
class Jekyll::Converters::Markdown::MyCustomProcessor
def initialize(config)
require 'funky_markdown'
@config = config
rescue LoadError
STDERR.puts 'You are missing a library required for Markdown. Please run:'
STDERR.puts ' $ [sudo] gem install funky_markdown'
raise FatalException.new("Missing dependency: funky_markdown")
end
def convert(content)
::FunkyMarkdown.new(content).convert
end
end
```
Once you've created your class and have it properly set up either as a plugin
in the `_plugins` folder or as a gem, specify it in your `_config.yml`:
```yaml
markdown: MyCustomProcessor
```

View File

@ -0,0 +1,409 @@
---
title: Configuration Options
permalink: "/docs/configuration/options/"
---
The tables below list the available settings for Jekyll, and the various <code
class="option">options</code> (specified in the configuration file) and <code
class="flag">flags</code> (specified on the command-line) that control them.
### Global Configuration
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Setting</th>
<th>
<span class="option">Options</span> and <span class="flag">Flags</span>
</th>
</tr>
</thead>
<tbody>
<tr class="setting">
<td>
<p class="name"><strong>Site Source</strong></p>
<p class="description">Change the directory where Jekyll will read files</p>
</td>
<td class="align-center">
<p><code class="option">source: DIR</code></p>
<p><code class="flag">-s, --source DIR</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Site Destination</strong></p>
<p class="description">Change the directory where Jekyll will write files</p>
</td>
<td class="align-center">
<p><code class="option">destination: DIR</code></p>
<p><code class="flag">-d, --destination DIR</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Safe</strong></p>
<p class="description">Disable <a href="/docs/plugins/">custom plugins, and ignore symbolic links</a>.</p>
</td>
<td class="align-center">
<p><code class="option">safe: BOOL</code></p>
<p><code class="flag">--safe</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Exclude</strong></p>
<p class="description">
Exclude directories and/or files from the
conversion. These exclusions are relative to the site's
source directory and cannot be outside the source directory.
</p>
</td>
<td class="align-center">
<p><code class="option">exclude: [DIR, FILE, ...]</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Include</strong></p>
<p class="description">
Force inclusion of directories and/or files in the conversion.
<code>.htaccess</code> is a good example since dotfiles are excluded
by default.
</p>
</td>
<td class="align-center">
<p><code class="option">include: [DIR, FILE, ...]</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Keep files</strong></p>
<p class="description">
When clobbering the site destination, keep the selected files.
Useful for files that are not generated by jekyll; e.g. files or
assets that are generated by your build tool.
The paths are relative to the <code>destination</code>.
</p>
</td>
<td class="align-center">
<p><code class="option">keep_files: [DIR, FILE, ...]</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Time Zone</strong></p>
<p class="description">
Set the time zone for site generation. This sets the <code>TZ</code>
environment variable, which Ruby uses to handle time and date
creation and manipulation. Any entry from the
<a href="https://en.wikipedia.org/wiki/Tz_database">IANA Time Zone
Database</a> is valid, e.g. <code>America/New_York</code>. A list of all
available values can be found <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">
here</a>. When serving on a local machine, the default time zone is set by your operating system. But when served on a remote host/server, the default time zone depends on the server's setting or location.
</p>
</td>
<td class="align-center">
<p><code class="option">timezone: TIMEZONE</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Encoding</strong></p>
<p class="description">
Set the encoding of files by name (only available for Ruby
1.9 or later).
The default value is <code>utf-8</code> starting in 2.0.0,
and <code>nil</code> before 2.0.0, which will yield the Ruby
default of <code>ASCII-8BIT</code>.
Available encodings can be shown by the
command <code>ruby -e 'puts Encoding::list.join("\n")'</code>.
</p>
</td>
<td class="align-center">
<p><code class="option">encoding: ENCODING</code></p>
</td>
</tr>
<tr>
<td>
<p class='name'><strong>Defaults</strong></p>
<p class='description'>
Set defaults for <a href="/docs/front-matter/" title="front matter">front matter</a>
variables.
</p>
</td>
<td class='align-center'>
<p>see <a href="/docs/configuration/front-matter-defaults/" title="details">below</a></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note warning">
<h5>Destination folders are cleaned on site builds</h5>
<p>
The contents of <code>&lt;destination&gt;</code> are automatically
cleaned, by default, when the site is built. Files or folders that are not
created by your site will be removed. Some files could be retained
by specifying them within the <code>&lt;keep_files&gt;</code> configuration directive.
</p>
<p>
Do not use an important location for <code>&lt;destination&gt;</code>; instead, use it as
a staging area and copy files from there to your web server.
</p>
</div>
### Build Command Options
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Setting</th>
<th><span class="option">Options</span> and <span class="flag">Flags</span></th>
</tr>
</thead>
<tbody>
<tr class="setting">
<td>
<p class="name"><strong>Regeneration</strong></p>
<p class="description">Enable auto-regeneration of the site when files are modified.</p>
</td>
<td class="align-center">
<p><code class="flag">-w, --[no-]watch</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Configuration</strong></p>
<p class="description">Specify config files instead of using <code>_config.yml</code> automatically. Settings in later files override settings in earlier files.</p>
</td>
<td class="align-center">
<p><code class="flag">--config FILE1[,FILE2,...]</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Drafts</strong></p>
<p class="description">Process and render draft posts.</p>
</td>
<td class="align-center">
<p><code class="option">show_drafts: BOOL</code></p>
<p><code class="flag">--drafts</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Environment</strong></p>
<p class="description">Use a specific environment value in the build.</p>
</td>
<td class="align-center">
<p><code class="flag">JEKYLL_ENV=production</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Future</strong></p>
<p class="description">Publish posts or collection documents with a future date.</p>
</td>
<td class="align-center">
<p><code class="option">future: BOOL</code></p>
<p><code class="flag">--future</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Unpublished</strong></p>
<p class="description">Render posts that were marked as unpublished.</p>
</td>
<td class="align-center">
<p><code class="option">unpublished: BOOL</code></p>
<p><code class="flag">--unpublished</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>LSI</strong></p>
<p class="description">Produce an index for related posts. Requires the <a href="http://www.classifier-reborn.com/">classifier-reborn</a> plugin.</p>
</td>
<td class="align-center">
<p><code class="option">lsi: BOOL</code></p>
<p><code class="flag">--lsi</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Limit Posts</strong></p>
<p class="description">Limit the number of posts to parse and publish.</p>
</td>
<td class="align-center">
<p><code class="option">limit_posts: NUM</code></p>
<p><code class="flag">--limit_posts NUM</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Force polling</strong></p>
<p class="description">Force watch to use polling.</p>
</td>
<td class="align-center">
<p><code class="flag">--force_polling</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Verbose output</strong></p>
<p class="description">Print verbose output.</p>
</td>
<td class="align-center">
<p><code class="flag">-V, --verbose</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Silence Output</strong></p>
<p class="description">Silence the normal output from Jekyll
during a build</p>
</td>
<td class="align-center">
<p><code class="flag">-q, --quiet</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Incremental build</strong></p>
<p class="description">
Enable the experimental incremental build feature. Incremental build only
re-builds posts and pages that have changed, resulting in significant performance
improvements for large sites, but may also break site generation in certain
cases.
</p>
</td>
<td class="align-center">
<p><code class="option">incremental: BOOL</code></p>
<p><code class="flag">-I, --incremental</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Liquid profiler</strong></p>
<p class="description">
Generate a Liquid rendering profile to help you identify performance bottlenecks.
</p>
</td>
<td class="align-center">
<p><code class="option">profile: BOOL</code></p>
<p><code class="flag">--profile</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Strict Front Matter</strong></p>
<p class="description">
Cause a build to fail if there is a YAML syntax error in a page's front matter.
</p>
</td>
<td class="align-center">
<p><code class="option">strict_front_matter: BOOL</code></p>
<p><code class="flag">--strict_front_matter</code></p>
</td>
</tr>
</tbody>
</table>
</div>
### Serve Command Options
In addition to the options below, the `serve` sub-command can accept any of the options
for the `build` sub-command, which are then applied to the site build which occurs right
before your site is served.
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Setting</th>
<th><span class="option">Options</span> and <span class="flag">Flags</span></th>
</tr>
</thead>
<tbody>
<tr class="setting">
<td>
<p class="name"><strong>Local Server Port</strong></p>
<p class="description">Listen on the given port.</p>
</td>
<td class="align-center">
<p><code class="option">port: PORT</code></p>
<p><code class="flag">--port PORT</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Local Server Hostname</strong></p>
<p class="description">Listen at the given hostname.</p>
</td>
<td class="align-center">
<p><code class="option">host: HOSTNAME</code></p>
<p><code class="flag">--host HOSTNAME</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Base URL</strong></p>
<p class="description">Serve the website from the given base URL</p>
</td>
<td class="align-center">
<p><code class="option">baseurl: URL</code></p>
<p><code class="flag">--baseurl URL</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Detach</strong></p>
<p class="description">Detach the server from the terminal</p>
</td>
<td class="align-center">
<p><code class="option">detach: BOOL</code></p>
<p><code class="flag">-B, --detach</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>Skips the initial site build.</strong></p>
<p class="description">Skips the initial site build which occurs before the server is started.</p>
</td>
<td class="align-center">
<p><code class="flag">--skip-initial-build</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>X.509 (SSL) Private Key</strong></p>
<p class="description">SSL Private Key.</p>
</td>
<td class="align-center">
<p><code class="flag">--ssl-key</code></p>
</td>
</tr>
<tr class="setting">
<td>
<p class="name"><strong>X.509 (SSL) Certificate</strong></p>
<p class="description">SSL Public certificate.</p>
</td>
<td class="align-center">
<p><code class="flag">--ssl-cert</code></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note warning">
<h5>Do not use tabs in configuration files</h5>
<p>
This will either lead to parsing errors, or Jekyll will revert to the
default settings. Use spaces instead.
</p>
</div>

View File

@ -0,0 +1,20 @@
---
title: WEBrick Options
permalink: "/docs/configuration/webrick/"
---
You can provide custom headers for your site by adding them to `_config.yml`
```yaml
# File: _config.yml
webrick:
headers:
My-Header: My-Value
My-Other-Header: My-Other-Value
```
### Defaults
Jekyll provides by default `Content-Type` and `Cache-Control` response
headers: one dynamic in order to specify the nature of the data being served,
the other static in order to disable caching so that you don't have to fight
with Chrome's aggressive caching when you are in development mode.

View File

@ -21,8 +21,6 @@ title: "Buddy"
Whenever you make a push to the selected branch, the Jekyll action runs `jekyll build` in an isolated [Jekyll Docker image][jekyll-docker-image]. The output is generated to the `/filesystem` directory, and can be further deployed to FTP/SFTP and IaaS services. You can add your own commands, install additional packages, attach services, and run Selenium tests, as well as add other actions down the pipeline, eg. a Slack notification or an SSH script that will restart your server. Whenever you make a push to the selected branch, the Jekyll action runs `jekyll build` in an isolated [Jekyll Docker image][jekyll-docker-image]. The output is generated to the `/filesystem` directory, and can be further deployed to FTP/SFTP and IaaS services. You can add your own commands, install additional packages, attach services, and run Selenium tests, as well as add other actions down the pipeline, eg. a Slack notification or an SSH script that will restart your server.
![Jekyll Build](https://buddy.works/data/blog/_images/buddyworks-jekyll-small.png)
[jekyll-docker-image]: https://hub.docker.com/r/jekyll/jekyll/ [jekyll-docker-image]: https://hub.docker.com/r/jekyll/jekyll/
## 3. Using YAML for configuration ## 3. Using YAML for configuration

View File

@ -12,7 +12,7 @@ Building, testing, and deploying your Jekyll-generated website can quickly be do
To start building your project on CircleCI, all you need to do is 'follow' your project from CircleCI's website: To start building your project on CircleCI, all you need to do is 'follow' your project from CircleCI's website:
1. Visit the 'Add Projects' page: <https://circleci.com/add-projects> 1. Visit the 'Add Projects' page
1. From the GitHub or Bitbucket tab on the left, choose a user or organization. 1. From the GitHub or Bitbucket tab on the left, choose a user or organization.
1. Find your project in the list and click 'Build project' on the right. 1. Find your project in the list and click 'Build project' on the right.
1. The first build will start on its own. You can start telling CircleCI how to build your project by creating a [circle.yml][3] file in the root of your repository. 1. The first build will start on its own. You can start telling CircleCI how to build your project by creating a [circle.yml][3] file in the root of your repository.

View File

@ -1,10 +0,0 @@
---
title: Continuous Integration
permalink: /docs/continuous-integration/
---
Continuous Integration (CI) enables you to publish your Jekyll generated website with confidence by automating the quality assurance and deployment processes. You can quickly get started using CI with one of the providers below:
* [Travis CI](travis-ci)
* [CircleCI](circleci)
* [Buddy](buddyworks)

View File

@ -18,9 +18,8 @@ Plugins/themes can also leverage Data Files to set configuration variables.
## The Data Folder ## The Data Folder
As explained on the [directory structure](../structure/) page, the `_data` The `_data` folder is where you can store additional data for Jekyll to use when
folder is where you can store additional data for Jekyll to use when generating generating your site. These files must be YAML, JSON, or CSV files (using either
your site. These files must be YAML, JSON, or CSV files (using either
the `.yml`, `.yaml`, `.json` or `.csv` extension), and they will be the `.yml`, `.yaml`, `.json` or `.csv` extension), and they will be
accessible via `site.data`. accessible via `site.data`.
@ -70,10 +69,7 @@ You can now render the list of members in a template:
``` ```
{% endraw %} {% endraw %}
{: .note .info } ## Subfolders
If your Jekyll site has a lot of pages, such as with documentation websites, see the detailed examples in [how to build robust navigation for your site]({% link _tutorials/navigation.md %}).
## Example: Organizations
Data files can also be placed in sub-folders of the `_data` folder. Each folder Data files can also be placed in sub-folders of the `_data` folder. Each folder
level will be added to a variable's namespace. The example below shows how level will be added to a variable's namespace. The example below shows how
@ -134,7 +130,7 @@ dave:
twitter: DavidSilvaSmith twitter: DavidSilvaSmith
``` ```
The author can then be specified as a page variable in a post's frontmatter: The author can then be specified as a page variable in a post's front matter:
{% raw %} {% raw %}
```liquid ```liquid

View File

@ -1,220 +0,0 @@
---
title: Deployment methods
permalink: /docs/deployment-methods/
---
Sites built using Jekyll can be deployed in a large number of ways due to the static nature of the generated output. A few of the most common deployment techniques are described below.
<div class="note">
<h5>ProTip™: Use GitHub Pages for zero-hassle Jekyll hosting</h5>
<p>GitHub Pages are powered by Jekyll behind the scenes, so if youre looking for a zero-hassle, zero-cost solution, GitHub Pages are a great way to <a href="../github-pages/">host your Jekyll-powered website for free</a>.</p>
</div>
## Netlify
Netlify provides Global CDN, Continuous Deployment, one click HTTPS and [much more](https://www.netlify.com/features/), providing developers the most robust toolset available for modern web projects, without added complexity. Netlify supports custom plugins for Jekyll and has a free plan for open source projects.
Read this [Jekyll step-by-step guide](https://www.netlify.com/blog/2015/10/28/a-step-by-step-guide-jekyll-3.0-on-netlify/) to setup your Jekyll site on Netlify.
## Aerobatic
[Aerobatic](https://www.aerobatic.com) has custom domains, global CDN distribution, basic auth, CORS proxying, and a growing list of plugins all included.
Automating the deployment of a Jekyll site is simple. See their [Jekyll docs](https://www.aerobatic.com/docs/static-site-generators/#jekyll) for more details. Your built `_site` folder is deployed to their highly-available, globally distributed hosting service.
## Kickster
Use [Kickster](http://kickster.nielsenramon.com/) for easy (automated) deploys to GitHub Pages when using unsupported plugins on GitHub Pages.
Kickster provides a basic Jekyll project setup packed with web best practises and useful optimization tools increasing your overall project quality. Kickster ships with automated and worry-free deployment scripts for GitHub Pages.
Setting up Kickster is very easy, just install the gem and you are good to go. More documentation can here found [here](https://github.com/nielsenramon/kickster#kickster). If you do not want to use the gem or start a new project you can just copy paste the deployment scripts for [Travis CI](https://github.com/nielsenramon/kickster/tree/master/snippets/travis) or [Circle CI](https://github.com/nielsenramon/kickster#automated-deployment-with-circle-ci).
## Web hosting providers (FTP)
Just about any traditional web hosting provider will let you upload files to their servers over FTP. To upload a Jekyll site to a web host using FTP, simply run the `jekyll build` command and copy the contents of the generated `_site` folder to the root folder of your hosting account. This is most likely to be the `httpdocs` or `public_html` folder on most hosting providers.
## Self-managed web server
If you have direct access to the deployment web server, the process is essentially the same, except you might have other methods available to you (such as `scp`, or even direct filesystem access) for transferring the files. Just remember to make sure the contents of the generated `_site` folder get placed in the appropriate web root directory for your web server.
## Automated methods
There are also a number of ways to easily automate the deployment of a Jekyll site. If youve got another method that isnt listed below, wed love it if you [contributed](../contributing/) so that everyone else can benefit too.
### Git post-update hook
If you store your Jekyll site in [Git](https://git-scm.com/) (you are using
version control, right?), its pretty easy to automate the
deployment process by setting up a post-update hook in your Git
repository, [like
this](http://web.archive.org/web/20091223025644/http://www.taknado.com/en/2009/03/26/deploying-a-jekyll-generated-site/).
### Git post-receive hook
To have a remote server handle the deploy for you every time you push changes using Git, you can create a user account which has all the public keys that are authorized to deploy in its `authorized_keys` file. With that in place, setting up the post-receive hook is done as follows:
```sh
laptop$ ssh deployer@example.com
server$ mkdir myrepo.git
server$ cd myrepo.git
server$ git --bare init
server$ cp hooks/post-receive.sample hooks/post-receive
server$ mkdir /var/www/myrepo
```
Next, add the following lines to hooks/post-receive and be sure Jekyll is
installed on the server:
```bash
GIT_REPO=$HOME/myrepo.git
TMP_GIT_CLONE=$HOME/tmp/myrepo
GEMFILE=$TMP_GIT_CLONE/Gemfile
PUBLIC_WWW=/var/www/myrepo
git clone $GIT_REPO $TMP_GIT_CLONE
BUNDLE_GEMFILE=$GEMFILE bundle install
BUNDLE_GEMFILE=$GEMFILE bundle exec jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW
rm -Rf $TMP_GIT_CLONE
exit
```
Finally, run the following command on any users laptop that needs to be able to
deploy using this hook:
```sh
laptops$ git remote add deploy deployer@example.com:~/myrepo.git
```
Deploying is now as easy as telling nginx or Apache to look at
`/var/www/myrepo` and running the following:
```sh
laptops$ git push deploy master
```
### Git pre-push hook
Instead of deploying using server-side hooks, you can deploy using `pre-push` client-side (executes on your desktop machine) git hook. [Check here](https://victorafanasev.info/tech/deploy-jekyll-build-to-github-pages-using-git-pre-push-hook) an example for Github Pages.
### Static Publisher
[Static Publisher](https://github.com/static-publisher/static-publisher) is another automated deployment option with a server listening for webhook posts, though it's not tied to GitHub specifically. It has a one-click deploy to Heroku, it can watch multiple projects from one server, it has an easy to user admin interface and can publish to either S3 or to a git repository (e.g. gh-pages).
### Rake
Another way to deploy your Jekyll site is to use [Rake](https://github.com/ruby/rake), [HighLine](https://github.com/JEG2/highline), and
[Net::SSH](https://github.com/net-ssh/net-ssh). A more complex example of deploying Jekyll with Rake that deals with multiple branches can be found in [Git Ready](https://github.com/gitready/gitready/blob/cdfbc4ec5321ff8d18c3ce936e9c749dbbc4f190/Rakefile).
### scp
Once youve generated the `_site` directory, you can easily scp its content using a
`tasks/deploy` shell script similar to [this deploy script][]. Youd obviously
need to change the values to reflect your sites details. There is even [a
matching TextMate command][] that will help you run this script.
[this deploy script]: https://github.com/henrik/henrik.nyh.se/blob/master/script/deploy
[a matching TextMate command]: https://gist.github.com/henrik/214959
### rsync
Once youve generated the `_site` directory, you can easily rsync its content using a `tasks/deploy` shell script similar to [this deploy script here](https://github.com/vitalyrepin/vrepinblog/blob/master/transfer.sh). Youd obviously need to change the values to reflect your sites details.
Certificate-based authorization is another way to simplify the publishing
process. It makes sense to restrict rsync access only to the directory which it is supposed to sync. This can be done using rrsync.
#### Step 1: Install rrsync to your home folder (server-side)
If it is not already installed by your host, you can do it yourself:
- [Download rrsync](https://ftp.samba.org/pub/unpacked/rsync/support/rrsync)
- Place it in the `bin` subdirectory of your home folder (`~/bin`)
- Make it executable (`chmod +x`)
#### Step 2: Set up certificate-based SSH access (server side)
This [process](https://wiki.gentoo.org/wiki/SSH#Passwordless_Authentication) is
described in several places online. What is different from the typical approach
is to put the restriction to certificate-based authorization in
`~/.ssh/authorized_keys`. Then, launch `rrsync` and supply
it with the folder it shall have read-write access to:
```sh
command="$HOME/bin/rrsync <folder>",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ssh-rsa <cert>
```
`<folder>` is the path to your site. E.g., `~/public_html/you.org/blog-html/`.
#### Step 3: Rsync (client-side)
Add the `deploy` script to the site source folder:
```sh
#!/bin/sh
rsync -crvz --rsh='ssh -p2222' --delete-after --delete-excluded <folder> <user>@<site>:
```
Command line parameters are:
- `--rsh=ssh -p2222` &mdash; The port for SSH access. It is required if
your host uses a different port than the default (e.g, HostGator)
- `<folder>` &mdash; The name of the local output folder (defaults to `_site`)
- `<user>` &mdash; The username for your hosting account
- `<site>` &mdash; Your hosting server
Using this setup, you might run the following command:
```sh
rsync -crvz --rsh='ssh -p2222' --delete-after --delete-excluded _site/ hostuser@example.org:
```
Don't forget the column `:` after server name!
#### Step 4 (Optional): Exclude the transfer script from being copied to the output folder.
This step is recommended if you use these instructions to deploy your site. If
you put the `deploy` script in the root folder of your project, Jekyll will
copy it to the output folder. This behavior can be changed in `_config.yml`.
Just add the following line:
```yaml
# Do not copy these files to the output directory
exclude: ["deploy"]
```
Alternatively, you can use an `rsync-exclude.txt` file to control which files will be transferred to your server.
#### Done!
Now it's possible to publish your website simply by running the `deploy`
script. If your SSH certificate is [passphrase-protected](https://martin.kleppmann.com/2013/05/24/improving-security-of-ssh-private-keys.html), you will be asked to enter it when the
script executes.
## Rack-Jekyll
[Rack-Jekyll](https://github.com/adaoraul/rack-jekyll/) is an easy way to deploy your site on any Rack server such as Amazon EC2, Slicehost, Heroku, and so forth. It also can run with [shotgun](https://github.com/rtomayko/shotgun/), [rackup](https://github.com/rack/rack), [mongrel](https://github.com/mongrel/mongrel), [unicorn](https://github.com/defunkt/unicorn/), and [others](https://github.com/adaoraul/rack-jekyll#readme).
Read [this post](http://andycroll.com/ruby/serving-a-jekyll-blog-using-heroku/) on how to deploy to Heroku using Rack-Jekyll.
## Jekyll-Admin for Rails
If you want to maintain Jekyll inside your existing Rails app, [Jekyll-Admin](https://github.com/zkarpinski/Jekyll-Admin) contains drop in code to make this possible. See Jekyll-Admins [README](https://github.com/zkarpinski/Jekyll-Admin/blob/master/README) for more details.
## Amazon S3
If you want to host your site in Amazon S3, you can do so by
using the [s3_website](https://github.com/laurilehmijoki/s3_website)
application. It will push your site to Amazon S3 where it can be served like
any web server,
dynamically scaling to almost unlimited traffic. This approach has the
benefit of being about the cheapest hosting option available for
low-volume blogs as you only pay for what you use.
## OpenShift
If you'd like to deploy your site to an OpenShift gear, there's [a cartridge
for that](https://github.com/openshift-quickstart/jekyll-openshift).

11
docs/_docs/deployment.md Normal file
View File

@ -0,0 +1,11 @@
---
title: Deployment
permalink: /docs/deployment/
redirect_from: "/docs/deployment-methods/index.html"
---
Sites built using Jekyll can be deployed in a large number of ways due to the static nature of the generated output. Here's some of the most common ways:
* [Manually](/docs/deployment/manual/)
* [Automated](/docs/deployment/automated/)
* [Third Party](/docs/deployment/third-party/)

View File

@ -0,0 +1,63 @@
---
title: Automated Deployment
permalink: /docs/deployment/automated/
---
There are a number of ways to easily automate the deployment of a Jekyll site.
## Continuous Integration Service
One of the easiest ways to set up an automated deployment flow is by using a
CI.
These services run a script when there's a commit on your Git repository.
You might want this script to build the site, run tests over the output then deploy it to the
service of your choice.
We have guides for the following providers:
* [Travis CI](/docs/continuous-integration/travis-ci/)
* [CircleCI](/docs/continuous-integration/circleci/)
* [Buddy](/docs/continuous-integration/buddyworks/)
## Git post-receive hook
To have a remote server handle the deploy for you every time you push changes using Git, you can create a user account which has all the public keys that are authorized to deploy in its `authorized_keys` file. With that in place, setting up the post-receive hook is done as follows:
```sh
laptop$ ssh deployer@example.com
server$ mkdir myrepo.git
server$ cd myrepo.git
server$ git --bare init
server$ cp hooks/post-receive.sample hooks/post-receive
server$ mkdir /var/www/myrepo
```
Next, add the following lines to hooks/post-receive and be sure Jekyll is
installed on the server:
```bash
GIT_REPO=$HOME/myrepo.git
TMP_GIT_CLONE=$HOME/tmp/myrepo
GEMFILE=$TMP_GIT_CLONE/Gemfile
PUBLIC_WWW=/var/www/myrepo
git clone $GIT_REPO $TMP_GIT_CLONE
BUNDLE_GEMFILE=$GEMFILE bundle install
BUNDLE_GEMFILE=$GEMFILE bundle exec jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW
rm -Rf $TMP_GIT_CLONE
exit
```
Finally, run the following command on any users laptop that needs to be able to
deploy using this hook:
```sh
laptops$ git remote add deploy deployer@example.com:~/myrepo.git
```
Deploying is now as easy as telling nginx or Apache to look at
`/var/www/myrepo` and running the following:
```sh
laptops$ git push deploy master
```

View File

@ -0,0 +1,36 @@
---
title: Manual Deployment
permalink: /docs/deployment/manual/
---
Jekyll generates your static site to the `_site` directory by default. You can
transfer the contents of this directory to almost any hosting provider to get
your site live. Here are some manual ways of achieving this:
## FTP
Most traditional web hosting provider let you upload files to their servers over FTP. To upload a Jekyll site to a web host using FTP, simply run the `jekyll build` command and copy the contents of the generated `_site` folder to the root folder of your hosting account. This is most likely to be the `httpdocs` or `public_html` folder on most hosting providers.
## scp
If you have direct access to the deployment web server, the process is essentially the same, except you might have other methods available to you (such as `scp`, or even direct filesystem access) for transferring the files. Just remember to make sure the contents of the generated `_site` folder get placed in the appropriate web root directory for your web server.
## rsync
Rsync is similar to scp except it can be faster as it will only send changed
parts of files as opposed to the entire file. You can learn more about using
rsync in the [Digital Ocean tutorial](https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps).
## Rack-Jekyll
[Rack-Jekyll](https://github.com/adaoraul/rack-jekyll/) is an easy way to deploy your site on any Rack server such as Amazon EC2, Slicehost, Heroku, and so forth. It also can run with [shotgun](https://github.com/rtomayko/shotgun/), [rackup](https://github.com/rack/rack), [mongrel](https://github.com/mongrel/mongrel), [unicorn](https://github.com/defunkt/unicorn/), and [others](https://github.com/adaoraul/rack-jekyll#readme).
## Amazon S3
If you want to host your site in Amazon S3, you can do so by
using the [s3_website](https://github.com/laurilehmijoki/s3_website)
application. It will push your site to Amazon S3 where it can be served like
any web server,
dynamically scaling to almost unlimited traffic. This approach has the
benefit of being about the cheapest hosting option available for
low-volume blogs as you only pay for what you use.

View File

@ -0,0 +1,39 @@
---
title: 3rd Party
permalink: /docs/deployment/third-party/
---
## Aerobatic
[Aerobatic](https://www.aerobatic.com) has custom domains, global CDN distribution, basic auth, CORS proxying, and a growing list of plugins all included.
Automating the deployment of a Jekyll site is simple. See their [Jekyll docs](https://www.aerobatic.com/docs/static-site-generators/#jekyll) for more details. Your built `_site` folder is deployed to their highly-available, globally distributed hosting service.
## CloudCannon
[CloudCannon](https://cloudcannon.com) has everything you need to build, host
and update Jekyll websites. Take advantage of our global CDN, automated SSL,
continuous deployment and [more](https://cloudcannon.com/features/).
## GitHub Pages
Sites on GitHub Pages are powered by Jekyll behind the scenes, so if youre looking for a zero-hassle, zero-cost solution, GitHub Pages are a great way to [host your Jekyll-powered website for free](/docs/github-pages/).
## Kickster
Use [Kickster](http://kickster.nielsenramon.com/) for easy (automated) deploys to GitHub Pages when using unsupported plugins on GitHub Pages.
Kickster provides a basic Jekyll project setup packed with web best practises and useful optimization tools increasing your overall project quality. Kickster ships with automated and worry-free deployment scripts for GitHub Pages.
Setting up Kickster is very easy, just install the gem and you are good to go. More documentation can here found [here](https://github.com/nielsenramon/kickster#kickster). If you do not want to use the gem or start a new project you can just copy paste the deployment scripts for [Travis CI](https://github.com/nielsenramon/kickster/tree/master/snippets/travis) or [Circle CI](https://github.com/nielsenramon/kickster#automated-deployment-with-circle-ci).
## Netlify
Netlify provides Global CDN, Continuous Deployment, one click HTTPS and [much more](https://www.netlify.com/features/), providing developers the most robust toolset available for modern web projects, without added complexity. Netlify supports custom plugins for Jekyll and has a free plan for open source projects.
Read this [Jekyll step-by-step guide](https://www.netlify.com/blog/2015/10/28/a-step-by-step-guide-jekyll-3.0-on-netlify/) to setup your Jekyll site on Netlify.
## Static Publisher
[Static Publisher](https://github.com/static-publisher/static-publisher) is another automated deployment option with a server listening for webhook posts, though it's not tied to GitHub specifically. It has a one-click deploy to Heroku, it can watch multiple projects from one server, it has an easy to user admin interface and can publish to either S3 or to a git repository (e.g. gh-pages).

View File

@ -1,19 +0,0 @@
---
title: Working with drafts
permalink: /docs/drafts/
---
Drafts are posts without a date in the filename. They're posts you're still working on and
don't want to publish yet. To get up and running with drafts, create a
`_drafts` folder in your site's root (as described in the [site structure](/docs/structure/) section) and create your
first draft:
```text
|-- _drafts/
| |-- a-draft-post.md
```
To preview your site with drafts, simply run `jekyll serve` or `jekyll build`
with the `--drafts` switch. Each will be assigned the value modification time
of the draft file for its date, and thus you will see currently edited drafts
as the latest posts.

View File

@ -1,31 +0,0 @@
---
title: Extras
permalink: /docs/extras/
---
There are a number of (optional) extra features that Jekyll supports that you
may want to install, depending on how you plan to use Jekyll.
## Web Highlights and Commenting
Register your site with [txtpen](https://txtpen.com). Then append
```html
<script src="https://txtpen.com/embed.js?site=<your site name>"></script>
```
to your template files in `/_layout` folder.
## Math Support
Kramdown comes with optional support for LaTeX to PNG rendering via [MathJax](https://www.mathjax.org) within math blocks. See the Kramdown documentation on [math blocks](http://kramdown.gettalong.org/syntax.html#math-blocks) and [math support](http://kramdown.gettalong.org/converter/html.html#math-support) for more details. MathJax requires you to include JavaScript or CSS to render the LaTeX, e.g.
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
```
For more information about getting started, check out [this excellent blog post](http://gastonsanchez.com/visually-enforced/opinion/2014/02/16/Mathjax-with-jekyll/).
## Alternative Markdown Processors
See the Markdown section on the [configuration page](/docs/configuration/#markdown-options) for instructions on how to use and configure alternative Markdown processors, as well as how to create [custom processors](/docs/configuration/#custom-markdown-processors).

View File

@ -1,13 +1,13 @@
--- ---
title: Front Matter title: Front Matter
permalink: /docs/frontmatter/ permalink: /docs/front-matter/
redirect_from: /docs/frontmatter/index.html
--- ---
The front matter is where Jekyll starts to get really cool. Any file that Any file that contains a [YAML](http://yaml.org/) front matter block will be
contains a [YAML](http://yaml.org/) front matter block will be processed by processed by Jekyll as a special file. The front matter must be the first thing
Jekyll as a special file. The front matter must be the first thing in the file in the file and must take the form of valid YAML set between triple-dashed
and must take the form of valid YAML set between triple-dashed lines. Here is a lines. Here is a basic example:
basic example:
```yaml ```yaml
--- ---
@ -28,14 +28,14 @@ relies on.
If you use UTF-8 encoding, make sure that no <code>BOM</code> header If you use UTF-8 encoding, make sure that no <code>BOM</code> header
characters exist in your files or very, very bad things will happen to characters exist in your files or very, very bad things will happen to
Jekyll. This is especially relevant if youre running Jekyll. This is especially relevant if youre running
<a href="../windows/">Jekyll on Windows</a>. <a href="/docs/installation/windows/">Jekyll on Windows</a>.
</p> </p>
</div> </div>
<div class="note"> <div class="note">
<h5>ProTip™: Front Matter Variables Are Optional</h5> <h5>ProTip™: Front Matter Variables Are Optional</h5>
<p> <p>
If you want to use <a href="../variables/">Liquid tags and variables</a> If you want to use <a href="/docs/variables/">Liquid tags and variables</a>
but dont need anything in your front matter, just leave it empty! The set but dont need anything in your front matter, just leave it empty! The set
of triple-dashed lines with nothing in between will still get Jekyll to of triple-dashed lines with nothing in between will still get Jekyll to
process your file. (This is useful for things like CSS and RSS feeds!) process your file. (This is useful for things like CSS and RSS feeds!)
@ -72,12 +72,12 @@ front matter of a page or post.
<li> <li>
Using <code>null</code> will produce a file without using a layout Using <code>null</code> will produce a file without using a layout
file. However this is overridden if the file is a post/document and has a file. However this is overridden if the file is a post/document and has a
layout defined in the <a href="../configuration/#front-matter-defaults"> layout defined in the <a href="/docs/configuration/front-matter-defaults/">
frontmatter defaults</a>. front matter defaults</a>.
</li> </li>
<li> <li>
Starting from version 3.5.0, using <code>none</code> in a post/document will Starting from version 3.5.0, using <code>none</code> in a post/document will
produce a file without using a layout file regardless of frontmatter defaults. produce a file without using a layout file regardless of front matter defaults.
Using <code>none</code> in a page, however, will cause Jekyll to attempt to Using <code>none</code> in a page, however, will cause Jekyll to attempt to
use a layout named "none". use a layout named "none".
</li> </li>
@ -117,27 +117,25 @@ front matter of a page or post.
<h5>ProTip™: Render Posts Marked As Unpublished</h5> <h5>ProTip™: Render Posts Marked As Unpublished</h5>
<p> <p>
To preview unpublished pages, simply run `jekyll serve` or `jekyll build` To preview unpublished pages, simply run `jekyll serve` or `jekyll build`
with the `--unpublished` switch. Jekyll also has a handy <a href="../drafts/">drafts</a> with the `--unpublished` switch. Jekyll also has a handy <a href="/docs/posts/#drafts">drafts</a>
feature tailored specifically for blog posts. feature tailored specifically for blog posts.
</p> </p>
</div> </div>
## Custom Variables ## Custom Variables
Any variables in the front matter that are not predefined are mixed into the You can also set your own front matter variables you can access in Liquid. For
data that is sent to the Liquid templating engine during the conversion. For instance, if you set a variable called `food`, you can use that in your page:
instance, if you set a title, you can use that in your layout to set the page
title:
{% raw %}
```liquid ```liquid
<!DOCTYPE HTML> ---
<html> food: Pizza
<head> ---
<title>{% raw %}{{ page.title }}{% endraw %}</title>
</head> <h1>{{ page.food }}</h1>
<body>
``` ```
{% endraw %}
## Predefined Variables for Posts ## Predefined Variables for Posts
@ -206,7 +204,7 @@ These are available out-of-the-box to be used in the front matter for a post.
<h5>ProTip™: Don't repeat yourself</h5> <h5>ProTip™: Don't repeat yourself</h5>
<p> <p>
If you don't want to repeat your frequently used front matter variables If you don't want to repeat your frequently used front matter variables
over and over, just define <a href="../configuration/#front-matter-defaults" title="Front Matter defaults">defaults</a> over and over, just define <a href="/docs/configuration/front-matter-defaults/" title="Front Matter defaults">defaults</a>
for them and only override them where necessary (or not at all). This works for them and only override them where necessary (or not at all). This works
both for predefined and custom variables. both for predefined and custom variables.
</p> </p>

View File

@ -11,7 +11,7 @@ website for free.
Your site is automatically generated by GitHub Pages when you push your source Your site is automatically generated by GitHub Pages when you push your source
files. Note that GitHub Pages works equally well for regular HTML content, files. Note that GitHub Pages works equally well for regular HTML content,
simply because Jekyll treats files without YAML front matter as static assets. simply because Jekyll treats files without front matter as static assets.
So if you only need to push generated HTML, you're good to go without any So if you only need to push generated HTML, you're good to go without any
further setup. further setup.
@ -58,7 +58,7 @@ Be sure to run `bundle update` often.
Sometimes it's nice to preview your Jekyll site before you push your `gh-pages` Sometimes it's nice to preview your Jekyll site before you push your `gh-pages`
branch to GitHub. However, the subdirectory-like URL structure GitHub uses for branch to GitHub. However, the subdirectory-like URL structure GitHub uses for
Project Pages complicates the proper resolution of URLs. In order to assure your Project Pages complicates the proper resolution of URLs. In order to assure your
site builds properly, use the handy [URL filters](../templates/#filters): site builds properly, use the handy [URL filters](/docs/liquid/filters/):
{% raw %} {% raw %}
```liquid ```liquid
@ -122,7 +122,7 @@ to see more detailed examples.
<h5>Source files must be in the root directory</h5> <h5>Source files must be in the root directory</h5>
<p> <p>
GitHub Pages <a href="https://help.github.com/articles/troubleshooting-github-pages-build-failures#source-setting">overrides</a> GitHub Pages <a href="https://help.github.com/articles/troubleshooting-github-pages-build-failures#source-setting">overrides</a>
the <a href="/docs/configuration/#global-configuration">“Site Source”</a> the <a href="/docs/configuration/>“Site Source”</a>
configuration value, so if you locate your files anywhere other than the configuration value, so if you locate your files anywhere other than the
root directory, your site may not build correctly. root directory, your site may not build correctly.
</p> </p>
@ -135,6 +135,6 @@ to see more detailed examples.
While Windows is not officially supported, it is possible While Windows is not officially supported, it is possible
to install the <code>github-pages</code> gem on Windows. to install the <code>github-pages</code> gem on Windows.
Special instructions can be found on our Special instructions can be found on our
<a href="../windows/#installation">Windows-specific docs page</a>. <a href="/docs/installation/windows/">Windows-specific docs page</a>.
</p> </p>
</div> </div>

View File

@ -400,7 +400,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- add SUPPORT file for GitHub ([#6324]({{ site.repository }}/issues/6324)) - add SUPPORT file for GitHub ([#6324]({{ site.repository }}/issues/6324))
- Rename CODE_OF_CONDUCT to show in banner ([#6325]({{ site.repository }}/issues/6325)) - Rename CODE_OF_CONDUCT to show in banner ([#6325]({{ site.repository }}/issues/6325))
- Docs : illustrate page.id for a collection&#39;s document ([#6329]({{ site.repository }}/issues/6329)) - Docs : illustrate page.id for a collection&#39;s document ([#6329]({{ site.repository }}/issues/6329))
- Docs: post&#39;s date can be overriden in YAML front matter ([#6334]({{ site.repository }}/issues/6334)) - Docs: post&#39;s date can be overriden in front matter ([#6334]({{ site.repository }}/issues/6334))
- Docs: `site.url` behavior on development and production environments ([#6270]({{ site.repository }}/issues/6270)) - Docs: `site.url` behavior on development and production environments ([#6270]({{ site.repository }}/issues/6270))
- Fix typo in site.url section of variables.md :-[ ([#6337]({{ site.repository }}/issues/6337)) - Fix typo in site.url section of variables.md :-[ ([#6337]({{ site.repository }}/issues/6337))
- Docs: updates ([#6343]({{ site.repository }}/issues/6343)) - Docs: updates ([#6343]({{ site.repository }}/issues/6343))
@ -1122,7 +1122,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Fix typo on Chocolatey name in Windows documentation ([#4686]({{ site.repository }}/issues/4686)) - Fix typo on Chocolatey name in Windows documentation ([#4686]({{ site.repository }}/issues/4686))
- Use the correct URL, Fixes [#4698]({{ site.repository }}/issues/4698) ([#4699]({{ site.repository }}/issues/4699)) - Use the correct URL, Fixes [#4698]({{ site.repository }}/issues/4698) ([#4699]({{ site.repository }}/issues/4699))
- Add jekyll-paspagon plugin ([#4700]({{ site.repository }}/issues/4700)) - Add jekyll-paspagon plugin ([#4700]({{ site.repository }}/issues/4700))
- Bold-italicize note in assets documentation about needing yaml front matter ([#4706]({{ site.repository }}/issues/4706)) - Bold-italicize note in assets documentation about needing front matter ([#4706]({{ site.repository }}/issues/4706))
- Highlight the `script/` calls in the Contributing documentation ([#4712]({{ site.repository }}/issues/4712)) - Highlight the `script/` calls in the Contributing documentation ([#4712]({{ site.repository }}/issues/4712))
- Add Hawkins to the list of third-party plugins ([#4755]({{ site.repository }}/issues/4755)) - Add Hawkins to the list of third-party plugins ([#4755]({{ site.repository }}/issues/4755))
- Fix a typo in pagination doc ([#4763]({{ site.repository }}/issues/4763)) - Fix a typo in pagination doc ([#4763]({{ site.repository }}/issues/4763))
@ -1315,7 +1315,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Drop: fix hash setter precedence ([#4312]({{ site.repository }}/issues/4312)) - Drop: fix hash setter precedence ([#4312]({{ site.repository }}/issues/4312))
- utils: `has_yaml_header?` should accept files with extraneous spaces ([#4290]({{ site.repository }}/issues/4290)) - utils: `has_yaml_header?` should accept files with extraneous spaces ([#4290]({{ site.repository }}/issues/4290))
- Escape html from site.title and page.title in site template ([#4307]({{ site.repository }}/issues/4307)) - Escape html from site.title and page.title in site template ([#4307]({{ site.repository }}/issues/4307))
- Allow custom file extensions if defined in `permalink` YAML front matter ([#4314]({{ site.repository }}/issues/4314)) - Allow custom file extensions if defined in `permalink` front matter ([#4314]({{ site.repository }}/issues/4314))
- Fix deep_merge_hashes! handling of drops and hashes ([#4359]({{ site.repository }}/issues/4359)) - Fix deep_merge_hashes! handling of drops and hashes ([#4359]({{ site.repository }}/issues/4359))
- Page should respect output extension of its permalink ([#4373]({{ site.repository }}/issues/4373)) - Page should respect output extension of its permalink ([#4373]({{ site.repository }}/issues/4373))
- Disable auto-regeneration when running server detached ([#4376]({{ site.repository }}/issues/4376)) - Disable auto-regeneration when running server detached ([#4376]({{ site.repository }}/issues/4376))
@ -1539,7 +1539,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Internal: trigger hooks by owner symbol ([#3871]({{ site.repository }}/issues/3871)) - Internal: trigger hooks by owner symbol ([#3871]({{ site.repository }}/issues/3871))
- Update MIME types from mime-db ([#3933]({{ site.repository }}/issues/3933)) - Update MIME types from mime-db ([#3933]({{ site.repository }}/issues/3933))
- Add header to site template `_config.yml` for clarity & direction ([#3997]({{ site.repository }}/issues/3997)) - Add header to site template `_config.yml` for clarity & direction ([#3997]({{ site.repository }}/issues/3997))
- Site template: add timezone offset to post date frontmatter ([#4001]({{ site.repository }}/issues/4001)) - Site template: add timezone offset to post date front matter ([#4001]({{ site.repository }}/issues/4001))
- Make a constant for the regex to find hidden files ([#4032]({{ site.repository }}/issues/4032)) - Make a constant for the regex to find hidden files ([#4032]({{ site.repository }}/issues/4032))
- Site template: refactor github & twitter icons into includes ([#4049]({{ site.repository }}/issues/4049)) - Site template: refactor github & twitter icons into includes ([#4049]({{ site.repository }}/issues/4049))
- Site template: add background to Kramdown Rouge-ified backtick code blocks ([#4053]({{ site.repository }}/issues/4053)) - Site template: add background to Kramdown Rouge-ified backtick code blocks ([#4053]({{ site.repository }}/issues/4053))
@ -1557,7 +1557,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Fix nav items alignment when on multiple rows ([#3264]({{ site.repository }}/issues/3264)) - Fix nav items alignment when on multiple rows ([#3264]({{ site.repository }}/issues/3264))
- Highlight: Only Strip Newlines/Carriage Returns, not Spaces ([#3278]({{ site.repository }}/issues/3278)) - Highlight: Only Strip Newlines/Carriage Returns, not Spaces ([#3278]({{ site.repository }}/issues/3278))
- Find variables in front matter defaults by searching with relative file path. ([#2774]({{ site.repository }}/issues/2774)) - Find variables in front matter defaults by searching with relative file path. ([#2774]({{ site.repository }}/issues/2774))
- Allow variables (e.g `:categories`) in YAML front matter permalinks ([#3320]({{ site.repository }}/issues/3320)) - Allow variables (e.g `:categories`) in front matter permalinks ([#3320]({{ site.repository }}/issues/3320))
- Handle nil URL placeholders in permalinks ([#3325]({{ site.repository }}/issues/3325)) - Handle nil URL placeholders in permalinks ([#3325]({{ site.repository }}/issues/3325))
- Template: Fix nav items alignment when in "burger" mode ([#3329]({{ site.repository }}/issues/3329)) - Template: Fix nav items alignment when in "burger" mode ([#3329]({{ site.repository }}/issues/3329))
- Template: Remove `!important` from nav SCSS introduced in [#3329]({{ site.repository }}/issues/3329) ([#3375]({{ site.repository }}/issues/3375)) - Template: Remove `!important` from nav SCSS introduced in [#3329]({{ site.repository }}/issues/3329) ([#3375]({{ site.repository }}/issues/3375))
@ -1574,7 +1574,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Add WOFF2 font MIME type to Jekyll server MIME types ([#3647]({{ site.repository }}/issues/3647)) - Add WOFF2 font MIME type to Jekyll server MIME types ([#3647]({{ site.repository }}/issues/3647))
- Be smarter about extracting the extname in `StaticFile` ([#3632]({{ site.repository }}/issues/3632)) - Be smarter about extracting the extname in `StaticFile` ([#3632]({{ site.repository }}/issues/3632))
- Process metadata for all dependencies ([#3608]({{ site.repository }}/issues/3608)) - Process metadata for all dependencies ([#3608]({{ site.repository }}/issues/3608))
- Show error message if the YAML front matter on a page/post is invalid. ([#3643]({{ site.repository }}/issues/3643)) - Show error message if the front matter on a page/post is invalid. ([#3643]({{ site.repository }}/issues/3643))
- Upgrade redcarpet to 3.2 (Security fix: OSVDB-120415) ([#3652]({{ site.repository }}/issues/3652)) - Upgrade redcarpet to 3.2 (Security fix: OSVDB-120415) ([#3652]({{ site.repository }}/issues/3652))
- Create #mock_expects that goes directly to RSpec Mocks. ([#3658]({{ site.repository }}/issues/3658)) - Create #mock_expects that goes directly to RSpec Mocks. ([#3658]({{ site.repository }}/issues/3658))
- Open `.jekyll-metadata` in binary mode to read binary Marshal data ([#3713]({{ site.repository }}/issues/3713)) - Open `.jekyll-metadata` in binary mode to read binary Marshal data ([#3713]({{ site.repository }}/issues/3713))
@ -1654,7 +1654,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Add a Resources link to tutorial on building dynamic navbars ([#3185]({{ site.repository }}/issues/3185)) - Add a Resources link to tutorial on building dynamic navbars ([#3185]({{ site.repository }}/issues/3185))
- Semantic structure improvements to the post and page layouts ([#3251]({{ site.repository }}/issues/3251)) - Semantic structure improvements to the post and page layouts ([#3251]({{ site.repository }}/issues/3251))
- Add new AsciiDoc plugin to list of third-party plugins. ([#3277]({{ site.repository }}/issues/3277)) - Add new AsciiDoc plugin to list of third-party plugins. ([#3277]({{ site.repository }}/issues/3277))
- Specify that all transformable collection documents must contain YAML front matter ([#3271]({{ site.repository }}/issues/3271)) - Specify that all transformable collection documents must contain front matter ([#3271]({{ site.repository }}/issues/3271))
- Assorted accessibility fixes ([#3256]({{ site.repository }}/issues/3256)) - Assorted accessibility fixes ([#3256]({{ site.repository }}/issues/3256))
- Update configuration docs to mention `keep_files` for `destination` ([#3288]({{ site.repository }}/issues/3288), [#3296]({{ site.repository }}/issues/3296)) - Update configuration docs to mention `keep_files` for `destination` ([#3288]({{ site.repository }}/issues/3288), [#3296]({{ site.repository }}/issues/3296))
- Break when we successfully generate nav link to save CPU cycles. ([#3291]({{ site.repository }}/issues/3291)) - Break when we successfully generate nav link to save CPU cycles. ([#3291]({{ site.repository }}/issues/3291))
@ -1682,7 +1682,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Add a link on all the docs pages to "Improve this page". ([#3510]({{ site.repository }}/issues/3510)) - Add a link on all the docs pages to "Improve this page". ([#3510]({{ site.repository }}/issues/3510))
- Add jekyll-auto-image generator to the list of third-party plugins ([#3489]({{ site.repository }}/issues/3489)) - Add jekyll-auto-image generator to the list of third-party plugins ([#3489]({{ site.repository }}/issues/3489))
- Replace link to the proposed `picture` element spec ([#3530]({{ site.repository }}/issues/3530)) - Replace link to the proposed `picture` element spec ([#3530]({{ site.repository }}/issues/3530))
- Add frontmatter date formatting information ([#3469]({{ site.repository }}/issues/3469)) - Add front matter date formatting information ([#3469]({{ site.repository }}/issues/3469))
- Improve consistency and clarity of plugins options note ([#3546]({{ site.repository }}/issues/3546)) - Improve consistency and clarity of plugins options note ([#3546]({{ site.repository }}/issues/3546))
- Add permalink warning to pagination docs ([#3551]({{ site.repository }}/issues/3551)) - Add permalink warning to pagination docs ([#3551]({{ site.repository }}/issues/3551))
- Fix grammar in Collections docs API stability warning ([#3560]({{ site.repository }}/issues/3560)) - Fix grammar in Collections docs API stability warning ([#3560]({{ site.repository }}/issues/3560))
@ -2254,7 +2254,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Clean up the `<head>` in the site template ([#2186]({{ site.repository }}/issues/2186)) - Clean up the `<head>` in the site template ([#2186]({{ site.repository }}/issues/2186))
- Permit YAML blocks to end with three dots to better conform with the YAML spec ([#2110]({{ site.repository }}/issues/2110)) - Permit YAML blocks to end with three dots to better conform with the YAML spec ([#2110]({{ site.repository }}/issues/2110))
- Use `File.exist?` instead of deprecated `File.exists?` ([#2214]({{ site.repository }}/issues/2214)) - Use `File.exist?` instead of deprecated `File.exists?` ([#2214]({{ site.repository }}/issues/2214))
- Require newline after start of YAML Front Matter header ([#2211]({{ site.repository }}/issues/2211)) - Require newline after start of front matter header ([#2211]({{ site.repository }}/issues/2211))
- Add the ability for pages to be marked as `published: false` ([#1492]({{ site.repository }}/issues/1492)) - Add the ability for pages to be marked as `published: false` ([#1492]({{ site.repository }}/issues/1492))
- Add `Jekyll::LiquidExtensions` with `.lookup_variable` method for easy looking up of variable values in a Liquid context. ([#2253]({{ site.repository }}/issues/2253)) - Add `Jekyll::LiquidExtensions` with `.lookup_variable` method for easy looking up of variable values in a Liquid context. ([#2253]({{ site.repository }}/issues/2253))
- Remove literal lang name from class ([#2292]({{ site.repository }}/issues/2292)) - Remove literal lang name from class ([#2292]({{ site.repository }}/issues/2292))
@ -3022,7 +3022,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Bullet-proof `limit_posts` option ([#1004]({{ site.repository }}/issues/1004)) - Bullet-proof `limit_posts` option ([#1004]({{ site.repository }}/issues/1004))
- Read in YAML as UTF-8 to accept non-ASCII chars ([#836]({{ site.repository }}/issues/836)) - Read in YAML as UTF-8 to accept non-ASCII chars ([#836]({{ site.repository }}/issues/836))
- Fix the CLI option `--plugins` to actually accept dirs and files ([#993]({{ site.repository }}/issues/993)) - Fix the CLI option `--plugins` to actually accept dirs and files ([#993]({{ site.repository }}/issues/993))
- Allow 'excerpt' in YAML front matter to override the extracted excerpt ([#946]({{ site.repository }}/issues/946)) - Allow 'excerpt' in front matter to override the extracted excerpt ([#946]({{ site.repository }}/issues/946))
- Fix cascade problem with site.baseurl, site.port and site.host. ([#935]({{ site.repository }}/issues/935)) - Fix cascade problem with site.baseurl, site.port and site.host. ([#935]({{ site.repository }}/issues/935))
- Filter out directories with valid post names ([#875]({{ site.repository }}/issues/875)) - Filter out directories with valid post names ([#875]({{ site.repository }}/issues/875))
- Fix symlinked static files not being correctly built in unsafe mode ([#909]({{ site.repository }}/issues/909)) - Fix symlinked static files not being correctly built in unsafe mode ([#909]({{ site.repository }}/issues/909))
@ -3034,7 +3034,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Patch for multibyte URI problem with `jekyll serve` ([#723]({{ site.repository }}/issues/723)) - Patch for multibyte URI problem with `jekyll serve` ([#723]({{ site.repository }}/issues/723))
- Order plugin execution by priority ([#864]({{ site.repository }}/issues/864)) - Order plugin execution by priority ([#864]({{ site.repository }}/issues/864))
- Fixed Page#dir and Page#url for edge cases ([#536]({{ site.repository }}/issues/536)) - Fixed Page#dir and Page#url for edge cases ([#536]({{ site.repository }}/issues/536))
- Fix broken `post_url` with posts with a time in their YAML front matter ([#831]({{ site.repository }}/issues/831)) - Fix broken `post_url` with posts with a time in their front matter ([#831]({{ site.repository }}/issues/831))
- Look for plugins under the source directory ([#654]({{ site.repository }}/issues/654)) - Look for plugins under the source directory ([#654]({{ site.repository }}/issues/654))
- Tumblr Migrator: finds `_posts` dir correctly, fixes truncation of long post names ([#775]({{ site.repository }}/issues/775)) - Tumblr Migrator: finds `_posts` dir correctly, fixes truncation of long post names ([#775]({{ site.repository }}/issues/775))
- Force Categories to be Strings ([#767]({{ site.repository }}/issues/767)) - Force Categories to be Strings ([#767]({{ site.repository }}/issues/767))
@ -3265,7 +3265,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Bug Fixes - Bug Fixes
- Require redcloth >= 4.2.1 in tests ([#92]({{ site.repository }}/issues/92)) - Require redcloth >= 4.2.1 in tests ([#92]({{ site.repository }}/issues/92))
- Don't break on triple dashes in yaml front matter ([#93]({{ site.repository }}/issues/93)) - Don't break on triple dashes in front matter ([#93]({{ site.repository }}/issues/93))
### Minor Enhancements ### Minor Enhancements
{: #minor-enhancements-v0-5-6} {: #minor-enhancements-v0-5-6}
@ -3306,7 +3306,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Added --paginate option to the executable along with a paginator object for the payload (@calavera) - Added --paginate option to the executable along with a paginator object for the payload (@calavera)
- Upgraded RedCloth to 4.2.1, which makes `<notextile>` tags work once again. - Upgraded RedCloth to 4.2.1, which makes `<notextile>` tags work once again.
- Configuration options set in config.yml are now available through the site payload (@vilcans) - Configuration options set in config.yml are now available through the site payload (@vilcans)
- Posts can now have an empty YAML front matter or none at all (@ bahuvrihi) - Posts can now have an empty front matter or none at all (@ bahuvrihi)
- Bug Fixes - Bug Fixes
- Fixing Ruby 1.9 issue that requires `#to_s` on the err object (@Chrononaut) - Fixing Ruby 1.9 issue that requires `#to_s` on the err object (@Chrononaut)
- Fixes for pagination and ordering posts on the same day (@ujh) - Fixes for pagination and ordering posts on the same day (@ujh)
@ -3314,7 +3314,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Index.html file should always have index.html permalink (@eugenebolshakov) - Index.html file should always have index.html permalink (@eugenebolshakov)
- Added trailing slash to pretty permalink style so Apache is happy (@eugenebolshakov) - Added trailing slash to pretty permalink style so Apache is happy (@eugenebolshakov)
- Bad markdown processor in config fails sooner and with better message (@ gcnovus) - Bad markdown processor in config fails sooner and with better message (@ gcnovus)
- Allow CRLFs in yaml front matter (@juretta) - Allow CRLFs in front matter (@juretta)
- Added Date#xmlschema for Ruby versions < 1.9 - Added Date#xmlschema for Ruby versions < 1.9
@ -3409,7 +3409,7 @@ note: This file is autogenerated. Edit /History.markdown instead.
- Added post categories based on directories containing `_posts` (@mreid) - Added post categories based on directories containing `_posts` (@mreid)
- Added post topics based on directories underneath `_posts` - Added post topics based on directories underneath `_posts`
- Added new date filter that shows the full month name (@mreid) - Added new date filter that shows the full month name (@mreid)
- Merge Post's YAML front matter into its to_liquid payload (@remi) - Merge Post's front matter into its to_liquid payload (@remi)
- Restrict includes to regular files underneath `_includes` - Restrict includes to regular files underneath `_includes`
- Bug Fixes - Bug Fixes
- Change YAML delimiter matcher so as to not chew up 2nd level markdown headers (@mreid) - Change YAML delimiter matcher so as to not chew up 2nd level markdown headers (@mreid)

View File

@ -152,41 +152,3 @@ Then pass this captured variable into the parameter for the include. Omit the qu
{% include note.html content=download_note %} {% include note.html content=download_note %}
``` ```
{% endraw %} {% 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:
{% raw %}
```liquid
{% 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 %}
```liquid
{% 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 file, and the Liquid logic processes. The result will be `Jane Doe`.

View File

@ -1,41 +1,35 @@
--- ---
title: Welcome title: Quickstart
permalink: /docs/home/ permalink: /docs/
redirect_from: /docs/index.html redirect_from: /docs/home/index.html
--- ---
Jekyll is a simple, extendable, static site generator. You give it text written
in your favorite markup language and it churns through layouts to create a
static website. Throughout that process you can tweak how you want the site URLs
to look, what data gets displayed in the layout, and more.
This site aims to be a comprehensive guide to Jekyll. Well cover topics such as getting your site up and running, creating and managing content, customizing your build, and deploying. ## Instructions
## What is Jekyll, exactly? 1. Install a full [Ruby development environment](/docs/installation/)
2. Install Jekyll and [bundler](/docs/ruby-101/#bundler) [gems](/docs/ruby-101/#gems)
```
gem install jekyll bundler
```
3. Create a new Jekyll site at `./myblog`
```
jekyll new myblog
```
4. Change into your new directory
```
cd myblog
```
5. Build the site and make it available on a local server
```
bundle exec jekyll serve
```
6. Now browse to [http://localhost:4000](http://localhost:4000){:target="_blank"}
Jekyll is a simple, blog-aware, static site generator. If you encounter any unexpected errors during the above, please refer to the
[troubleshooting](/docs/troubleshooting/#configuration-problems) page or the
You create your content as text files ([Markdown](https://daringfireball.net/projects/markdown/)), and organize them into folders. Then, you build the shell of your site using [Liquid](https://shopify.github.io/liquid/)-enhanced HTML templates. Jekyll automatically stitches the content and templates together, generating a website made entirely of static assets, suitable for uploading to any server. already-mentioned [requirements](/docs/installation/#requirements) page, as
you might be missing development headers or other prerequisites.
Jekyll happens to be the engine behind [GitHub Pages](https://pages.github.com), so you can host your projects Jekyll page/blog/website on GitHubs servers **for free**.
## Navigating the Guide
Throughout this guide, you'll see these special sections that help you get the most out of Jekyll:
<div class="note">
<h5>ProTips™</h5>
<p>Tips and tricks that'll make you a Jekyll wizard!</p>
</div>
<div class="note info">
<h5>Notes</h5>
<p>Extra tidbits that are sometimes necessary to understand Jekyll.</p>
</div>
<div class="note warning">
<h5>Warnings</h5>
<p>Common pitfalls to avoid.</p>
</div>
<div class="note unreleased">
<h5>Unreleased</h5>
<p>Features planned for future versions of Jekyll, but not available yet.</p>
</div>
If you find anything we havent covered, or would like to share a tip that others might find handy, please [file an issue]({{ site.repository }}/issues/new) and well see about adding it to the guide.

View File

@ -4,211 +4,19 @@ description: Official guide to install Jekyll on macOS, GNU/Linux or Windows.
permalink: /docs/installation/ permalink: /docs/installation/
--- ---
Jekyll is a [Ruby Gem](http://guides.rubygems.org/rubygems-basics/), and can be Jekyll is a [Ruby Gem](/docs/ruby-101/#gems) that can be installed on most systems.
installed on most systems.
- [Requirements](#requirements)
- [Install Jekyll on macOS](#macOS)
- [Install Jekyll on Ubuntu Linux](#ubuntu)
- [Install Jekyll on other Linux distros](#otherlinux)
- [Install Jekyll on Windows](../windows/)
- [Upgrade Jekyll](#upgrade-jekyll)
## Requirements ## Requirements
Before you start, make sure your system has the following: * [Ruby](https://www.ruby-lang.org/en/downloads/) version 2.2.5 or above, including all development headers (ruby version can be checked by running `ruby -v`)
* [RubyGems](https://rubygems.org/pages/download) (which you can check by running `gem -v`)
* [GCC](https://gcc.gnu.org/install/) and [Make](https://www.gnu.org/software/make/) (in case your system doesn't have them installed, which you can check by running `gcc -v`,`g++ -v` and `make -v` in your system's command line interface)
- [Ruby](https://www.ruby-lang.org/en/downloads/) version 2.2.5 or above, including all development headers (ruby installation can be checked by running `ruby -v`) ## Guides
- [RubyGems](https://rubygems.org/pages/download) (which you can check by running `gem -v`)
- [GCC](https://gcc.gnu.org/install/) and [Make](https://www.gnu.org/software/make/) (in case your system doesn't have them installed, which you can check by running `gcc -v`,`g++ -v` and `make -v` in your system's command line interface)
## Install on macOS {#macOS} For detailed install instructions have a look at the guide for your operating system.
We only cover macOS High Sierra 10.13 here, which comes with Ruby 2.3.3, older systems will need to [install a more recent Ruby version via Homebrew](#homebrew). * [macOS](/docs/installation/macos/)
* [Ubuntu Linux](/docs/installation/ubuntu/)
First, you need to install the command-line tools to be able to compile native extensions, open a terminal and run: * [Other Linux distros](/docs/installation/other-linux)
* [Windows](/docs/installation/windows/)
```sh
xcode-select --install
```
### Set up Ruby included with the OS
Check your Ruby version meet our requirements:
```sh
ruby -v
2.3.3
```
Great, let's install Jekyll. We also need [Bundler](https://bundler.io/) to help us handle [plugins](../plugins) and [themes](../themes):
```sh
gem install bundler jekyll
```
That's it, you're ready to go, either by installing our [default minimal blog theme](https://github.com/jekyll/minima) with `jekyll new jekyll-website` or by starting from scratch:
```sh
mkdir jekyll-website
cd jekyll-website
# Create a Gemfile
bundle init
# Add Jekyll
bundle add jekyll
# Install gems
bundle install
```
Great, from there you can now either use a [theme](../themes/) or [create your own layouts](../templates/).
### Install a newer Ruby version via Homebrew {#homebrew}
If you wish to install the latest version of Ruby and get faster builds, we recommend to do it via [Homebrew](https://brew.sh) a handy package manager for macOS.
```sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ruby
ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
```
Yay! Now you have a shiny Ruby on your system!
### Install multiple Ruby versions with rbenv {#rbenv}
Developers often use [rbenv](https://github.com/rbenv/rbenv) to manage multiple Ruby versions. This can be useful if you want to run the same Ruby version used by [GitHub Pages](https://pages.github.com/versions/) or [Netlify](https://www.netlify.com/docs/#ruby) for instance.
```sh
# Install rbenv and ruby-build
brew install rbenv
# Setup rbenv integration to your shell
rbenv init
# Check your install
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
```
Restart your terminal for changes to take effect.
Now we can install the Ruby version of our choice, let's go with Ruby 2.5.1 here:
```sh
rbenv install 2.5.1
rbenv global 2.5.1
ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
```
That's it! Head over [rbenv command references](https://github.com/rbenv/rbenv#command-reference) to learn how to use different versions of Ruby in your projects.
<div class="note info" markdown="1">
##### Problems installing Jekyll?
Check out the [troubleshooting](../troubleshooting/) page or
[ask for help on our forum](https://talk.jekyllrb.com).
</div>
## Install on Ubuntu Linux {#ubuntu}
Before we install Jekyll, we need to make sure we have all the required
dependencies.
```sh
sudo apt-get install ruby ruby-dev build-essential
```
It is best to avoid installing Ruby Gems as the root user. Therefore, we need to
set up a gem installation directory for your user account. The following
commands will add environment variables to your `~/.bashrc` file to configure
the gem installation path. Run them now:
```sh
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME=$HOME/gems' >> ~/.bashrc
echo 'export PATH=$HOME/gems/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
```
Finally, install Jekyll:
```sh
gem install jekyll bundler
```
That's it! You're ready to start using Jekyll.
## Install on other Linux distros {#otherlinux}
Installation on other Linux distributions works similarly as on Ubuntu.
On Fedora, the dependencies can be installed as follows, and the rest
works the same as on Ubuntu.
```sh
sudo dnf install ruby ruby-devel @development-tools
```
## Upgrade Jekyll
Before you start developing with Jekyll, you may want to check that you're up to date with the latest version. To find the currently installed version of Jekyll, run one of these commands:
```sh
jekyll --version
gem list jekyll
```
You can use RubyGems to find [the current version of Jekyll](https://rubygems.org/gems/jekyll). Another way to check if you have the latest version is to run the command `gem outdated`. This will provide a list of all the gems on your system that need to be updated. If you aren't running the latest version, run this command:
```sh
bundle update jekyll
```
Alternatively, if you don't have Bundler installed run:
```sh
gem update jekyll
```
To upgrade to latest Rubygems, run:
```
gem update --system
```
Refer to our [upgrading section](../upgrading/) to upgrade from Jekyll 2.x or 1.x.
## Pre-releases
In order to install a pre-release, make sure you have all the requirements
installed properly and run:
```sh
gem install jekyll --pre
```
This will install the latest pre-release. If you want a particular pre-release,
use the `-v` switch to indicate the version you'd like to install:
```sh
gem install jekyll -v '2.0.0.alpha.1'
```
If you'd like to install a development version of Jekyll, the process is a bit
more involved. This gives you the advantage of having the latest and greatest,
but may be unstable.
```sh
git clone git://github.com/jekyll/jekyll.git
cd jekyll
script/bootstrap
bundle exec rake build
ls pkg/*.gem | head -n 1 | xargs gem install -l
```
Now that youve got everything up-to-date and installed, lets get to work!

View File

@ -0,0 +1,69 @@
---
title: Jekyll on macOS
permalink: /docs/installation/macos/
---
First, you need to install the command-line tools to be able to compile native extensions, open a terminal and run:
```sh
xcode-select --install
```
## Set up Ruby included with the OS
Check your Ruby version meets our requirements. Jekyll requires Ruby 2.2.5 or above. If you're running an older version you'll need to [install a more recent Ruby version via Homebrew](#homebrew).
```sh
ruby -v
2.3.3
```
Now install Jekyll and [Bundler](/docs/ruby-101/#bundler).
```sh
gem install bundler jekyll
```
### Install a newer Ruby version via Homebrew {#homebrew}
If you wish to install the latest version of Ruby and get faster builds, we recommend doing it via [Homebrew](https://brew.sh) a handy package manager for macOS.
```sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ruby
ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
```
### Install multiple Ruby versions with rbenv {#rbenv}
Developers often use [rbenv](https://github.com/rbenv/rbenv) to manage multiple
Ruby versions. This can be useful if you want to run the same Ruby version used
by your colleagues/collaborators.
```sh
# Install rbenv and ruby-build
brew install rbenv
# Setup rbenv integration to your shell
rbenv init
# Check your install
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
```
Restart your terminal for changes to take effect.
Now we can install the Ruby version of our choice, let's go with Ruby 2.5.1 here:
```sh
rbenv install 2.5.1
rbenv global 2.5.1
ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
```
That's it! Head over [rbenv command references](https://github.com/rbenv/rbenv#command-reference) to learn how to use different versions of Ruby in your projects.
### Problems?
Check out the [troubleshooting](/docs/troubleshooting/) page or [ask for help on our forum](https://talk.jekyllrb.com).

View File

@ -0,0 +1,11 @@
---
title: Jekyll on Ubuntu
permalink: /docs/installation/other-linux/
---
Installation on other Linux distributions works similarly as on Ubuntu.
On Fedora, the dependencies can be installed as follows, and the rest
works the same as on Ubuntu.
```sh
sudo dnf install ruby ruby-devel @development-tools
```

View File

@ -0,0 +1,30 @@
---
title: Jekyll on Ubuntu
permalink: /docs/installation/ubuntu/
---
Before we install Jekyll, we need to make sure we have all the required
dependencies.
```sh
sudo apt-get install ruby ruby-dev build-essential
```
It is best to avoid installing Ruby Gems as the root user. Therefore, we need to
set up a gem installation directory for your user account. The following
commands will add environment variables to your `~/.bashrc` file to configure
the gem installation path. Run them now:
```sh
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME=$HOME/gems' >> ~/.bashrc
echo 'export PATH=$HOME/gems/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
```
Finally, install Jekyll:
```sh
gem install jekyll bundler
```
That's it! You're ready to start using Jekyll.

View File

@ -1,31 +1,27 @@
--- ---
title: Jekyll on Windows title: Jekyll on Windows
permalink: /docs/windows/ permalink: /docs/installation/windows/
redirect_from: "/docs/windows.html"
--- ---
While Windows is not an officially-supported platform, it can be used to run Jekyll with the proper tweaks. This page aims to collect some of the general knowledge and lessons that have been unearthed by Windows users. While Windows is not an officially-supported platform, it can be used to run Jekyll with the proper tweaks. This page aims to collect some of the general knowledge and lessons that have been unearthed by Windows users.
## Installing Jekyll ## Installing Jekyll
The easiest way to run Jekyll is by using the [RubyInstaller][] for Windows. The easiest way to run Jekyll is by using the [RubyInstaller](https://rubyinstaller.org/) for Windows.
### Installation via RubyInstaller ### Installation via RubyInstaller
[RubyInstaller][] is a self-contained Windows-based installer that includes the Ruby language, an execution environment, important documentation, and more. [RubyInstaller](https://rubyinstaller.org/) is a self-contained Windows-based installer that includes the Ruby language, an execution environment, important documentation, and more.
We only cover RubyInstaller-2.4 and newer here, older versions need to [install the Devkit][Devkit-install] manually. We only cover RubyInstaller-2.4 and newer here, older versions need to [install the Devkit](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit) manually.
1. Download and Install a **Ruby+Devkit** version from [RubyInstaller Downloads][RubyInstaller-downloads]. 1. Download and Install a **Ruby+Devkit** version from [RubyInstaller Downloads](https://rubyinstaller.org/downloads/).
Use default options for installation. Use default options for installation.
2. Open a new command prompt window from the start menu, so that changes to the `PATH` environment variable becomes effective. 2. Open a new command prompt window from the start menu, so that changes to the `PATH` environment variable becomes effective.
Install Jekyll and Bundler via: `gem install jekyll bundler` Install Jekyll and Bundler via: `gem install jekyll bundler`
3. Check if Jekyll installed properly: `jekyll -v` 3. Check if Jekyll installed properly: `jekyll -v`
That's it, you're ready to install our [default minimal blog theme](https://github.com/jekyll/minima) with `jekyll new jekyll-website`. That's it, you're ready to use Jekyll!
[RubyInstaller]: https://rubyinstaller.org/
[RubyInstaller-downloads]: https://rubyinstaller.org/downloads/
[Devkit-install]: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
### Encoding ### Encoding
@ -38,27 +34,24 @@ Additionally, you might need to change the code page of the console window to UT
chcp 65001 chcp 65001
``` ```
### Time-Zone Management ### Time-Zone Management
Since Windows doesn't have a native source of zoneinfo data, the Ruby Interpreter would not understand IANA Timezones and hence using them had the `TZ` environment variable default to UTC/GMT 00:00. Since Windows doesn't have a native source of zoneinfo data, the Ruby Interpreter would not understand IANA Timezones and hence using them had the `TZ` environment variable default to UTC/GMT 00:00.
Though Windows users could alternatively define their blog's timezone by setting the key to use POSIX format of defining timezones, it wasn't as user-friendly when it came to having the clock altered to changing DST-rules. Though Windows users could alternatively define their blog's timezone by setting the key to use POSIX format of defining timezones, it wasn't as user-friendly when it came to having the clock altered to changing DST-rules.
Jekyll now uses a rubygem to internally configure Timezone based on established [IANA Timezone Database][IANA-database]. Jekyll now uses a rubygem to internally configure Timezone based on established [IANA Timezone Database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
While 'new' blogs created with Jekyll v3.4 and greater, will have the following added to their 'Gemfile' by default, existing sites *will* have to update their 'Gemfile' (and installed) to enable development on Windows: While 'new' blogs created with Jekyll v3.4 and greater, will have the following added to their `Gemfile` by default, existing sites *will* have to update their `Gemfile` (and installed) to enable development on Windows:
```ruby ```ruby
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem # 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]
``` ```
[IANA-database]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
### Auto Regeneration ### Auto Regeneration
Jekyll uses the `listen` gem to watch for changes when the `--watch` switch is specified during a build or serve. While `listen` has built-in support for UNIX systems, it may require an extra gem for compatibility with Windows. Jekyll uses the `listen` gem to watch for changes when the `--watch` switch is specified during a build or serve. While `listen` has built-in support for UNIX systems, it may require an extra gem for compatibility with Windows.
Add the following to the Gemfile for your site if you have issues with auto-regeneration on Windows alone: Add the following to the `Gemfile` for your site if you have issues with auto-regeneration on Windows alone:
```ruby ```ruby
gem 'wdm', '~> 0.1.1' if Gem.win_platform? gem 'wdm', '~> 0.1.1' if Gem.win_platform?
@ -69,10 +62,10 @@ You have to use a [Ruby+Devkit](https://rubyinstaller.org/downloads/) version of
## Installation via Bash on Windows 10 ## Installation via Bash on Windows 10
If you are using Windows 10 version 1607 or later, another option to run Jekyll is by [installing][WSL-Guide] the Windows Subsystem for Linux. If you are using Windows 10 version 1607 or later, another option to run Jekyll is by [installing](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide) the Windows Subsystem for Linux.
*Note:* You must have [Windows Subsystem for Linux][BASH-WSL] enabled. *Note:* You must have [Windows Subsystem for Linux](https://msdn.microsoft.com/en-us/commandline/wsl/about) enabled.
First let's make sure all our packages / repositories are up to date. Open a new Command Prompt instance, and type the following: First let's make sure all our packages / repositories are up to date. Open a new Command Prompt instance, and type the following:
@ -118,12 +111,6 @@ bundle config path vendor/bundle
**And that's it!** **And that's it!**
To start a new project named `my_blog`, just run:
```sh
jekyll new my_blog
```
You can make sure time management is working properly by inspecting your `_posts` folder. You should see a markdown file with the current date in the filename. You can make sure time management is working properly by inspecting your `_posts` folder. You should see a markdown file with the current date in the filename.
<div class="note info"> <div class="note info">
@ -132,7 +119,3 @@ You can make sure time management is working properly by inspecting your `_posts
</div> </div>
**Note:** Bash on Ubuntu on Windows is still under development, so you may run into issues. **Note:** Bash on Ubuntu on Windows is still under development, so you may run into issues.
[WSL-Guide]: https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
[BASH-WSL]: https://msdn.microsoft.com/en-us/commandline/wsl/about

131
docs/_docs/layouts.md Normal file
View File

@ -0,0 +1,131 @@
---
title: Layouts
description: placeholder
permalink: /docs/layouts/
---
Layouts are templates that wrap around your content. They allow you to have the
source code for your template in one place so you don't have to repeat things
like your navigation and footer on every page.
Layouts live in the `_layouts` directory. The convention is to have a base
template called `default.html` and have other layouts [inherit](#inheritance)
from this as needed.
## Usage
The first step is to put the template source code in `default.html`. `content`
is a special variable, the value is the rendered content of the post or page
being wrapped.
{% raw %}
```
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{ page.title }}</title>
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/blog/">Blog</a>
</nav>
<h1>{{ page.title }}</h1>
<section>
{{ content }}
</section>
<footer>
&copy; to me
</footer>
</body>
</html>
```
{% endraw %}
You have full access to the front matter of the origin. In the
example above, `page.title` comes from the page front matter.
Next you need to specify what layout you're using in your page's front matter.
You can also use
[front matter defaults](/docs/configuration/front-matter-defaults/) to save you
from having to set this on every page.
```
---
title: My First Page
layout: default
---
This is the content of my page
```
The rendered output of this page is:
```
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My First Page</title>
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/blog/">Blog</a>
</nav>
<h1>My First Page</h1>
<section>
This is the content of my page
</section>
<footer>
&copy; to me
</footer>
</body>
</html>
```
## Inheritance
Layout inheritance is useful when you want to add something to an existing
layout for a portion of documents on your site. A common example of this is
blog posts, you might want a post to display the date and author but otherwise
be identical to your base layout.
To achieve this you need to create another layout which specifies your original
layout in front matter. For example this layout will live at
`_layouts/post.html`:
{% raw %}
```
---
layout: default
---
<p>{{ page.date }} - Written by {{ page.author }}</p>
{{ content }}
```
{% endraw %}
Now posts can use this layout while the rest of the pages use the default.
## Variables
You can set front matter in layouts, the only difference is when you're
using in Liquid, you need to use the `layout` variable instead of `page`. For
example:
{% raw %}
```
---
city: San Francisco
---
<p>{{ layout.city }}</p>
{{ content }}
```
{% endraw %}

19
docs/_docs/liquid.md Normal file
View File

@ -0,0 +1,19 @@
---
title: Liquid
permalink: /docs/liquid/
redirect_from: "/docs/templates/"
---
Jekyll uses the [Liquid](https://shopify.github.io/liquid/) templating language
to process templates.
Generally in Liquid you output content using two curly braces e.g.
{% raw %}`{{ variable }}`{% endraw %} and perform logic statements by
surrounding them in a curly brace percentage sign e.g.
{% raw %}`{% if statement %}`{% endraw %}. To learn more about Liquid, check
out the [official Liquid Documentation](https://shopify.github.io/liquid/).
Jekyll provides a number of useful Liquid additions to help you build your site:
* [Filters](/docs/liquid/filters/)
* [Tags](/docs/liquid/tags/)

View File

@ -1,16 +1,12 @@
--- ---
title: Templates title: Liquid Filters
permalink: /docs/templates/ permalink: "/docs/liquid/filters/"
--- ---
All of the standard Liquid
Jekyll uses the [Liquid](https://shopify.github.io/liquid/) templating language to [filters](https://shopify.github.io/liquid/filters/abs/) are supported. To make
process templates. All of the standard Liquid [tags](https://shopify.github.io/liquid/tags/control-flow/) and common tasks easier, Jekyll even adds a few handy filters of its own,
[filters](https://shopify.github.io/liquid/filters/abs/) are all of which you can find on this page. You can also create your own filters
supported. To make common tasks easier, Jekyll even adds a few handy filters using [plugins](/docs/plugins/).
and tags of its own, all of which you can find on this page. Jekyll even lets
you come up with your own tags via plugins.
## Filters
<div class="mobile-side-scroller"> <div class="mobile-side-scroller">
<table> <table>
@ -461,159 +457,4 @@ The default is `default`. They are as follows (with what they filter):
- `default`: spaces and non-alphanumeric characters - `default`: spaces and non-alphanumeric characters
- `pretty`: spaces and non-alphanumeric characters except for `._~!$&'()+,;=@` - `pretty`: spaces and non-alphanumeric characters except for `._~!$&'()+,;=@`
- `ascii`: spaces, non-alphanumeric, and non-ASCII characters - `ascii`: spaces, non-alphanumeric, and non-ASCII characters
- `latin`: like `default`, except Latin characters are first transliterated (e.g. `àèïòü` to `aeiou`) {%- include docs_version_badge.html version="3.7.0" -%} - `latin`: like `default`, except Latin characters are first transliterated (e.g. `àèïòü` to `aeiou`) {%- include docs_version_badge.html version="3.7.0" -%}.
## Tags
* [Includes](#includes)
* [Code snippet highlighting](#code-snippet-highlighting)
* [Linking to pages, collections and posts (the new and improved way)](#links)
* [Linking to posts (the old way)](#linking-to-posts)
### Includes
If you have small page snippets that you want to include in multiple places on your site, save the snippets as *include files* and insert them where required, by using the `include` tag:
{% raw %}
```liquid
{% include footer.html %}
```
{% endraw %}
Jekyll expects all *include files* to be placed in an `_includes` directory at the root of your source directory. In the above example, this will embed the contents of `_includes/footer.html` into the calling file.
For more advanced information on using includes, see [Includes](../includes).
### Code snippet highlighting
Jekyll has built in support for syntax highlighting of over 60 languages
thanks to [Rouge](http://rouge.jneen.net). Rouge is the default highlighter
in Jekyll 3 and above. To use it in Jekyll 2, set `highlighter` to `rouge`
and ensure the `rouge` gem is installed properly.
Alternatively, you can use [Pygments](http://pygments.org) to highlight
your code snippets. To use Pygments, you must have Python installed on your
system, have the `pygments.rb` gem installed and set `highlighter` to
`pygments` in your site's configuration file. Pygments supports [over 100
languages](http://pygments.org/languages/)
To render a code block with syntax highlighting, surround your code as follows:
{% raw %}
```liquid
{% highlight ruby %}
def foo
puts 'foo'
end
{% endhighlight %}
```
{% endraw %}
The argument to the `highlight` tag (`ruby` in the example above) is the
language identifier. To find the appropriate identifier to use for the language
you want to highlight, look for the “short name” on the [Rouge
wiki](https://github.com/jayferd/rouge/wiki/List-of-supported-languages-and-lexers)
or the [Pygments' Lexers page](http://pygments.org/docs/lexers/).
<div class="note info">
<h5>Jekyll processes all Liquid filters in code blocks</h5>
<p>If you are using a language that contains curly braces, you
will likely need to place <code>{&#37; raw &#37;}</code> and
<code>{&#37; endraw &#37;}</code> tags around your code.</p>
</div>
#### Line numbers
There is a second argument to `highlight` called `linenos` that is optional.
Including the `linenos` argument will force the highlighted code to include line
numbers. For instance, the following code block would include line numbers next
to each line:
{% raw %}
```liquid
{% highlight ruby linenos %}
def foo
puts 'foo'
end
{% endhighlight %}
```
{% endraw %}
#### Stylesheets for syntax highlighting
In order for the highlighting to show up, youll need to include a highlighting
stylesheet. For an example stylesheet you can look at
[syntax.css](https://github.com/mojombo/tpw/tree/master/css/syntax.css). These
are the same styles as used by GitHub and you are free to use them for your own
site. If you use `linenos`, you might want to include an additional CSS class
definition for the `.lineno` class in `syntax.css` to distinguish the line
numbers from the highlighted code.
## Links
### Linking to pages {#link}
To link to a post, a page, collection item, or file, the `link` tag will generate the correct permalink URL for the path you specify. For example, if you use the `link` tag to link to `mypage.html`, even if you change your permalink style to include the file extension or omit it, the URL formed by the `link` tag will always be valid.
You must include the file's original extension when using the `link` tag. Here are some examples:
{% raw %}
```liquid
{{ site.baseurl }}{% link _collection/name-of-document.md %}
{{ site.baseurl }}{% link _posts/2016-07-26-name-of-post.md %}
{{ site.baseurl }}{% link news/index.html %}
{{ site.baseurl }}{% link /assets/files/doc.pdf %}
```
{% endraw %}
You can also use the `link` tag to create a link in Markdown as follows:
{% raw %}
```liquid
[Link to a document]({{ site.baseurl }}{% link _collection/name-of-document.md %})
[Link to a post]({{ site.baseurl }}{% link _posts/2016-07-26-name-of-post.md %})
[Link to a page]({{ site.baseurl }}{% link news/index.html %})
[Link to a file]({{ site.baseurl }}{% link /assets/files/doc.pdf %})
```
{% endraw %}
(Including `{% raw %}{{ site.baseurl }}{% endraw %}` is optional &mdash; it depends on whether you want to preface the page URL with the `baseurl` value.)
The path to the post, page, or collection is defined as the path relative to the root directory (where your config file is) to the file, not the path from your existing page to the other page.
For example, suppose you're creating a link in `page_a.md` (stored in `pages/folder1/folder2`) to `page_b.md` (stored in `pages/folder1`). Your path in the link would not be `../page_b.html`. Instead, it would be `/pages/folder1/page_b.md`.
If you're unsure of the path, add `{% raw %}{{ page.path }}{% endraw %}` to the page and it will display the path.
One major benefit of using the `link` or `post_url` tag is link validation. If the link doesn't exist, Jekyll won't build your site. This is a good thing, as it will alert you to a broken link so you can fix it (rather than allowing you to build and deploy a site with broken links).
Note you cannot add filters to `link` tags. For example, you cannot append a string using Liquid filters, such as `{% raw %}{% link mypage.html | append: "#section1" %} {% endraw %}`. To link to sections on a page, you will need to use regular HTML or Markdown linking techniques.
### Linking to posts
If you want to include a link to a post on your site, the `post_url` tag will generate the correct permalink URL for the post you specify.
{% raw %}
```liquid
{{ site.baseurl }}{% post_url 2010-07-21-name-of-post %}
```
{% endraw %}
If you organize your posts in subdirectories, you need to include subdirectory path to the post:
{% raw %}
```liquid
{{ site.baseurl }}{% post_url /subdir/2010-07-21-name-of-post %}
```
{% endraw %}
There is no need to include the file extension when using the `post_url` tag.
You can also use this tag to create a link to a post in Markdown as follows:
{% raw %}
```liquid
[Name of Link]({{ site.baseurl }}{% post_url 2010-07-21-name-of-post %})
```
{% endraw %}

142
docs/_docs/liquid/tags.md Normal file
View File

@ -0,0 +1,142 @@
---
title: Tags Filters
permalink: "/docs/liquid/tags/"
---
All of the standard Liquid
[tags](https://shopify.github.io/liquid/tags/control-flow/) are supported.
Jekyll has a few built in tags to help you build your site. You can also create
your own tags using [plugins](/docs/plugins/).
## Includes
If you have page snippets that you use repeatedly across your site, an
[include](/docs/includes/) is the perfect way to make this more maintainable.
## Code snippet highlighting
Jekyll has built in support for syntax highlighting of over 60 languages
thanks to [Rouge](http://rouge.jneen.net). Rouge is the default highlighter
in Jekyll 3 and above. To use it in Jekyll 2, set `highlighter` to `rouge`
and ensure the `rouge` gem is installed properly.
Alternatively, you can use [Pygments](http://pygments.org) to highlight
your code snippets. To use Pygments, you must have Python installed on your
system, have the `pygments.rb` gem installed and set `highlighter` to
`pygments` in your site's configuration file. Pygments supports [over 100
languages](http://pygments.org/languages/)
To render a code block with syntax highlighting, surround your code as follows:
{% raw %}
```liquid
{% highlight ruby %}
def foo
puts 'foo'
end
{% endhighlight %}
```
{% endraw %}
The argument to the `highlight` tag (`ruby` in the example above) is the
language identifier. To find the appropriate identifier to use for the language
you want to highlight, look for the “short name” on the [Rouge
wiki](https://github.com/jayferd/rouge/wiki/List-of-supported-languages-and-lexers)
or the [Pygments' Lexers page](http://pygments.org/docs/lexers/).
<div class="note info">
<h5>Jekyll processes all Liquid filters in code blocks</h5>
<p>If you are using a language that contains curly braces, you
will likely need to place <code>{&#37; raw &#37;}</code> and
<code>{&#37; endraw &#37;}</code> tags around your code.</p>
</div>
### Line numbers
There is a second argument to `highlight` called `linenos` that is optional.
Including the `linenos` argument will force the highlighted code to include line
numbers. For instance, the following code block would include line numbers next
to each line:
{% raw %}
```liquid
{% highlight ruby linenos %}
def foo
puts 'foo'
end
{% endhighlight %}
```
{% endraw %}
### Stylesheets for syntax highlighting
In order for the highlighting to show up, youll need to include a highlighting
stylesheet. For Pygments or Rouge you can use a stylesheet for Pygments, you
can find an example gallery [here](http://help.farbox.com/pygments.html).
## Links
### Linking to pages {#link}
To link to a post, a page, collection item, or file, the `link` tag will generate the correct permalink URL for the path you specify. For example, if you use the `link` tag to link to `mypage.html`, even if you change your permalink style to include the file extension or omit it, the URL formed by the `link` tag will always be valid.
You must include the file's original extension when using the `link` tag. Here are some examples:
{% raw %}
```liquid
{{ site.baseurl }}{% link _collection/name-of-document.md %}
{{ site.baseurl }}{% link _posts/2016-07-26-name-of-post.md %}
{{ site.baseurl }}{% link news/index.html %}
{{ site.baseurl }}{% link /assets/files/doc.pdf %}
```
{% endraw %}
You can also use the `link` tag to create a link in Markdown as follows:
{% raw %}
```liquid
[Link to a document]({{ site.baseurl }}{% link _collection/name-of-document.md %})
[Link to a post]({{ site.baseurl }}{% link _posts/2016-07-26-name-of-post.md %})
[Link to a page]({{ site.baseurl }}{% link news/index.html %})
[Link to a file]({{ site.baseurl }}{% link /assets/files/doc.pdf %})
```
{% endraw %}
(Including `{% raw %}{{ site.baseurl }}{% endraw %}` is optional &mdash; it depends on whether you want to preface the page URL with the `baseurl` value.)
The path to the post, page, or collection is defined as the path relative to the root directory (where your config file is) to the file, not the path from your existing page to the other page.
For example, suppose you're creating a link in `page_a.md` (stored in `pages/folder1/folder2`) to `page_b.md` (stored in `pages/folder1`). Your path in the link would not be `../page_b.html`. Instead, it would be `/pages/folder1/page_b.md`.
If you're unsure of the path, add `{% raw %}{{ page.path }}{% endraw %}` to the page and it will display the path.
One major benefit of using the `link` or `post_url` tag is link validation. If the link doesn't exist, Jekyll won't build your site. This is a good thing, as it will alert you to a broken link so you can fix it (rather than allowing you to build and deploy a site with broken links).
Note you cannot add filters to `link` tags. For example, you cannot append a string using Liquid filters, such as `{% raw %}{% link mypage.html | append: "#section1" %} {% endraw %}`. To link to sections on a page, you will need to use regular HTML or Markdown linking techniques.
### Linking to posts
If you want to include a link to a post on your site, the `post_url` tag will generate the correct permalink URL for the post you specify.
{% raw %}
```liquid
{{ site.baseurl }}{% post_url 2010-07-21-name-of-post %}
```
{% endraw %}
If you organize your posts in subdirectories, you need to include subdirectory path to the post:
{% raw %}
```liquid
{{ site.baseurl }}{% post_url /subdir/2010-07-21-name-of-post %}
```
{% endraw %}
There is no need to include the file extension when using the `post_url` tag.
You can also use this tag to create a link to a post in Markdown as follows:
{% raw %}
```liquid
[Name of Link]({{ site.baseurl }}{% post_url 2010-07-21-name-of-post %})
```
{% endraw %}

View File

@ -7,7 +7,7 @@ title: "Merging a Pull Request"
## Code Review ## Code Review
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. 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/) 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) 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.

View File

@ -51,4 +51,4 @@ Is what they wanted to get something we want to happen? Sometimes a bug report i
### Staleness and automatic closure ### Staleness and automatic closure
@jekyllbot will automatically mark issues as `stale` if no activity occurs for at least one month. @jekyllbot leaves a comment asking for information about reproducibility in current versions. If no one responds after another month, the issue is automatically closed. This behaviour can be suppressed by setting the [`pinned` label](../maintaining/special-labels.md/#pinned). @jekyllbot will automatically mark issues as `stale` if no activity occurs for at least one month. @jekyllbot leaves a comment asking for information about reproducibility in current versions. If no one responds after another month, the issue is automatically closed. This behavior can be suppressed by setting the [`pinned` label](/docs/maintaining/special-labels/#pinned).

View File

@ -0,0 +1,6 @@
---
title: Markdown 101
permalink: /docs/markdown-101/
---
# TO WRITE

View File

@ -1,5 +1,5 @@
--- ---
title: Blog migrations title: Blog Migrations
permalink: /docs/migrations/ permalink: /docs/migrations/
--- ---

View File

@ -1,74 +1,27 @@
--- ---
title: Creating pages title: Pages
permalink: /docs/pages/ permalink: /docs/pages/
--- ---
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. Pages are the most basic building block for content. They're useful for standalone
content (content which is not date based or is not a group of content such as staff
## Homepage members or recipes).
Just about every web server configuration you come across will look for an HTML
file called `index.html` (by convention) in the site's root folder and display
that as the homepage. Unless the web server youre using is configured to look
for some different filename as the default, this file will turn into the
homepage of your Jekyll-generated site.
<div class="note">
<h5>ProTip™: Use layouts on your homepage</h5>
<p>
Any HTML file on your site can use layouts and/or includes, even the
homepage. Common content, like headers and footers, make excellent
candidates for extraction into a layout.
</p>
</div>
## 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:
- Place named HTML or [Markdown](https://daringfireball.net/projects/markdown/)
files for each page in your site's root 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. By default, pages retain the same folder structure in `_site` as they do in the source directory.
### Named HTML files
The simplest way of adding a page is just to add an HTML file in the root The simplest way of adding a page is just to add an HTML file in the root
directory with a suitable name for the page you want to create. For a site with directory with a suitable filename. You can also write a page in Markdown using
a `.md` extension which converts to HTML on build. For a site with
a homepage, an about page, and a contact page, heres what the root directory a homepage, an about page, and a contact page, heres what the root directory
and associated URLs might look like: and associated URLs might look like:
```sh ```sh
. .
|-- _config.yml |-- about.md # => http://example.com/about.html
|-- _includes/
|-- _layouts/
|-- _posts/
|-- _site/
|-- about.html # => http://example.com/about.html
|-- index.html # => http://example.com/ |-- index.html # => http://example.com/
|-- other.md # => http://example.com/other.html
└── contact.html # => http://example.com/contact.html └── contact.html # => http://example.com/contact.html
``` ```
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. If you have a lot of pages, you can organize them 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.
## Flattening pages from subfolders into the root directory ## Changing the output URL
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: You might want to have a particular folder structure for your source files that changes for the built site. With [permalinks](/docs/permalinks) you have full control of the output URL.
```yaml
---
title: My page
permalink: mypageurl.html
---
```
### Named folders containing index HTML files
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.

View File

@ -42,10 +42,10 @@ paginate_path: "/blog/page:num/"
This will read in `blog/index.html`, send it each pagination page in Liquid as This will read in `blog/index.html`, send it each pagination page in Liquid as
`paginator` and write the output to `blog/page:num/`, where `:num` is the `paginator` and write the output to `blog/page:num/`, where `:num` is the
pagination page number, starting with `2`. If a site has 12 posts and specifies pagination page number, starting with `2`. <br/>
`paginate: 5`, Jekyll will write `blog/index.html` with the first 5 posts, `blog/page2/index.html` with the next 5 posts If a site has 12 posts and specifies `paginate: 5`, Jekyll will write `blog/index.html`
and `blog/page3/index.html` with the last 2 posts into the destination with the first 5 posts, `blog/page2/index.html` with the next 5 posts and
directory. `blog/page3/index.html` with the last 2 posts into the destination directory.
<div class="note warning"> <div class="note warning">
<h5>Don't set a permalink</h5> <h5>Don't set a permalink</h5>
@ -58,8 +58,11 @@ directory.
<div class="note info"> <div class="note info">
<h5>Pagination for categories, tags and collections</h5> <h5>Pagination for categories, tags and collections</h5>
<p> <p>
The more recent <a href="https://github.com/sverrirs/jekyll-paginate-v2">jekyll-paginate-v2</a> plugin supports more features. See the <a href="https://github.com/sverrirs/jekyll-paginate-v2/tree/master/examples">pagination examples</a> in the repository. The more recent <a href="https://github.com/sverrirs/jekyll-paginate-v2">
<strong>This plugin is not supported by GitHub Pages</strong>. jekyll-paginate-v2</a> plugin supports more features. See the
<a href="https://github.com/sverrirs/jekyll-paginate-v2/tree/master/examples">
pagination examples</a> in the repository. <strong>This plugin is not
supported by GitHub Pages</strong>.
</p> </p>
</div> </div>
@ -100,19 +103,19 @@ attributes:
<tr> <tr>
<td><p><code>previous_page</code></p></td> <td><p><code>previous_page</code></p></td>
<td> <td>
<p> <p>
page number of the previous pagination page, page number of the previous pagination page,
or <code>nil</code> if no previous page exists or <code>nil</code> if no previous page exists
</p> </p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><p><code>previous_page_path</code></p></td> <td><p><code>previous_page_path</code></p></td>
<td> <td>
<p> <p>
path of previous pagination page, path of previous pagination page,
or <code>nil</code> if no previous page exists or <code>nil</code> if no previous page exists
</p> </p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -127,10 +130,10 @@ attributes:
<tr> <tr>
<td><p><code>next_page_path</code></p></td> <td><p><code>next_page_path</code></p></td>
<td> <td>
<p> <p>
path of next pagination page, path of next pagination page,
or <code>nil</code> if no subsequent page exists or <code>nil</code> if no subsequent page exists
</p> </p>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -140,7 +143,7 @@ attributes:
<div class="note info"> <div class="note info">
<h5>Pagination does not support tags or categories</h5> <h5>Pagination does not support tags or categories</h5>
<p>Pagination pages through every post in the <code>posts</code> <p>Pagination pages through every post in the <code>posts</code>
variable unless a post has <code>hidden: true</code> in its YAML Front Matter. variable unless a post has <code>hidden: true</code> in its front matter.
It does not currently allow paging over groups of posts linked It does not currently allow paging over groups of posts linked
by a common tag or category. It cannot include any collection of by a common tag or category. It cannot include any collection of
documents because it is restricted to posts.</p> documents because it is restricted to posts.</p>
@ -174,11 +177,15 @@ title: My Blog
<!-- Pagination links --> <!-- Pagination links -->
<div class="pagination"> <div class="pagination">
{% if paginator.previous_page %} {% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path }}" class="previous">Previous</a> <a href="{{ paginator.previous_page_path }}" class="previous">
Previous
</a>
{% else %} {% else %}
<span class="previous">Previous</span> <span class="previous">Previous</span>
{% endif %} {% endif %}
<span class="page_number ">Page: {{ paginator.page }} of {{ paginator.total_pages }}</span> <span class="page_number ">
Page: {{ paginator.page }} of {{ paginator.total_pages }}
</span>
{% if paginator.next_page %} {% if paginator.next_page %}
<a href="{{ paginator.next_page_path }}" class="next">Next</a> <a href="{{ paginator.next_page_path }}" class="next">Next</a>
{% else %} {% else %}
@ -205,7 +212,9 @@ page with links to all but the current page.
{% if paginator.total_pages > 1 %} {% if paginator.total_pages > 1 %}
<div class="pagination"> <div class="pagination">
{% if paginator.previous_page %} {% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&laquo; Prev</a> <a href="{{ paginator.previous_page_path | relative_url }}">
&laquo; Prev
</a>
{% else %} {% else %}
<span>&laquo; Prev</span> <span>&laquo; Prev</span>
{% endif %} {% endif %}
@ -214,14 +223,20 @@ page with links to all but the current page.
{% if page == paginator.page %} {% if page == paginator.page %}
<em>{{ page }}</em> <em>{{ page }}</em>
{% elsif page == 1 %} {% elsif page == 1 %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a> <a href="{{ paginator.previous_page_path | relative_url }}">
{{ page }}
</a>
{% else %} {% else %}
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a> <a href="{{ site.paginate_path | relative_url | replace: ':num', page }}">
{{ page }}
</a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if paginator.next_page %} {% if paginator.next_page %}
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next &raquo;</a> <a href="{{ paginator.next_page_path | relative_url }}">
Next &raquo;
</a>
{% else %} {% else %}
<span>Next &raquo;</span> <span>Next &raquo;</span>
{% endif %} {% endif %}

View File

@ -3,54 +3,48 @@ title: Permalinks
permalink: /docs/permalinks/ permalink: /docs/permalinks/
--- ---
Permalinks refer to the URLs (excluding the domain name or directory folder) for your pages, posts, or collections. Permalinks are the output path for your pages, posts, or collections. They
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. allow you to structure the directories of your source code different from the
directories in your output.
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:output_ext`. Each of the colon-prefixed keywords is a template variable. ## Front Matter
## Where to configure permalinks The simplest way to set a permalink is using front matter. You set the
`permalink` variable in front matter to the output path you'd like.
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. For example, you might have a page on your site located at
`/my_pages/about-me.html` and you want the output url to be `/about/`. In
front matter the page you would set:
Setting permalink styles in your configuration file applies the setting globally in your project. You configure permalinks in your `_config.yml` file like this: ```
---
permalink: /about/
---
```
## Global
Setting a permalink in front matter for every page on your site is no fun.
Luckily, Jekyll let's you set in globally in your `_config.yml`.
To set a global permalink, you use the `permalink` variable in `_config.yml`.
You can use placeholders to your desired output. For example:
```yaml ```yaml
permalink: /:categories/:year/:month/:day/:title:output_ext permalink: /:categories/:year/:month/:day/:title:output_ext
``` ```
If you don't specify any permalink setting, Jekyll uses the above pattern as the default. Note that pages and collections don't have time or categories, these aspects of
the permalink style are ignored for the output.
The permalink can also be set using a built-in permalink style: For example, a permalink style of
`/:categories/:year/:month/:day/:title:output_ext` for posts becomes
`/:title.html` for pages and collections.
```yaml ### Placeholders
permalink: date
```
`date` is the same as `:categories/:year/:month/:day/:title:output_ext`, the default. See [Built-in Permalink Styles](#builtinpermalinkstyles) below for more options. Here's the full list of placeholders available:
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/`.
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
```
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}
The following table lists the template variables available for permalinks. You can use these variables in the `permalink` property in your config file.
<div class="mobile-side-scroller"> <div class="mobile-side-scroller">
<table> <table>
@ -68,7 +62,7 @@ The following table lists the template variables available for permalinks. You c
<td> <td>
<p> <p>
Year from the post's filename. May be overridden via the documents Year from the post's filename. May be overridden via the documents
<code>date</code> YAML front matter <code>date</code> front matter
</p> </p>
</td> </td>
</tr> </tr>
@ -79,7 +73,7 @@ The following table lists the template variables available for permalinks. You c
<td> <td>
<p> <p>
Month from the post's filename. May be overridden via the documents Month from the post's filename. May be overridden via the documents
<code>date</code> YAML front matter <code>date</code> front matter
</p> </p>
</td> </td>
</tr> </tr>
@ -90,7 +84,7 @@ The following table lists the template variables available for permalinks. You c
<td> <td>
<p> <p>
Month without leading zeros from the post's filename. May be Month without leading zeros from the post's filename. May be
overridden via the documents <code>date</code> YAML front matter overridden via the documents <code>date</code> front matter
</p> </p>
</td> </td>
</tr> </tr>
@ -101,7 +95,7 @@ The following table lists the template variables available for permalinks. You c
<td> <td>
<p> <p>
Day from the post's filename. May be overridden via the documents Day from the post's filename. May be overridden via the documents
<code>date</code> YAML front matter <code>date</code> front matter
</p> </p>
</td> </td>
</tr> </tr>
@ -112,14 +106,14 @@ The following table lists the template variables available for permalinks. You c
<td> <td>
<p> <p>
Day without leading zeros from the post's filename. May be overridden Day without leading zeros from the post's filename. May be overridden
via the documents <code>date</code> YAML front matter via the documents <code>date</code> front matter
</p> </p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<p><code>y_day</code></p> <p><code>y_day</code></p>
</td>_ </td>
<td> <td>
<p>Day of the year from the post's filename, with leading zeros.</p> <p>Day of the year from the post's filename, with leading zeros.</p>
</td> </td>
@ -131,7 +125,7 @@ The following table lists the template variables available for permalinks. You c
<td> <td>
<p> <p>
Year without the century from the post's filename. May be overridden Year without the century from the post's filename. May be overridden
via the documents <code>date</code> YAML front matter via the documents <code>date</code> front matter
</p> </p>
</td> </td>
</tr> </tr>
@ -173,7 +167,7 @@ The following table lists the template variables available for permalinks. You c
<td> <td>
<p> <p>
Title from the documents filename. May be overridden via Title from the documents filename. May be overridden via
the documents <code>slug</code> YAML front matter. the documents <code>slug</code> front matter.
</p> </p>
</td> </td>
</tr> </tr>
@ -185,7 +179,7 @@ The following table lists the template variables available for permalinks. You c
<p> <p>
Slugified title from the documents filename (any character Slugified title from the documents filename (any character
except numbers and letters is replaced as hyphen). May be except numbers and letters is replaced as hyphen). May be
overridden via the documents <code>slug</code> YAML front matter. overridden via the documents <code>slug</code> front matter.
</p> </p>
</td> </td>
</tr> </tr>
@ -206,11 +200,9 @@ The following table lists the template variables available for permalinks. You c
</table> </table>
</div> </div>
Note that all template variables relating to time or categories are available to posts only. ### Built-in formats
## Built-in permalink styles {#builtinpermalinkstyles} For posts, Jekyll also provides the following built-in styles for convenience:
Although you can specify a custom permalink pattern using [template variables](#template-variables), Jekyll also provides the following built-in styles for convenience.
<div class="mobile-side-scroller"> <div class="mobile-side-scroller">
<table> <table>
@ -260,135 +252,80 @@ 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: pretty`. Rather than typing `permalink: /:categories/:year/:month/:day/:title/`, you can just type `permalink: pretty`.
<div class="note info"> <div class="note info">
<h5>Specifying permalinks through the YAML Front Matter</h5> <h5>Specifying permalinks through the front matter</h5>
<p>Built-in permalink styles are not recognized in YAML Front Matter. As a result, <code>permalink: pretty</code> will not work.</p> <p>Built-in permalink styles are not recognized in front matter. As a result, <code>permalink: pretty</code> will not work.</p>
</div> </div>
## Permalink style examples with posts {#permalink-style-examples} ### Collections
Here are a few examples to clarify how permalink styles get applied with posts. For collections, you have the option to override the global permalink in the
collection configuration in `_config.yml`:
Given a post named: `/2009-04-29-slap-chop.md` ```yaml
collections:
my_collection:
output: true
permalink: /:collection/:name
```
Collections have the following placeholders available:
<div class="mobile-side-scroller"> <div class="mobile-side-scroller">
<table> <table>
<thead> <thead>
<tr> <tr>
<th>URL Template</th> <th>Variable</th>
<th>Resulting Permalink URL</th> <th>Description</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td> <td>
<p>None specified, or <code>permalink: date</code></p> <p><code>:collection</code></p>
</td> </td>
<td> <td>
<p><code>/2009/04/29/slap-chop.html</code></p> <p>Label of the containing collection.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<p><code>pretty</code></p> <p><code>:path</code></p>
</td> </td>
<td> <td>
<p><code>/2009/04/29/slap-chop/</code></p> <p>Path to the document relative to the collection's directory.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<p><code>/:month-:day-:year/:title:output_ext</code></p> <p><code>:name</code></p>
</td> </td>
<td> <td>
<p><code>/04-29-2009/slap-chop.html</code></p> <p>The document's base filename, with every sequence of spaces
and non-alphanumeric characters replaced by a hyphen.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<p><code>/blog/:year/:month/:day/:title/</code></p> <p><code>:title</code></p>
</td> </td>
<td> <td>
<p><code>/blog/2009/04/29/slap-chop/</code></p> <p>
The <code>:title</code> template variable will take the
<code>slug</code> <a href="/docs/front-matter/">front matter</a>
variable value if any is present in the document; if none is
defined then <code>:title</code> will be equivalent to
<code>:name</code>, aka the slug generated from the filename.
</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<p><code>/:year/:month/:title</code></p> <p><code>:output_ext</code></p>
<p>See <a href="#extensionless-permalinks">Extensionless permalinks with no trailing slashes</a> for details.</p>
</td> </td>
<td> <td>
<p><code>/2009/04/slap-chop</code></p> <p>Extension of the output file. (Included by default and usually unnecessary.)</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
## Permalink settings for pages and collections {#pages-and-collections}
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.
For example:
* A permalink style of `/:categories/:year/:month/:day/:title:output_ext` 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
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 by default mimic the source directory structure exactly. (The only exception is if your page has a `permalink` declared its front matter &mdash; 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 (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 to the front matter of each page, with no path specified:
```yaml
---
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 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.
### Apache
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
{% endhighlight %}
### Nginx
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) in Templates for more details.

View File

@ -7,946 +7,11 @@ Jekyll has a plugin system with hooks that allow you to create custom generated
content specific to your site. You can run custom code for your site without content specific to your site. You can run custom code for your site without
having to modify the Jekyll source itself. having to modify the Jekyll source itself.
<div class="note info"> * [Installation](/docs/plugins/installation/) - How to install plugins
<h5>Plugins on GitHub Pages</h5> * [Your first plugin](/docs/plugins/your-first-plugin/) - How to write plugins
<p> * [Generators](/docs/plugins/generators/) - Create additional content on your site
<a href="https://pages.github.com/">GitHub Pages</a> is powered by Jekyll. * [Converters](/docs/plugins/converters/) - Change a markup language into another format
However, all Pages sites are generated using the <code>--safe</code> option * [Commands](/docs/plugins/commands/) - Extend the `jekyll` executable with subcommands
to disable custom plugins for security reasons. Unfortunately, this means * [Tags](/docs/plugins/tags) - Create custom Liquid tags
your plugins wont work if youre deploying to GitHub Pages.<br><br> * [Filters](/docs/plugins/filters/) - Create custom Liquid filters
You can still use GitHub Pages to publish your site, but youll need to * [Hooks](/docs/plugins/hooks/) - Fine-grained control to extend the build process
convert the site locally and push the generated static files to your GitHub
repository instead of the Jekyll source files.
</p>
</div>
## Installing a plugin
You have 3 options for installing plugins:
1. In your site source root, make a `_plugins` directory. Place your plugins
here. Any file ending in `*.rb` inside this directory will be loaded before
Jekyll generates your site.
2. In your `_config.yml` file, add a new array with the key `plugins` (or `gems` for Jekyll < `3.5.0`) and the
values of the gem names of the plugins you'd like to use. An example:
```yaml
# This will require each of these plugins automatically.
plugins:
- jekyll-gist
- jekyll-coffeescript
- jekyll-assets
- another-jekyll-plugin
```
Then install your plugins using `gem install jekyll-gist jekyll-coffeescript jekyll-assets another-jekyll-plugin`
3. Add the relevant plugins to a Bundler group in your `Gemfile`. An
example:
```ruby
group :jekyll_plugins do
gem "jekyll-gist"
gem "jekyll-coffeescript"
gem "jekyll-assets"
gem "another-jekyll-plugin"
end
```
Now you need to install all plugins from your Bundler group by running single command `bundle install`.
<div class="note info">
<h5>
<code>_plugins</code>, <code>_config.yml</code> and <code>Gemfile</code>
can be used simultaneously
</h5>
<p>
You may use any of the aforementioned plugin options simultaneously in the
same site if you so choose. Use of one does not restrict the use of the
others.
</p>
</div>
### The jekyll_plugins group
Jekyll gives this particular group of gems in your `Gemfile` a different
treatment. Any gem included in this group is loaded before Jekyll starts
processing the rest of your source directory.
A gem included here will be activated even if its not explicitly listed under
the `plugins:` key in your site's config file.
<div class="note warning">
<p>
Gems included in the <code>:jekyll-plugins</code> group are activated
regardless of the <code>--safe</code> mode setting. Be aware of what
gems are included under this group!
</p>
</div>
In general, plugins you make will fall broadly into one of five categories:
1. [Generators](#generators)
2. [Converters](#converters)
3. [Commands](#commands)
4. [Tags](#tags)
5. [Hooks](#hooks)
See the bottom of the page for a [list of available plugins](#available-plugins).
For further information on how to develop your own plugins, check out the [Liquid documentation](https://github.com/Shopify/liquid/wiki/Liquid-for-Programmers) as well.
If you never developed a Jekyll plugin [check this useful wrap-up](https://ayastreb.me/writing-a-jekyll-plugin/) by @ayastreb to get started.
## Generators
You can create a generator when you need Jekyll to create additional content
based on your own rules.
A generator is a subclass of `Jekyll::Generator` that defines a `generate`
method, which receives an instance of
[`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb). The
return value of `generate` is ignored.
Generators run after Jekyll has made an inventory of the existing content, and
before the site is generated. Pages with YAML Front Matters are stored as
instances of
[`Jekyll::Page`]({{ site.repository }}/blob/master/lib/jekyll/page.rb)
and are available via `site.pages`. Static files become instances of
[`Jekyll::StaticFile`]({{ site.repository }}/blob/master/lib/jekyll/static_file.rb)
and are available via `site.static_files`. See
[the Variables documentation page](/docs/variables/) and
[`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb)
for more details.
For instance, a generator can inject values computed at build time for template
variables. In the following example the template `reading.html` has two
variables `ongoing` and `done` that we fill in the generator:
```ruby
module Reading
class Generator < Jekyll::Generator
def generate(site)
ongoing, done = Book.all.partition(&:ongoing?)
reading = site.pages.detect {|page| page.name == 'reading.html'}
reading.data['ongoing'] = ongoing
reading.data['done'] = done
end
end
end
```
This is a more complex generator that generates new pages:
```ruby
module Jekyll
class CategoryPage < Page
def initialize(site, base, dir, category)
@site = site
@base = base
@dir = dir
@name = 'index.html'
self.process(@name)
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
self.data['category'] = category
category_title_prefix = site.config['category_title_prefix'] || 'Category: '
self.data['title'] = "#{category_title_prefix}#{category}"
end
end
class CategoryPageGenerator < Generator
safe true
def generate(site)
if site.layouts.key? 'category_index'
dir = site.config['category_dir'] || 'categories'
site.categories.each_key do |category|
site.pages << CategoryPage.new(site, site.source, File.join(dir, category), category)
end
end
end
end
end
```
In this example, our generator will create a series of files under the
`categories` directory for each category, listing the posts in each category
using the `category_index.html` layout.
Generators are only required to implement one method:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>generate</code></p>
</td>
<td>
<p>Generates content as a side-effect.</p>
</td>
</tr>
</tbody>
</table>
</div>
## Converters
If you have a new markup language youd like to use with your site, you can
include it by implementing your own converter. Both the Markdown and
[Textile](https://github.com/jekyll/jekyll-textile-converter) markup
languages are implemented using this method.
<div class="note info">
<h5>Remember your YAML Front Matter</h5>
<p>
Jekyll will only convert files that have a YAML header at the top, even for
converters you add using a plugin.
</p>
</div>
Below is a converter that will take all posts ending in `.upcase` and process
them using the `UpcaseConverter`:
```ruby
module Jekyll
class UpcaseConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /^\.upcase$/i
end
def output_ext(ext)
".html"
end
def convert(content)
content.upcase
end
end
end
```
Converters should implement at a minimum 3 methods:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>matches</code></p>
</td>
<td><p>
Does the given extension match this converters list of acceptable
extensions? Takes one argument: the files extension (including the
dot). Must return <code>true</code> if it matches, <code>false</code>
otherwise.
</p></td>
</tr>
<tr>
<td>
<p><code>output_ext</code></p>
</td>
<td><p>
The extension to be given to the output file (including the dot).
Usually this will be <code>".html"</code>.
</p></td>
</tr>
<tr>
<td>
<p><code>convert</code></p>
</td>
<td><p>
Logic to do the content conversion. Takes one argument: the raw content
of the file (without YAML Front Matter). Must return a String.
</p></td>
</tr>
</tbody>
</table>
</div>
In our example, `UpcaseConverter#matches` checks if our filename extension is
`.upcase`, and will render using the converter if it is. It will call
`UpcaseConverter#convert` to process the content. In our simple converter were
simply uppercasing the entire content string. Finally, when it saves the page,
it will do so with a `.html` extension.
## Commands
As of version 2.5.0, Jekyll can be extended with plugins which provide
subcommands for the `jekyll` executable. This is possible by including the
relevant plugins in a `Gemfile` group called `:jekyll_plugins`:
```ruby
group :jekyll_plugins do
gem "my_fancy_jekyll_plugin"
end
```
Each `Command` must be a subclass of the `Jekyll::Command` class and must
contain one class method: `init_with_program`. An example:
```ruby
class MyNewCommand < Jekyll::Command
class << self
def init_with_program(prog)
prog.command(:new) do |c|
c.syntax "new [options]"
c.description 'Create a new Jekyll site.'
c.option 'dest', '-d DEST', 'Where the site should go.'
c.action do |args, options|
Jekyll::Site.new_site_at(options['dest'])
end
end
end
end
end
```
Commands should implement this single class method:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>init_with_program</code></p>
</td>
<td><p>
This method accepts one parameter, the
<code><a href="https://github.com/jekyll/mercenary#readme">Mercenary::Program</a></code>
instance, which is the Jekyll program itself. Upon the program,
commands may be created using the above syntax. For more details,
visit the Mercenary repository on GitHub.com.
</p></td>
</tr>
</tbody>
</table>
</div>
## Tags
If youd like to include custom liquid tags in your site, you can do so by
hooking into the tagging system. Built-in examples added by Jekyll include the
`highlight` and `include` tags. Below is an example of a custom liquid tag that
will output the time the page was rendered:
```ruby
module Jekyll
class RenderTimeTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text
end
def render(context)
"#{@text} #{Time.now}"
end
end
end
Liquid::Template.register_tag('render_time', Jekyll::RenderTimeTag)
```
At a minimum, liquid tags must implement:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>render</code></p>
</td>
<td>
<p>Outputs the content of the tag.</p>
</td>
</tr>
</tbody>
</table>
</div>
You must also register the custom tag with the Liquid template engine as
follows:
```ruby
Liquid::Template.register_tag('render_time', Jekyll::RenderTimeTag)
```
In the example above, we can place the following tag anywhere in one of our
pages:
{% raw %}
```ruby
<p>{% render_time page rendered at: %}</p>
```
{% endraw %}
And we would get something like this on the page:
```html
<p>page rendered at: Tue June 22 23:38:47 0500 2010</p>
```
### Liquid filters
You can add your own filters to the Liquid template system much like you can
add tags above. Filters are simply modules that export their methods to liquid.
All methods will have to take at least one parameter which represents the input
of the filter. The return value will be the output of the filter.
```ruby
module Jekyll
module AssetFilter
def asset_url(input)
"http://www.example.com/#{input}?#{Time.now.to_i}"
end
end
end
Liquid::Template.register_filter(Jekyll::AssetFilter)
```
<div class="note">
<h5>ProTip™: Access the site object using Liquid</h5>
<p>
Jekyll lets you access the <code>site</code> object through the
<code>context.registers</code> feature of Liquid at <code>context.registers[:site]</code>. For example, you can
access the global configuration file <code>_config.yml</code> using
<code>context.registers[:site].config</code>.
</p>
</div>
### Flags
There are two flags to be aware of when writing a plugin:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Flag</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>safe</code></p>
</td>
<td>
<p>
A boolean flag that informs Jekyll whether this plugin may be safely
executed in an environment where arbitrary code execution is not
allowed. This is used by GitHub Pages to determine which core plugins
may be used, and which are unsafe to run. If your plugin does not
allow for arbitrary code execution, set this to <code>true</code>.
GitHub Pages still wont load your plugin, but if you submit it for
inclusion in core, its best for this to be correct!
</p>
</td>
</tr>
<tr>
<td>
<p><code>priority</code></p>
</td>
<td>
<p>
This flag determines what order the plugin is loaded in. Valid values
are: <code>:lowest</code>, <code>:low</code>, <code>:normal</code>,
<code>:high</code>, and <code>:highest</code>. Highest priority
matches are applied first, lowest priority are applied last.
</p>
</td>
</tr>
</tbody>
</table>
</div>
To use one of the example plugins above as an illustration, here is how youd
specify these two flags:
```ruby
module Jekyll
class UpcaseConverter < Converter
safe true
priority :low
...
end
end
```
## Hooks
Using hooks, your plugin can exercise fine-grained control over various aspects
of the build process. If your plugin defines any hooks, Jekyll will call them
at pre-defined points.
Hooks are registered to a container and an event name. To register one, you
call Jekyll::Hooks.register, and pass the container, event name, and code to
call whenever the hook is triggered. For example, if you want to execute some
custom functionality every time Jekyll renders a post, you could register a
hook like this:
```ruby
Jekyll::Hooks.register :posts, :post_render do |post|
# code to call after Jekyll renders a post
end
```
Jekyll provides hooks for <code>:site</code>, <code>:pages</code>,
<code>:posts</code>, and <code>:documents</code>. In all cases, Jekyll calls
your hooks with the container object as the first callback parameter. However,
all `:pre_render` hooks and the`:site, :post_render` hook will also provide a
payload hash as a second parameter. In the case of `:pre_render`, the payload
gives you full control over the variables that are available while rendering.
In the case of `:site, :post_render`, the payload contains final values after
rendering all the site (useful for sitemaps, feeds, etc).
The complete list of available hooks is below:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Container</th>
<th>Event</th>
<th>Called</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:after_init</code></p>
</td>
<td>
<p>Just after the site initializes, but before setup & render. Good
for modifying the configuration of the site.</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:after_reset</code></p>
</td>
<td>
<p>Just after site reset</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:post_read</code></p>
</td>
<td>
<p>After site data has been read and loaded from disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:pre_render</code></p>
</td>
<td>
<p>Just before rendering the whole site</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:post_render</code></p>
</td>
<td>
<p>After rendering the whole site, but before writing any files</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:post_write</code></p>
</td>
<td>
<p>After writing the whole site to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:pages</code></p>
</td>
<td>
<p><code>:post_init</code></p>
</td>
<td>
<p>Whenever a page is initialized</p>
</td>
</tr>
<tr>
<td>
<p><code>:pages</code></p>
</td>
<td>
<p><code>:pre_render</code></p>
</td>
<td>
<p>Just before rendering a page</p>
</td>
</tr>
<tr>
<td>
<p><code>:pages</code></p>
</td>
<td>
<p><code>:post_render</code></p>
</td>
<td>
<p>After rendering a page, but before writing it to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:pages</code></p>
</td>
<td>
<p><code>:post_write</code></p>
</td>
<td>
<p>After writing a page to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:posts</code></p>
</td>
<td>
<p><code>:post_init</code></p>
</td>
<td>
<p>Whenever a post is initialized</p>
</td>
</tr>
<tr>
<td>
<p><code>:posts</code></p>
</td>
<td>
<p><code>:pre_render</code></p>
</td>
<td>
<p>Just before rendering a post</p>
</td>
</tr>
<tr>
<td>
<p><code>:posts</code></p>
</td>
<td>
<p><code>:post_render</code></p>
</td>
<td>
<p>After rendering a post, but before writing it to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:posts</code></p>
</td>
<td>
<p><code>:post_write</code></p>
</td>
<td>
<p>After writing a post to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:documents</code></p>
</td>
<td>
<p><code>:post_init</code></p>
</td>
<td>
<p>Whenever a document is initialized</p>
</td>
</tr>
<tr>
<td>
<p><code>:documents</code></p>
</td>
<td>
<p><code>:pre_render</code></p>
</td>
<td>
<p>Just before rendering a document</p>
</td>
</tr>
<tr>
<td>
<p><code>:documents</code></p>
</td>
<td>
<p><code>:post_render</code></p>
</td>
<td>
<p>After rendering a document, but before writing it to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:documents</code></p>
</td>
<td>
<p><code>:post_write</code></p>
</td>
<td>
<p>After writing a document to disk</p>
</td>
</tr>
</tbody>
</table>
</div>
## Available Plugins
You can find a few useful plugins at the following locations:
#### Generators
- [Sitemap.xml Generator by Michael Levin](https://github.com/kinnetica/jekyll-plugins): Generates a sitemap.xml file by traversing all of the available posts and pages.
- [Full-text search by Pascal Widdershoven](https://github.com/PascalW/jekyll_indextank): Adds full-text search to your Jekyll site with a plugin and a bit of JavaScript.
- [AliasGenerator by Thomas Mango](https://github.com/tsmango/jekyll_alias_generator): Generates redirect pages for posts when an alias is specified in the YAML Front Matter.
- [Pageless Redirect Generator by Nick Quinlan](https://github.com/nquinlan/jekyll-pageless-redirects): Generates redirects based on files in the Jekyll root, with support for htaccess style redirects.
- [RssGenerator by Assaf Gelber](https://github.com/agelber/jekyll-rss): Automatically creates an RSS 2.0 feed from your posts.
- [Monthly archive generator by Shigeya Suzuki](https://github.com/shigeya/jekyll-monthly-archive-plugin): Generator and template which renders monthly archive like MovableType style, based on the work by Ilkka Laukkanen and others above.
- [Category archive generator by Shigeya Suzuki](https://github.com/shigeya/jekyll-category-archive-plugin): Generator and template which renders category archive like MovableType style, based on Monthly archive generator.
- [Emoji for Jekyll](https://github.com/yihangho/emoji-for-jekyll): Seamlessly enable emoji for all posts and pages.
- [Compass integration for Jekyll](https://github.com/mscharley/jekyll-compass): Easily integrate Compass and Sass with your Jekyll website.
- [Pages Directory by Ben Baker-Smith](https://github.com/bbakersmith/jekyll-pages-directory): Defines a `_pages` directory for page files which routes its output relative to the project root.
- [Page Collections by Jeff Kolesky](https://github.com/jeffkole/jekyll-page-collections): Generates collections of pages with functionality that resembles posts.
- [Windows 8.1 Live Tile Generation by Matt Sheehan](https://github.com/sheehamj13/jekyll-live-tiles): Generates Internet Explorer 11 config.xml file and Tile Templates for pinning your site to Windows 8.1.
- [Typescript Generator by Matt Sheehan](https://github.com/sheehamj13/jekyll_ts): Generate Javascript on build from your Typescript.
- [Jekyll::AutolinkEmail by Ivan Tse](https://github.com/ivantsepp/jekyll-autolink_email): Autolink your emails.
- [Jekyll::GitMetadata by Ivan Tse](https://github.com/ivantsepp/jekyll-git_metadata): Expose Git metadata for your templates.
- [Jekyll Auto Image by Merlos](https://github.com/merlos/jekyll-auto-image): Gets the first image of a post. Useful to list your posts with images or to add [twitter cards](https://dev.twitter.com/cards/overview) to your site.
- [Jekyll Portfolio Generator by Shannon Babincsak](https://github.com/codeinpink/jekyll-portfolio-generator): Generates project pages and computes related projects out of project data files.
- [Jekyll-Umlauts by Arne Gockeln](https://github.com/webchef/jekyll-umlauts): This generator replaces all german umlauts (äöüß) case sensitive with html.
- [Jekyll Flickr Plugin](https://github.com/lawmurray/indii-jekyll-flickr) by [Lawrence Murray](http://www.indii.org): Generates posts for photos uploaded to a Flickr photostream.
- [Jekyll::Paginate::Category](https://github.com/midnightSuyama/jekyll-paginate-category): Pagination Generator for Jekyll Category.
- [AMP-Jekyll by Juuso Mikkonen](https://github.com/juusaw/amp-jekyll): Generate [Accelerated Mobile Pages](https://www.ampproject.org) of Jekyll posts.
- [Jekyll Art Gallery plugin](https://github.com/alexivkin/Jekyll-Art-Gallery-Plugin): An advanced art/photo gallery generation plugin for creating galleries from a set of image folders. Supports image tagging, thumbnails, sorting, image rotation, post-processing (remove EXIF, add watermark), multiple collections and much more.
- [jekyll-ga](https://github.com/developmentseed/jekyll-ga): A Jekyll plugin that downloads Google Analytics data and adds it to posts. Useful for making a site that lists "most popular" content. [Read the introduction](https://developmentseed.org/blog/google-analytics-jekyll-plugin/) post on the developmentSEED blog.
- [jekyll-multi-paginate](https://github.com/fadhilnapis/jekyll-multi-paginate): Simple Jekyll paginator for multiple page. Ease you to make pagination on multiple page especially like multiple language.
- [jekyll-category-pages](https://github.com/field-theory/jekyll-category-pages): Easy-to-use category index pages with and without pagination. Supports non-URL-safe category keywords and has extensive documentation and test coverage.
- [Tweetsert](https://github.com/ibrado/jekyll-tweetsert): Imports tweets (Twitter statuses) as new posts. Features multiple timeline support, hashtag import, filtering, automatic category and/or tags, optional retweets and replies.
- [Stickyposts](https://github.com/ibrado/jekyll-stickyposts): Moves or copies (pins) posts marked `sticky: true` to the top of the list. Perfect for keeping important announcements on the home page, or giving collections a descriptive entry. Paginator friendly.
- [Jekyll::Paginate::Content](https://github.com/ibrado/jekyll-paginate-content): Content paginator in the style of jekyll-paginator-v2 that splits pages, posts, and collection entries into several pages. Specify a separator or use HTML &lt;h1&gt; etc. headers. Automatic splitting, single-page view, pager/trail, self-adjusting links, multipage TOC, SEO support.
- [Premonition](https://github.com/amedia/premonition): Adds block-styled side content to your page. For example summary, notes, hints or warning boxes.
- [jekyll-fontello](https://github.com/ericcornelissen/jekyll-fontello): A Jekyll plugin that automatically downloads your webfont from Fontello.
- [Target Blank](https://github.com/keithmifsud/jekyll-target-blank): A Jekyll plugin to automatically open external links in a new browser tab or window.
- [jekyll-info](https://github.com/swestmoreland/jekyll-info): A plugin to provide information about your Jekyll sites configuration.
#### Converters
- [Pug plugin by Doug Beney](http://jekyll-pug.dougie.io): Use the popular Pug (previously Jade) templating language in Jekyll. Complete with caching, includes support, and much more.
- [Textile converter](https://github.com/jekyll/jekyll-textile-converter): Convert `.textile` files into HTML. Also includes the `textilize` Liquid filter.
- [Slim plugin](https://github.com/slim-template/jekyll-slim): Slim converter and includes for Jekyll with support for Liquid tags.
- [Markdown References by Olov Lassus](https://github.com/olov/jekyll-references): Keep all your markdown reference-style link definitions in one \_references.md file.
- [ReStructuredText Converter](https://github.com/xdissent/jekyll-rst): Converts ReST documents to HTML with Pygments syntax highlighting.
- [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 pandocs markdown extensions.
- [Customized Kramdown Converter](https://github.com/mvdbos/kramdown-with-pygments): Enable Pygments syntax highlighting for Kramdown-parsed fenced code blocks.
- [Bigfootnotes Plugin](https://github.com/TheFox/jekyll-bigfootnotes): Enables big footnotes for Kramdown.
- [AsciiDoc Plugin](https://github.com/asciidoctor/jekyll-asciidoc): AsciiDoc convertor for Jekyll using [Asciidoctor](http://asciidoctor.org/).
- [Lazy Tweet Embedding](https://github.com/takuti/jekyll-lazy-tweet-embedding): Automatically convert tweet urls into twitter cards.
- [jekyll-commonmark](https://github.com/pathawks/jekyll-commonmark): Markdown converter that uses [libcmark](https://github.com/jgm/CommonMark), the reference parser for CommonMark.
#### Filters
- [Truncate HTML](https://github.com/MattHall/truncatehtml) by [Matt Hall](https://codebeef.com/): A Jekyll filter that truncates HTML while preserving markup structure.
- [Domain Name Filter by Lawrence Woodman](https://github.com/LawrenceWoodman/domain_name-liquid_filter): Filters the input text so that just the domain name is left.
- [Smilify](https://github.com/SaswatPadhi/jekyll_smilify) by [SaswatPadhi](https://github.com/SaswatPadhi): Convert text emoticons in your content to themeable smiley pics.
- [Jekyll-timeago](https://github.com/markets/jekyll-timeago): Converts a time value to the time ago in words.
- [pluralize](https://github.com/bdesham/pluralize): Easily combine a number and a word into a grammatically-correct amount like “1 minute” or “2 minute**s**”.
- [reading_time](https://github.com/bdesham/reading_time): Count words and estimate reading time for a piece of text, ignoring HTML elements that are unlikely to contain running text.
- [Table of Content Generator](https://github.com/dafi/jekyll-toc-generator): Generate the HTML code containing a table of content (TOC), the TOC can be customized in many way, for example you can decide which pages can be without TOC.
- [jekyll-toc](https://github.com/toshimaru/jekyll-toc): A liquid filter plugin for Jekyll which generates a table of contents.
- [jekyll-humanize](https://github.com/23maverick23/jekyll-humanize): This is a port of the Django app humanize which adds a "human touch" to data. Each method represents a Fluid type filter that can be used in your Jekyll site templates. Given that Jekyll produces static sites, some of the original methods do not make logical sense to port (e.g. naturaltime).
- [Jekyll-Ordinal](https://github.com/PatrickC8t/Jekyll-Ordinal): Jekyll liquid filter to output a date ordinal such as "st", "nd", "rd", or "th".
- [Deprecated articles keeper](https://github.com/kzykbys/JekyllPlugins) by [Kazuya Kobayashi](http://blog.kazuya.co/): A simple Jekyll filter which monitor how old an article is.
- [Jekyll-jalali](https://github.com/mehdisadeghi/jekyll-jalali) by [Mehdi Sadeghi](http://mehdix.ir): A simple Gregorian to Jalali date converter filter.
- [Jekyll Thumbnail Filter](https://github.com/matallo/jekyll-thumbnail-filter): Related posts thumbnail filter.
- [liquid-md5](https://github.com/pathawks/liquid-md5): Returns an MD5 hash. Helpful for generating Gravatars in templates.
- [jekyll-roman](https://github.com/paulrobertlloyd/jekyll-roman): A liquid filter for Jekyll that converts numbers into Roman numerals.
- [jekyll-typogrify](https://github.com/myles/jekyll-typogrify): A Jekyll plugin that brings the functions of [typogruby](http://avdgaag.github.io/typogruby/).
- [Jekyll Email Protect](https://github.com/vwochnik/jekyll-email-protect): Email protection liquid filter for Jekyll
- [Jekyll Uglify Filter](https://github.com/mattg/jekyll-uglify-filter): A Liquid filter that runs your JavaScript through UglifyJS.
- [match_regex](https://github.com/sparanoid/match_regex): A Liquid filter to perform regex match.
- [replace_regex](https://github.com/sparanoid/replace_regex): A Liquid filter to perform regex replace.
- [Jekyll Money](https://rubygems.org/gems/jekyll-money): A Jekyll plugin for dealing with money. Because we all have to at some point.
- [jekyll-random](https://github.com/codecalm/jekyll-random) by [codecalm](https://nodecalm.net): A Jekyll plugin that generates pseudo-random data. Very useful when you want to generate a large amount of random data.
- [jekyll-firstimage](https://github.com/nhoizey/jekyll-firstimage) adds a Liquid filter finding the first image in a HTML content string, including responsive images srcset.
#### Tags
You can find a few useful plugins at the following locations:
- [Jekyll-gist](https://github.com/jekyll/jekyll-gist): Use the `gist` tag to easily embed a GitHub Gist onto your site. This works with public or secret gists.
- [Asset Path Tag](https://github.com/samrayner/jekyll-asset-path-plugin) by [Sam Rayner](http://www.samrayner.com/): Allows organisation of assets into subdirectories by outputting a path for a given file relative to the current post or page.
- [Delicious Plugin by Christian Hellsten](https://github.com/christianhellsten/jekyll-plugins): Fetches and renders bookmarks from delicious.com.
- [Embed.ly client by Robert Böhnke](https://github.com/robb/jekyll-embedly-client): Autogenerate embeds from URLs using oEmbed.
- [FlickrSetTag by Thomas Mango](https://github.com/tsmango/jekyll_flickr_set_tag): Generates image galleries from Flickr sets.
- [Tweet Tag by Scott W. Bradley](https://github.com/scottwb/jekyll-tweet-tag): Liquid tag for [Embedded Tweets](https://dev.twitter.com/docs/embedded-tweets) using Twitters shortcodes.
- [Jekyll Twitter Plugin](https://github.com/rob-murray/jekyll-twitter-plugin): A Liquid tag plugin that renders Tweets from Twitter API. Currently supports the [oEmbed](https://dev.twitter.com/rest/reference/get/statuses/oembed) API.
- [Jekyll-contentblocks](https://github.com/rustygeldmacher/jekyll-contentblocks): Lets you use Rails-like content_for tags in your templates, for passing content from your posts up to your layouts.
- [Jekyll-beastiepress](https://github.com/okeeblow/jekyll-beastiepress): FreeBSD utility tags for Jekyll sites.
- [Bibjekyll](https://github.com/pablooliveira/bibjekyll): Render BibTeX-formatted bibliographies/citations included in posts and pages using bibtex2html.
- [Jekyll-citation](https://github.com/archome/jekyll-citation): Render BibTeX-formatted bibliographies/citations included in posts and pages (pure Ruby).
- [Jekyll Dribbble Set Tag](https://github.com/ericdfields/Jekyll-Dribbble-Set-Tag): Builds Dribbble image galleries from any user.
- [JekyllGalleryTag](https://github.com/redwallhp/JekyllGalleryTag) by [redwallhp](https://github.com/redwallhp): Generates thumbnails from a directory of images and displays them in a grid.
- [Jekyll-swfobject](https://github.com/sectore/jekyll-swfobject): Liquid plugin for embedding Adobe Flash files (.swf) using [SWFObject](https://github.com/swfobject/swfobject).
- [Jekyll Picture Tag](https://github.com/robwierzbowski/jekyll-picture-tag): Easy responsive images for Jekyll. Based on the proposed [`<picture>`](https://html.spec.whatwg.org/multipage/embedded-content.html#the-picture-element) element, polyfilled with Scott Jehls [Picturefill](https://github.com/scottjehl/picturefill).
- [Jekyll Image Tag](https://github.com/robwierzbowski/jekyll-image-tag): Better images for Jekyll. Save image presets, generate resized images, and add classes, alt text, and other attributes.
- [Jekyll Responsive Image](https://github.com/wildlyinaccurate/jekyll-responsive-image): Responsive images for Jekyll. Automatically resizes images, supports all responsive methods (`<picture>`, `srcset`, Imager.js, etc), super-flexible configuration.
- [Ditaa Tag](https://github.com/matze/jekyll-ditaa) by [matze](https://github.com/matze): Renders ASCII diagram art into PNG images and inserts a figure tag.
- [Jekyll Suggested Tweet](https://github.com/davidensinger/jekyll-suggested-tweet) by [David Ensinger](https://github.com/davidensinger/): A Liquid tag for Jekyll that allows for the embedding of suggested tweets via Twitters Web Intents API.
- [Jekyll Date Chart](https://github.com/GSI/jekyll_date_chart) by [GSI](https://github.com/GSI): Block that renders date line charts based on textile-formatted tables.
- [Jekyll Image Encode](https://github.com/GSI/jekyll_image_encode) by [GSI](https://github.com/GSI): Tag that renders base64 codes of images fetched from the web.
- [Jekyll Quick Man](https://github.com/GSI/jekyll_quick_man) by [GSI](https://github.com/GSI): Tag that renders pretty links to man page sources on the internet.
- [Image Set/Gallery Tag](https://github.com/callmeed/jekyll-image-set) by [callmeed](https://github.com/callmeed): Renders HTML for an image gallery from a folder in your Jekyll site. Just pass it a folder name and class/tag options.
- [jekyll_figure](https://github.com/lmullen/jekyll_figure): Generate figures and captions with links to the figure in a variety of formats
- [Jekyll GitHub Sample Tag](https://github.com/bwillis/jekyll-github-sample): A liquid tag to include a sample of a github repo file in your Jekyll site.
- [Jekyll Project Version Tag](https://github.com/rob-murray/jekyll-version-plugin): A Liquid tag plugin that renders a version identifier for your Jekyll site sourced from the git repository containing your code.
- [Piwigo Gallery](https://github.com/AlessandroLorenzi/piwigo_gallery) by [Alessandro Lorenzi](http://blog.alorenzi.eu/): Jekyll plugin to generate thumbnails from a Piwigo gallery and display them with a Liquid tag
- [mathml.rb](https://github.com/tmthrgd/jekyll-plugins) by Tom Thorogood: A plugin to convert TeX mathematics into MathML for display.
- [webmention_io.rb](https://github.com/aarongustafson/jekyll-webmention_io) by [Aaron Gustafson](http://aaron-gustafson.com/): A plugin to enable [webmention](https://indieweb.org/webmention) integration using [Webmention.io](https://webmention.io/). Includes an optional JavaScript for updating webmentions automatically between publishes and, if available, in realtime using WebSockets.
- [Jekyll 500px Embed](https://github.com/lkorth/jekyll-500px-embed) by Luke Korth. A Liquid tag plugin that embeds [500px](https://500px.com/) photos.
- [inline\_highlight](https://github.com/bdesham/inline_highlight): A tag for inline syntax highlighting.
- [jekyll-mermaid](https://github.com/jasonbellamy/jekyll-mermaid): Simplify the creation of mermaid diagrams and flowcharts in your posts and pages.
- [twa](https://github.com/Ezmyrelda/twa): Twemoji Awesome plugin for Jekyll. Liquid tag allowing you to use twitter emoji in your jekyll pages.
- [Fetch remote file content](https://github.com/dimitri-koenig/jekyll-plugins) by [Dimitri König](https://www.dimitrikoenig.net/): Using `remote_file_content` tag you can fetch the content of a remote file and include it as if you would put the content right into your markdown file yourself. Very useful for including code from github repo's to always have a current repo version.
- [jekyll-asciinema](https://github.com/mnuessler/jekyll-asciinema): A tag for embedding asciicasts recorded with [asciinema](https://asciinema.org) in your Jekyll pages.
- [Jekyll-Youtube](https://github.com/dommmel/jekyll-youtube) A Liquid tag that embeds Youtube videos. The default emded markup is responsive but you can also specify your own by using an include/partial.
- [Jekyll Flickr Plugin](https://github.com/lawmurray/indii-jekyll-flickr) by [Lawrence Murray](http://www.indii.org): Embeds Flickr photosets (albums) as a gallery of thumbnails, with lightbox links to larger images.
- [jekyll-figure](https://github.com/paulrobertlloyd/jekyll-figure): A liquid tag for Jekyll that generates `<figure>` elements.
- [Jekyll Video Embed](https://github.com/eug/jekyll-video-embed): It provides several tags to easily embed videos (e.g. Youtube, Vimeo, UStream and Ted Talks)
- [jekyll-i18n_tags](https://github.com/KrzysiekJ/jekyll-i18n_tags): Translate your templates.
- [Jekyll Ideal Image Slider](https://github.com/jekylltools/jekyll-ideal-image-slider): Liquid tag plugin to create image sliders using [Ideal Image Slider](https://github.com/gilbitron/Ideal-Image-Slider).
- [Jekyll Tags List Plugin](https://github.com/crispgm/jekyll-tags-list-plugin): A Liquid tag plugin that creates tags list in specific order.
- [Jekyll Maps](https://github.com/ayastreb/jekyll-maps) by [Anatoliy Yastreb](https://github.com/ayastreb): A Jekyll plugin to easily embed maps with filterable locations.
- [Jekyll Cloudinary](https://nhoizey.github.io/jekyll-cloudinary/) by [Nicolas Hoizey](https://nicolas-hoizey.com/): a Jekyll plugin adding a Liquid tag to ease the use of Cloudinary for responsive images in your Markdown/Kramdown posts.
- [jekyll-include-absolute-plugin](https://github.com/tnhu/jekyll-include-absolute-plugin) by [Tan Nhu](https://github.com/tnhu): A Jekyll plugin to include a file from its path relative to Jekyll's source folder.
- [Jekyll Download Tag](https://github.com/mattg/jekyll-download-tag): A Liquid tag that acts like `include`, but for external resources.
- [Jekyll Brand Social Wall](https://github.com/MediaComem/jekyll-brand-social-wall): A jekyll plugin to generate a social wall with your favorite social networks
- [Jekyll If File Exists](https://github.com/k-funk/jekyll-if-file-exists): A Jekyll Plugin that checks if a file exists with an if/else block.
- [BibSonomy](https://github.com/rjoberon/bibsonomy-jekyll): Jekyll
plugin to generate publication lists from [BibSonomy](https://www.bibsonomy.org/).
- [github-cards](https://github.com/edward-shen/github-cards): Creates styleable Github cards for your Github projects.
- [disqus-for-jekyll](https://github.com/kacperduras/disqus-for-jekyll): A Jekyll plugin to view the comments powered by Disqus.
- [jekyll-html](https://github.com/kacperduras/jekyll-html): A Jekyll plugin to use HTML tags in Jekyll pages, posts and collections.
- [jekyll-onebox](https://github.com/rriemann/jekyll-onebox): Liquid tag for displaying HTML previews (embeds) for links to popular domains. Plugin is based on [Onebox](https://github.com/discourse/onebox) that powers link previews in [Discourse](http://github.com/discourse/discourse) forums.
- [jekyll-w2m](https://github.com/kacperduras/jekyll-w2m): A Jekyll plugin to liberate content from Microsoft Word documents (powered by [word-to-markdown](https://github.com/benbalter/word-to-markdown)).
- [jekyll-flickr](https://github.com/rriemann/jekyll-flickr): Liquid tag for responsive Flickr images using HTML5 srcset. Subtitles and automatic license notices are supported.
- [CAT](https://github.com/binfalse/jekyll-cat): Include the contents of any file (like the `include` command, but also for files outside of `_include`). Similar to Unix' `cat` tool; useful for including source code etc. in posts and pages.
#### Collections
- [Jekyll Plugins by Recursive Design](https://github.com/recurser/jekyll-plugins): Plugins to generate Project pages from GitHub readmes, a Category page, and a Sitemap generator.
- [Company website and blog plugins](https://github.com/flatterline/jekyll-plugins) by Flatterline, a Ruby on Rails development company: Portfolio/project page generator, team/individual page generator, an author bio liquid tag for use on posts, and a few other smaller plugins.
- [Jekyll plugins by Aucor](https://github.com/aucor/jekyll-plugins): Plugins for trimming unwanted newlines/whitespace and sorting pages by weight attribute.
#### Other
- [Analytics for Jekyll](https://github.com/hendrikschneider/jekyll-analytics) by Hendrik Schneider: An effortless way to add various trackers like Google Analytics, Matomo (formerly Piwik), mPulse, etc. to your site.
- [ditaa-ditaa](https://github.com/tmthrgd/ditaa-ditaa) by Tom Thorogood: a drastic revision of jekyll-ditaa that renders diagrams drawn using ASCII art into PNG images.
- [Pygments Cache Path by Raimonds Simanovskis](https://github.com/rsim/blog.rayapps.com/blob/master/_plugins/pygments_cache_patch.rb): Plugin to cache syntax-highlighted code from Pygments.
- [Related Posts by Lawrence Woodman](https://github.com/LawrenceWoodman/related_posts-jekyll_plugin): Overrides `site.related_posts` to use categories to assess relationship.
- [jekyll-tagging-related_posts](https://github.com/toshimaru/jekyll-tagging-related_posts): Jekyll related_posts function based on tags (works on Jekyll3).
- [Jekyll-localization](https://github.com/blackwinter/jekyll-localization): Jekyll plugin that adds localization features to the rendering engine.
- [Jekyll-rendering](https://github.com/blackwinter/jekyll-rendering): Jekyll plugin to provide alternative rendering engines.
- [Jekyll-pagination](https://github.com/blackwinter/jekyll-pagination): Jekyll plugin to extend the pagination generator.
- [Jekyll-tagging](https://github.com/pattex/jekyll-tagging): Jekyll plugin to automatically generate a tag cloud and tag pages.
- [Jekyll-scholar](https://github.com/inukshuk/jekyll-scholar): Jekyll extensions for the blogging scholar.
- [Jekyll-assets](http://jekyll.github.io/jekyll-assets/) by [ixti](https://github.com/ixti): Rails-alike assets pipeline (write assets in CoffeeScript, Sass, LESS etc; specify dependencies for automatic bundling using simple declarative comments in assets; minify and compress; use JST templates; cache bust; and many-many more).
- [JAPR](https://github.com/kitsched/japr): Jekyll Asset Pipeline Reborn - Powerful asset pipeline for Jekyll that collects, converts and compresses JavaScript and CSS assets.
- [Jekyll-minibundle](https://github.com/tkareine/jekyll-minibundle): Asset bundling and cache busting using external minification tool of your choice. No gem dependencies.
- [Singlepage-jekyll](https://github.com/JCB-K/singlepage-jekyll) by [JCB-K](https://github.com/JCB-K): Turns Jekyll into a dynamic one-page website.
- [generator-jekyllrb](https://github.com/robwierzbowski/generator-jekyllrb): A generator that wraps Jekyll in [Yeoman](http://yeoman.io/), a tool collection and workflow for building modern web apps.
- [grunt-jekyll](https://github.com/dannygarcia/grunt-jekyll): A straightforward [Grunt](http://gruntjs.com/) plugin for Jekyll.
- [jekyll-postfiles](https://github.com/indirect/jekyll-postfiles): Add `_postfiles` directory and {% raw %}`{% postfile %}`{% endraw %} tag so the files a post refers to will always be right there inside your repo.
- [A layout that compresses HTML](http://jch.penibelst.de/): GitHub Pages compatible, configurable way to compress HTML files on site build.
- [Jekyll CO₂](https://github.com/wdenton/jekyll-co2): Generates HTML showing the monthly change in atmospheric CO₂ at the Mauna Loa observatory in Hawaii.
- [remote-include](http://www.northfieldx.co.uk/remote-include/): Includes files using remote URLs
- [jekyll-minifier](https://github.com/digitalsparky/jekyll-minifier): Minifies HTML, XML, CSS, and Javascript both inline and as separate files utilising yui-compressor and htmlcompressor.
- [Jekyll views router](https://bitbucket.org/nyufac/jekyll-views-router): Simple router between generator plugins and templates.
- [Jekyll Language Plugin](https://github.com/vwochnik/jekyll-language-plugin): Jekyll 3.0-compatible multi-language plugin for posts, pages and includes.
- [Jekyll Deploy](https://github.com/vwochnik/jekyll-deploy): Adds a `deploy` sub-command to Jekyll.
- [Official Contentful Jekyll Plugin](https://github.com/contentful/jekyll-contentful-data-import): Adds a `contentful` sub-command to Jekyll to import data from Contentful.
- [jekyll-paspagon](https://github.com/KrzysiekJ/jekyll-paspagon): Sell your posts in various formats for cryptocurrencies.
- [Hawkins](https://github.com/awood/hawkins): Adds a `liveserve` sub-command to Jekyll that incorporates [LiveReload](http://livereload.com/) into your pages while you preview them. No more hitting the refresh button in your browser!
- [Jekyll Autoprefixer](https://github.com/vwochnik/jekyll-autoprefixer): Autoprefixer integration for Jekyll
- [Jekyll-breadcrumbs](https://github.com/git-no/jekyll-breadcrumbs): Creates breadcrumbs for Jekyll 3.x, includes features like SEO optimization, optional breadcrumb item translation and more.
- [generator-jekyllized](https://github.com/sondr3/generator-jekyllized): A Yeoman generator for rapidly developing sites with Gulp. Live reload your site, automatically minify and optimize your assets and much more.
- [Jekyll-Spotify](https://github.com/MertcanGokgoz/Jekyll-Spotify): Easily output Spotify Embed Player for jekyll
- [jekyll-menus](https://github.com/forestryio/jekyll-menus): Hugo style menus for your Jekyll site... recursive menus included.
- [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.
- [jekyll-numbered-headings](https://github.com/muratayusuke/jekyll-numbered-headings): Adds ordered number to headings.
- [jekyll-pre-commit](https://github.com/mpchadwick/jekyll-pre-commit): A framework for running checks against your posts using a git pre-commit hook before you publish them.
- [jekyll-pwa-plugin](https://github.com/lavas-project/jekyll-pwa): A plugin provides PWA support for Jekyll. It generates a service worker in Jekyll build process and makes precache and runtime cache available in the runtime with Google Workbox.
- [jekyll-algolia](https://community.algolia.com/jekyll-algolia/): Add fast and relevant search to your Jekyll site through the Algolia API.
- [jekyll-get](https://github.com/18F/jekyll-get): Download data from external JSON API sources to use in generating a site.
- [jekyll-xml-source](https://github.com/mcred/jekyll-xml-source): Download XML and RSS from external sites for use in site data.
<div class="note info">
<h5>Submit your gem plugins</h5>
<p>
You're encouraged to add your Jekyll gem plugins to this list, <a href="../contributing/">read the contributing page</a> to find
out how to make that happen.
</p>
</div>

View File

@ -0,0 +1,62 @@
---
title: Commands
permalink: /docs/plugins/commands/
---
As of version 2.5.0, Jekyll can be extended with plugins which provide
subcommands for the `jekyll` executable. This is possible by including the
relevant plugins in a `Gemfile` group called `:jekyll_plugins`:
```ruby
group :jekyll_plugins do
gem "my_fancy_jekyll_plugin"
end
```
Each `Command` must be a subclass of the `Jekyll::Command` class and must
contain one class method: `init_with_program`. An example:
```ruby
class MyNewCommand < Jekyll::Command
class << self
def init_with_program(prog)
prog.command(:new) do |c|
c.syntax "new [options]"
c.description 'Create a new Jekyll site.'
c.option 'dest', '-d DEST', 'Where the site should go.'
c.action do |args, options|
Jekyll::Site.new_site_at(options['dest'])
end
end
end
end
end
```
Commands should implement this single class method:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>init_with_program</code></p>
</td>
<td><p>
This method accepts one parameter, the
<code><a href="https://github.com/jekyll/mercenary#readme">Mercenary::Program</a></code>
instance, which is the Jekyll program itself. Upon the program,
commands may be created using the above syntax. For more details,
visit the Mercenary repository on GitHub.com.
</p></td>
</tr>
</tbody>
</table>
</div>

View File

@ -0,0 +1,91 @@
---
title: Converters
permalink: /docs/plugins/converters/
---
If you have a new markup language youd like to use with your site, you can
include it by implementing your own converter. Both the Markdown and
[Textile](https://github.com/jekyll/jekyll-textile-converter) markup
languages are implemented using this method.
<div class="note info">
<h5>Remember your Front Matter</h5>
<p>
Jekyll will only convert files that have a YAML header at the top, even for
converters you add using a plugin.
</p>
</div>
Below is a converter that will take all posts ending in `.upcase` and process
them using the `UpcaseConverter`:
```ruby
module Jekyll
class UpcaseConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /^\.upcase$/i
end
def output_ext(ext)
".html"
end
def convert(content)
content.upcase
end
end
end
```
Converters should implement at a minimum 3 methods:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>matches</code></p>
</td>
<td><p>
Does the given extension match this converters list of acceptable
extensions? Takes one argument: the files extension (including the
dot). Must return <code>true</code> if it matches, <code>false</code>
otherwise.
</p></td>
</tr>
<tr>
<td>
<p><code>output_ext</code></p>
</td>
<td><p>
The extension to be given to the output file (including the dot).
Usually this will be <code>".html"</code>.
</p></td>
</tr>
<tr>
<td>
<p><code>convert</code></p>
</td>
<td><p>
Logic to do the content conversion. Takes one argument: the raw content
of the file (without front matter). Must return a String.
</p></td>
</tr>
</tbody>
</table>
</div>
In our example, `UpcaseConverter#matches` checks if our filename extension is
`.upcase`, and will render using the converter if it is. It will call
`UpcaseConverter#convert` to process the content. In our simple converter were
simply uppercasing the entire content string. Finally, when it saves the page,
it will do so with a `.html` extension.

View File

@ -0,0 +1,30 @@
---
title: Filters
permalink: /docs/plugins/filters/
---
Filters are simply modules that export their methods to liquid.
All methods will have to take at least one parameter which represents the input
of the filter. The return value will be the output of the filter.
```ruby
module Jekyll
module AssetFilter
def asset_url(input)
"http://www.example.com/#{input}?#{Time.now.to_i}"
end
end
end
Liquid::Template.register_filter(Jekyll::AssetFilter)
```
<div class="note">
<h5>ProTip™: Access the site object using Liquid</h5>
<p>
Jekyll lets you access the <code>site</code> object through the
<code>context.registers</code> feature of Liquid at <code>context.registers[:site]</code>. For example, you can
access the global configuration file <code>_config.yml</code> using
<code>context.registers[:site].config</code>.
</p>
</div>

View File

@ -0,0 +1,103 @@
---
title: Generators
permalink: /docs/plugins/generators/
---
You can create a generator when you need Jekyll to create additional content
based on your own rules.
A generator is a subclass of `Jekyll::Generator` that defines a `generate`
method, which receives an instance of
[`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb). The
return value of `generate` is ignored.
Generators run after Jekyll has made an inventory of the existing content, and
before the site is generated. Pages with front matter are stored as
instances of
[`Jekyll::Page`]({{ site.repository }}/blob/master/lib/jekyll/page.rb)
and are available via `site.pages`. Static files become instances of
[`Jekyll::StaticFile`]({{ site.repository }}/blob/master/lib/jekyll/static_file.rb)
and are available via `site.static_files`. See
[the Variables documentation page](/docs/variables/) and
[`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb)
for more details.
For instance, a generator can inject values computed at build time for template
variables. In the following example the template `reading.html` has two
variables `ongoing` and `done` that we fill in the generator:
```ruby
module Reading
class Generator < Jekyll::Generator
def generate(site)
ongoing, done = Book.all.partition(&:ongoing?)
reading = site.pages.detect {|page| page.name == 'reading.html'}
reading.data['ongoing'] = ongoing
reading.data['done'] = done
end
end
end
```
This is a more complex generator that generates new pages:
```ruby
module Jekyll
class CategoryPage < Page
def initialize(site, base, dir, category)
@site = site
@base = base
@dir = dir
@name = 'index.html'
self.process(@name)
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
self.data['category'] = category
category_title_prefix = site.config['category_title_prefix'] || 'Category: '
self.data['title'] = "#{category_title_prefix}#{category}"
end
end
class CategoryPageGenerator < Generator
safe true
def generate(site)
if site.layouts.key? 'category_index'
dir = site.config['category_dir'] || 'categories'
site.categories.each_key do |category|
site.pages << CategoryPage.new(site, site.source, File.join(dir, category), category)
end
end
end
end
end
```
In this example, our generator will create a series of files under the
`categories` directory for each category, listing the posts in each category
using the `category_index.html` layout.
Generators are only required to implement one method:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>generate</code></p>
</td>
<td>
<p>Generates content as a side-effect.</p>
</td>
</tr>
</tbody>
</table>
</div>

244
docs/_docs/plugins/hooks.md Normal file
View File

@ -0,0 +1,244 @@
---
title: Hooks
permalink: /docs/plugins/hooks/
---
Using hooks, your plugin can exercise fine-grained control over various aspects
of the build process. If your plugin defines any hooks, Jekyll will call them
at pre-defined points.
Hooks are registered to a container and an event name. To register one, you
call Jekyll::Hooks.register, and pass the container, event name, and code to
call whenever the hook is triggered. For example, if you want to execute some
custom functionality every time Jekyll renders a post, you could register a
hook like this:
```ruby
Jekyll::Hooks.register :posts, :post_render do |post|
# code to call after Jekyll renders a post
end
```
Jekyll provides hooks for <code>:site</code>, <code>:pages</code>,
<code>:posts</code>, and <code>:documents</code>. In all cases, Jekyll calls
your hooks with the container object as the first callback parameter. However,
all `:pre_render` hooks and the`:site, :post_render` hook will also provide a
payload hash as a second parameter. In the case of `:pre_render`, the payload
gives you full control over the variables that are available while rendering.
In the case of `:site, :post_render`, the payload contains final values after
rendering all the site (useful for sitemaps, feeds, etc).
The complete list of available hooks is below:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Container</th>
<th>Event</th>
<th>Called</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:after_init</code></p>
</td>
<td>
<p>Just after the site initializes, but before setup & render. Good
for modifying the configuration of the site.</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:after_reset</code></p>
</td>
<td>
<p>Just after site reset</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:post_read</code></p>
</td>
<td>
<p>After site data has been read and loaded from disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:pre_render</code></p>
</td>
<td>
<p>Just before rendering the whole site</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:post_render</code></p>
</td>
<td>
<p>After rendering the whole site, but before writing any files</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:post_write</code></p>
</td>
<td>
<p>After writing the whole site to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:pages</code></p>
</td>
<td>
<p><code>:post_init</code></p>
</td>
<td>
<p>Whenever a page is initialized</p>
</td>
</tr>
<tr>
<td>
<p><code>:pages</code></p>
</td>
<td>
<p><code>:pre_render</code></p>
</td>
<td>
<p>Just before rendering a page</p>
</td>
</tr>
<tr>
<td>
<p><code>:pages</code></p>
</td>
<td>
<p><code>:post_render</code></p>
</td>
<td>
<p>After rendering a page, but before writing it to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:pages</code></p>
</td>
<td>
<p><code>:post_write</code></p>
</td>
<td>
<p>After writing a page to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:posts</code></p>
</td>
<td>
<p><code>:post_init</code></p>
</td>
<td>
<p>Whenever a post is initialized</p>
</td>
</tr>
<tr>
<td>
<p><code>:posts</code></p>
</td>
<td>
<p><code>:pre_render</code></p>
</td>
<td>
<p>Just before rendering a post</p>
</td>
</tr>
<tr>
<td>
<p><code>:posts</code></p>
</td>
<td>
<p><code>:post_render</code></p>
</td>
<td>
<p>After rendering a post, but before writing it to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:posts</code></p>
</td>
<td>
<p><code>:post_write</code></p>
</td>
<td>
<p>After writing a post to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:documents</code></p>
</td>
<td>
<p><code>:post_init</code></p>
</td>
<td>
<p>Whenever a document is initialized</p>
</td>
</tr>
<tr>
<td>
<p><code>:documents</code></p>
</td>
<td>
<p><code>:pre_render</code></p>
</td>
<td>
<p>Just before rendering a document</p>
</td>
</tr>
<tr>
<td>
<p><code>:documents</code></p>
</td>
<td>
<p><code>:post_render</code></p>
</td>
<td>
<p>After rendering a document, but before writing it to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:documents</code></p>
</td>
<td>
<p><code>:post_write</code></p>
</td>
<td>
<p>After writing a document to disk</p>
</td>
</tr>
</tbody>
</table>
</div>

View File

@ -0,0 +1,82 @@
---
title: Plugins
permalink: /docs/plugins/installation/
---
You have 3 options for installing plugins:
1. In your site source root, make a `_plugins` directory. Place your plugins
here. Any file ending in `*.rb` inside this directory will be loaded before
Jekyll generates your site.
2. In your `_config.yml` file, add a new array with the key `plugins` (or `gems` for Jekyll < `3.5.0`) and the
values of the gem names of the plugins you'd like to use. An example:
```yaml
# This will require each of these plugins automatically.
plugins:
- jekyll-gist
- jekyll-coffeescript
- jekyll-assets
- another-jekyll-plugin
```
Then install your plugins using `gem install jekyll-gist jekyll-coffeescript jekyll-assets another-jekyll-plugin`
3. Add the relevant plugins to a Bundler group in your `Gemfile`. An
example:
```ruby
group :jekyll_plugins do
gem "jekyll-gist"
gem "jekyll-coffeescript"
gem "jekyll-assets"
gem "another-jekyll-plugin"
end
```
Now you need to install all plugins from your Bundler group by running single command `bundle install`.
<div class="note info">
<h5>Plugins on GitHub Pages</h5>
<p>
<a href="https://pages.github.com/">GitHub Pages</a> is powered by Jekyll.
However, all Pages sites are generated using the <code>--safe</code> option
to disable plugins (with the exception of some
<a href="https://pages.github.com/versions">whitelisted plugins</a>) for
security reasons. Unfortunately, this means
your plugins wont work if youre deploying to GitHub Pages.<br><br>
You can still use GitHub Pages to publish your site, but youll need to
convert the site locally and push the generated static files to your GitHub
repository instead of the Jekyll source files.
</p>
</div>
<div class="note info">
<h5>
<code>_plugins</code>, <code>_config.yml</code> and <code>Gemfile</code>
can be used simultaneously
</h5>
<p>
You may use any of the aforementioned plugin options simultaneously in the
same site if you so choose. Use of one does not restrict the use of the
others.
</p>
</div>
### The jekyll_plugins group
Jekyll gives this particular group of gems in your `Gemfile` a different
treatment. Any gem included in this group is loaded before Jekyll starts
processing the rest of your source directory.
A gem included here will be activated even if its not explicitly listed under
the `plugins:` key in your site's config file.
<div class="note warning">
<p>
Gems included in the <code>:jekyll-plugins</code> group are activated
regardless of the <code>--safe</code> mode setting. Be aware of what
gems are included under this group!
</p>
</div>

View File

@ -0,0 +1,72 @@
---
title: Tags
permalink: /docs/plugins/tags/
---
If youd like to include custom liquid tags in your site, you can do so by
hooking into the tagging system. Built-in examples added by Jekyll include the
`highlight` and `include` tags. Below is an example of a custom liquid tag that
will output the time the page was rendered:
```ruby
module Jekyll
class RenderTimeTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text
end
def render(context)
"#{@text} #{Time.now}"
end
end
end
Liquid::Template.register_tag('render_time', Jekyll::RenderTimeTag)
```
At a minimum, liquid tags must implement:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>render</code></p>
</td>
<td>
<p>Outputs the content of the tag.</p>
</td>
</tr>
</tbody>
</table>
</div>
You must also register the custom tag with the Liquid template engine as
follows:
```ruby
Liquid::Template.register_tag('render_time', Jekyll::RenderTimeTag)
```
In the example above, we can place the following tag anywhere in one of our
pages:
{% raw %}
```ruby
<p>{% render_time page rendered at: %}</p>
```
{% endraw %}
And we would get something like this on the page:
```html
<p>page rendered at: Tue June 22 23:38:47 0500 2010</p>
```

View File

@ -0,0 +1,137 @@
---
title: Your first plugin
permalink: /docs/plugins/your-first-plugin/
---
Plugins allow you to extend Jekyll's behavior to fit your needs. There are six
types of plugins in Jekyll.
## Generators
[Generators](/docs/plugins/generators/) create content on your site.
For example:
* [jekyll-feed](https://github.com/jekyll/jekyll-feed) creates an Atom feed of
blog posts.
* [jekyll-archives](https://github.com/jekyll/jekyll-archives) creates archive
pages for blog categories and tags.
* [jekyll-sitemap](https://github.com/jekyll/jekyll-sitemap) creates a sitemap.
## Converters
[Converters](/docs/plugins/converters/) change a markup language into another
format. For example:
* [jekyll-textile-converter](https://github.com/jekyll/jekyll-textile-converter)
converts textile to HTML.
* [jekyll-coffeescript](https://github.com/jekyll/jekyll-coffeescript) converts
Coffeescript to JavaScript.
* [jekyll-opal](https://github.com/jekyll/jekyll-opal) converts Ruby to
JavaScript.
## Commands
[Commands](/docs/plugins/commands/) extend the `jekyll` executable with
subcommands. For example:
* [jekyll-compose](https://github.com/jekyll/jekyll-compose) adds subcommands
for creating a post, page or draft.
## Tags
[Tags](/docs/plugins/tags/) create custom Liquid tags. For example:
* [jekyll-youtube](https://github.com/dommmel/jekyll-youtube) embeds a YouTube
video.
* [jekyll-asset-path-plugin](https://github.com/samrayner/jekyll-asset-path-plugin)
outputs a relative URL for assets.
* [jekyll-swfobject](https://github.com/sectore/jekyll-swfobject) embeds a SWF
object.
## Filters
[Filters](/docs/plugins/filters/) create custom Liquid filters. For example:
* [jekyll-time-ago](https://github.com/markets/jekyll-timeago) - The distance
between two dates in words.
* [jekyll-toc](https://github.com/toshimaru/jekyll-toc) - Generates a table of
content.
* [jekyll-email-protect](https://github.com/vwochnik/jekyll-email-protect) -
Obfuscates emails to protect them from spam bots.
## Hooks
[Hooks](/docs/plugins/hooks/) give fine-grained control to extend the build
process.
## Flags
There are two flags to be aware of when writing a plugin:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Flag</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>safe</code></p>
</td>
<td>
<p>
A boolean flag that informs Jekyll whether this plugin may be safely
executed in an environment where arbitrary code execution is not
allowed. This is used by GitHub Pages to determine which core plugins
may be used, and which are unsafe to run. If your plugin does not
allow for arbitrary code execution, set this to <code>true</code>.
GitHub Pages still wont load your plugin, but if you submit it for
inclusion in core, its best for this to be correct!
</p>
</td>
</tr>
<tr>
<td>
<p><code>priority</code></p>
</td>
<td>
<p>
This flag determines what order the plugin is loaded in. Valid values
are: <code>:lowest</code>, <code>:low</code>, <code>:normal</code>,
<code>:high</code>, and <code>:highest</code>. Highest priority
matches are applied first, lowest priority are applied last.
</p>
</td>
</tr>
</tbody>
</table>
</div>
To use one of the example plugins above as an illustration, here is how youd
specify these two flags:
```ruby
module Jekyll
class UpcaseConverter < Converter
safe true
priority :low
...
end
end
```
## Best Practices
The guides help you with the specifics of creating plugins. We also have some
recommended best practices to help structure your plugin.
We recommend using a [gem](/docs/ruby-101/#gems) for your plugin. This will
help you manage dependencies, keep separation from your site source code and
allow you to share functionality across multiple projects. For tips on creating
a gem take a look a the
[Ruby gems guide](https://guides.rubygems.org/make-your-own-gem/) or look
through the source code of an existing plugin such as
[jekyll-feed](https://github.com/jekyll/jekyll-feed).

View File

@ -1,30 +1,21 @@
--- ---
title: Writing posts title: Posts
permalink: /docs/posts/ permalink: /docs/posts/
--- ---
One of Jekylls best aspects is that it is “blog aware”. What does this mean, Blogging is baked into Jekyll. You write blog posts as text files and Jekyll
exactly? Well, simply put, it means that blogging is baked into Jekylls provides everything you need to turn it into a blog.
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 ## The Posts Folder
As explained on the [directory structure](../structure/) page, the `_posts` The `_posts` folder is where your blog posts live. You typically write posts
folder is where your blog posts will live. These files are generally in [Markdown](https://daringfireball.net/projects/markdown/), however HTML is
[Markdown](https://daringfireball.net/projects/markdown/) or HTML, but can also supported.
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 ## Creating Posts
To create a new post, all you need to do is create a file in the `_posts` To create a post, add a file to your `_posts` directory with the following
directory. How you name files in this folder is important. Jekyll requires blog format:
post files to be named according to the following format:
``` ```
YEAR-MONTH-DAY-title.MARKUP YEAR-MONTH-DAY-title.MARKUP
@ -39,25 +30,33 @@ file. For example, the following are examples of valid post filenames:
2012-09-12-how-to-write-a-blog.md 2012-09-12-how-to-write-a-blog.md
``` ```
All blog post files must begin with [front matter](/docs/front-matter/) which is
typically used to set a [layout](/docs/layouts/) or other meta data. For a simple
example this can just be empty:
```markdown
---
layout: post
title: "Welcome to Jekyll!"
---
# Welcome
**Hello world**, this is my first Jekyll blog post.
I hope you like it!
```
<div class="note"> <div class="note">
<h5>ProTip™: Link to other posts</h5> <h5>ProTip™: Link to other posts</h5>
<p> <p>
Use the <a href="../templates/#linking-to-posts"><code>post_url</code></a> Use the <a href="/docs/liquid/tags/#linking-to-posts"><code>post_url</code></a>
tag to link to other posts without having to worry about the URLs tag to link to other posts without having to worry about the URLs
breaking when the site permalink style changes. breaking when the site permalink style changes.
</p> </p>
</div> </div>
### 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.
<div class="note info"> <div class="note info">
<h5>Be aware of character sets</h5> <h5>Be aware of character sets</h5>
@ -73,66 +72,31 @@ decide which one best suits your needs.
## Including images and resources ## Including images and resources
Chances are, at some point, you'll want to include images, downloads, or other 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 digital assets along with your text content. One common solution is to create
these resources differs between Markdown and Textile, the problem of working a folder in the root of the project directory called something like `assets`,
out where to store these files in your site is something everyone will face. into which any images, files or other resources are placed. Then, from within
any post, they can be linked to using the sites root as the path for the asset
There are a number of ways to include digital assets in Jekyll. to include. The best way to do this depends on the way your sites (sub)domain
One common solution is to create a folder in the root of the project directory and path are configured, but here are some simple examples in Markdown:
called something like `assets`, into which any images, files
or other resources are placed. Then, from within any post, they can be linked
to using the sites root as the path for the asset to include. Again, this will
depend on the way your sites (sub)domain and path are configured, but here are
some examples in Markdown of how you could do this using the `absolute_url`
filter in a post.
Including an image asset in a post: Including an image asset in a post:
{% raw %}
```markdown ```markdown
... which is shown in the screenshot below: ... which is shown in the screenshot below:
![My helpful screenshot]({{ "/assets/screenshot.jpg" | absolute_url }}) ![My helpful screenshot]("/assets/screenshot.jpg")
``` ```
{% endraw %}
Linking to a PDF for readers to download: Linking to a PDF for readers to download:
{% raw %}
```markdown ```markdown
... you can [get the PDF]({{ "/assets/mydoc.pdf" | absolute_url }}) directly. ... you can [get the PDF]("/assets/mydoc.pdf") directly.
``` ```
{% endraw %}
<div class="info">
</div>
## 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 a Title, Layout, Publishing Date, and Categories might look like this:
```markdown
---
layout: post
title: "Welcome to Jekyll!"
date: 2015-11-17 16:16:01 -0600
categories: jekyll update
---
Youll 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 ## Displaying an index of posts
Its all well and good to have posts in a folder, but a blog is no use unless Creating an index of posts on another page is easy thanks to
you have a list of posts somewhere. Creating an index of posts on another page [Liquid](https://docs.shopify.com/themes/liquid/basics) and its tags. Heres a
(or in a [template](../templates/)) is easy, thanks to the [Liquid template
language](https://docs.shopify.com/themes/liquid/basics) and its tags. Heres a
basic example of how to create a list of links to your blog posts: basic example of how to create a list of links to your blog posts:
{% raw %} {% raw %}
@ -147,95 +111,72 @@ basic example of how to create a list of links to your blog posts:
``` ```
{% endraw %} {% endraw %}
Of course, you have full control over how (and where) you display your posts, 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 and how you structure your site. You should read more about [how templates
work](../templates/) with Jekyll if you want to know more. work](/docs/templates/) with Jekyll if you want to know more.
Note that the `post` variable only exists inside the `for` loop above. If 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 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` variables of the post/page that has the `for` loop in it), use the `page`
variable instead. variable instead.
## Displaying post categories or tags ## Categories and Tags
Hey, that's pretty neat, but what about showing just some of your posts that are Jekyll has first class support for categories and tags in blog posts. The difference
related to each other? For that you can use any of the [variables definable in between categories and tags is a category can be part of the URL for a post
Front Matter](https://jekyllrb.com/docs/frontmatter/). In the "typical post" whereas a tag cannot.
section you can see how to define categories. Simply add the categories to your
Front Matter as a [yaml
list](https://en.wikipedia.org/wiki/YAML#Basic_components).
Now that your posts have a category or multiple categories, you can make a page To use these, first set your categories and tags in front matter:
or a template displaying just the posts in those categories you specify. Here's
a basic example of how to create a list of posts from a specific category.
First, in the `_layouts` directory create a new file called `category.html` - in ```yaml
that file put (at least) the following: ---
layout: post
title: A Trip
categories: [blog, travel]
tags: [hot, summer]
---
```
Jekyll makes the categories available to us at `site.categories`. Iterating over
`site.categories` on a page gives as another array with two items, the first
item is the name of the category and the second item is an array of posts in that
category.
{% raw %} {% raw %}
```liquid ```liquid
--- {% for category in site.categories %}
layout: page <h3>{{ category[0] }}</h3>
--- <ul>
{% for post in category[1] %}
{% for post in site.categories[page.category] %} <li><a href="{{ post.url }}">{{ post.title }}</a></li>
<a href="{{ post.url | absolute_url }}"> {% endfor %}
{{ post.title }} </ul>
</a>
{% endfor %} {% endfor %}
``` ```
{% endraw %} {% endraw %}
Next, in the root directory of your Jekyll install, create a new directory For tags it's exactly the same except the variable is `site.tags`.
called `category` and then create a file for each category you want to list. For
example, if you have a category `blog` then create a file in the new directory
called `blog.html` with at least
```yaml
---
layout: category
title: Blog
category: blog
---
```
In this case, the listing pages will be accessible at `{baseurl}/category/blog.html`
Although categories and tags are very similar, they are used to group posts,
there are a few differences between them. Categories and sub-categories create
hierarchies that, by default, are reflected in the directory structure of your
site. A post with the following header
```yaml
---
layout: post
title: A Trip
category: [ blog, travel ]
---
```
will be accessible at `{baseurl}/blog/travel/year/month/day/A-Trip.html`. On
the other hand, a tagged post
```yaml
---
layout: post
title: A Trip
tags: [ blog, travel ]
---
```
will be saved as `{baseurl}/year/month/day/A-Trip.html`. It is up to you to
create `{baseurl}/tag/blog.html` and `{baseurl}/tag/travel.html` the same way as
described above for categories.
While this example is done with tags and categories, you can easily extend your
lists to filter by any other variable created with extensions.
## Post excerpts ## Post excerpts
Each post automatically takes the first block of text, from the beginning of You can access a snippet of a posts's content by using `excerpt` variable on a
the content to the first occurrence of `excerpt_separator`, and sets it in the post. By default this is the first paragraph of content in the post however it
post's data hash. can be customized by setting a `excerpt_separator` variable in front matter or
Take the above example of an index of posts. Perhaps you want to include `_config.yml`.
a little hint about the post's content by adding the first paragraph of each of
your posts: ```yaml
---
excerpt_separator: <!--more-->
---
Excerpt with multiple paragraphs
Here's another paragraph in the excerpt.
<!--more-->
Out-of-excerpt
```
Here's an example of outputting a list of blog posts with an excerpt:
{% raw %} {% raw %}
```liquid ```liquid
@ -250,85 +191,18 @@ your posts:
``` ```
{% endraw %} {% endraw %}
Because Jekyll grabs the first paragraph you will not need to wrap the excerpt ## Drafts
in `p` tags, which is already done for you. These tags can be removed with the
following if you'd prefer:
{% raw %} Drafts are posts without a date in the filename. They're posts you're still
```liquid working on and don't want to publish yet. To get up and running with drafts,
{{ post.excerpt | remove: '<p>' | remove: '</p>' }} create a `_drafts` folder in your site's root and create your first draft:
```
{% endraw %}
If you don't like the automatically-generated post excerpt, it can be ```text
explicitly overridden by adding an `excerpt` value to your post's YAML |-- _drafts/
Front Matter. Alternatively, you can choose to define a custom | |-- a-draft-post.md
`excerpt_separator` in the post's YAML front matter:
```yaml
---
excerpt_separator: <!--more-->
---
Excerpt
<!--more-->
Out-of-excerpt
``` ```
You can also set the `excerpt_separator` globally in your `_config.yml` To preview your site with drafts, simply run `jekyll serve` or `jekyll build`
configuration file. with the `--drafts` switch. Each will be assigned the value modification time
of the draft file for its date, and thus you will see currently edited drafts
Completely disable excerpts by setting your `excerpt_separator` to `""`. as the latest posts.
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:
{% raw %}
```liquid
{% highlight ruby %}
def show
@widget = Widget(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @widget }
end
end
{% 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
```
<div class="note">
<h5>ProTip™: Show line numbers</h5>
<p>
You can make code snippets include line-numbers by adding the word
<code>linenos</code> to the end of the opening highlight tag like this:
<code>{% raw %}{% highlight ruby linenos %}{% endraw %}</code>.
</p>
</div>
These basics should be enough to get you started writing your first posts. When
youre 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.

View File

@ -1,53 +0,0 @@
---
title: Quick-start guide
permalink: /docs/quickstart/
---
If you already have a full [Ruby](https://www.ruby-lang.org/en/downloads/) development environment with all headers 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
bundle exec jekyll serve
# Now browse to http://localhost:4000
```
If you encounter any unexpected errors during the above, please refer to the [troubleshooting](/docs/troubleshooting/#configuration-problems) page or the already-mentioned [requirements](/docs/installation/#requirements) page, as you might be missing development headers or other prerequisites.
## About Bundler
`gem install bundler` installs the [bundler](https://rubygems.org/gems/bundler) gem through [RubyGems](https://rubygems.org/). You only need to install it once &mdash; 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 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.
For more information about how to use Bundler in your Jekyll project, this [tutorial](https://jekyllrb.com/tutorials/using-jekyll-with-bundler/) should provide answers to the most common questions and explain how to get up and running quickly.
## Options for creating a new site with Jekyll
`jekyll new <PATH>` 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.
* We recommend setting up Jekyll with a gem-based theme but if you want to start with a blank slate, use `jekyll new myblog --blank`
* To learn about other parameters you can include with `jekyll new`, type `jekyll new --help`.
When in doubt, use the <code>help</code> command to remind you of all available options and usage, it also works with the <code>new</code>, <code>build</code> and <code>serve</code> subcommands, e.g. <code>jekyll help new</code> or <code>jekyll help build</code>.
{: .note .info }
## Next steps
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.

View File

@ -56,7 +56,5 @@ Jekyll's growing use is producing a wide variety of tutorials, frameworks, exten
> "Jekyll is everything that I ever wanted in a blogging engine. Really. It isn't perfect, but what's excellent about it is that if there's something wrong, I know exactly how it works and how to fix it. It runs on the your machine only, and is essentially an added"build" step between you and the browser. I coded this entire site in TextMate using standard HTML5 and CSS3, and then at the end I added just a few little variables to the markup. Presto-chango, my site is built and I am at peace with the world." > "Jekyll is everything that I ever wanted in a blogging engine. Really. It isn't perfect, but what's excellent about it is that if there's something wrong, I know exactly how it works and how to fix it. It runs on the your machine only, and is essentially an added"build" step between you and the browser. I coded this entire site in TextMate using standard HTML5 and CSS3, and then at the end I added just a few little variables to the markup. Presto-chango, my site is built and I am at peace with the world."
- [Generating a Tag Cloud in Jekyll](http://www.justkez.com/generating-a-tag-cloud-in-jekyll/) A guide to implementing a tag cloud and per-tag content pages using Jekyll.
- A way to [extend Jekyll](https://github.com/rfelix/jekyll_ext) without forking and modifying the Jekyll gem codebase and some [portable Jekyll extensions](https://wiki.github.com/rfelix/jekyll_ext/extensions) that can be reused and shared. - A way to [extend Jekyll](https://github.com/rfelix/jekyll_ext) without forking and modifying the Jekyll gem codebase and some [portable Jekyll extensions](https://wiki.github.com/rfelix/jekyll_ext/extensions) that can be reused and shared.
- [Using your Rails layouts in Jekyll](http://numbers.brighterplanet.com/2010/08/09/sharing-rails-views-with-jekyll) - [Using your Rails layouts in Jekyll](http://numbers.brighterplanet.com/2010/08/09/sharing-rails-views-with-jekyll)

45
docs/_docs/ruby-101.md Normal file
View File

@ -0,0 +1,45 @@
---
title: Ruby 101
permalink: /docs/ruby-101/
---
Jekyll is written in Ruby. If you're new to Ruby, this page is to help you get
up to speed with some of the terminology.
## Gems
A gem is code you can include in Ruby projects. It allows you to package up functionality and share it across other projects or with other people. Gems can perform functionality such as:
* Converting a Ruby object to JSON
* Pagination
* Interacting with APIs such as Github
* Jekyll itself is a gem as well as many Jekyll plugins including
[jekyll-feed](https://github.com/jekyll/jekyll-feed),
[jekyll-seo-tag](https://github.com/jekyll/jekyll-seo-tag) and
[jekyll-archives](https://github.com/jekyll/jekyll-archives).
## Gemfile
A `Gemfile` is a list of gems required for your site. For a simple Jekyll site it might look something like this:
```ruby
source 'https://rubygems.org'
gem 'jekyll'
group :jekyll_plugins do
gem 'jekyll-feed'
gem 'jekyll-seo-tag'
end
```
## Bundler
Bundler installs the gems in your `Gemfile`. It's not a requirement for you to use a `Gemfile` and `bundler` however it's highly recommended as it ensures you're running the same version of Jekyll and Jekyll plugins across different environments.
`gem install bundler` installs [Bundler](https://rubygems.org/gems/bundler). You only need to install it once &mdash; not every time you create a new Jekyll project. Here are some additional details:
If you're using a `Gemfile` you would first run `bundle install` to install the gems, then `bundle exec jekyll serve` to build your site. This guarantees you're using the gem versions set in the `Gemfile`. If you're not using a `Gemfile` you can just run `jekyll serve`.
For more information about how to use Bundler in your Jekyll project, this [tutorial](/tutorials/using-jekyll-with-bundler/) should provide answers to the most common questions and explain how to get up and running quickly.

View File

@ -1,22 +0,0 @@
---
title: Sites using Jekyll
permalink: /docs/sites/
---
Its interesting to see what designs and features others have come up
with. Below are some Jekyll-powered blogs which were hand-picked for
learning purposes.
- [Tom Preston-Werner](http://tom.preston-werner.com/)
([source](https://github.com/mojombo/mojombo.github.io))
- [GitHub Official Teaching Materials](https://services.github.com/training/)
([source](https://github.com/github/training-kit))
- [Rasmus Andersson](https://rsms.me/)
([source](https://github.com/rsms/rsms.github.com))
- [MvvmCross](https://mvvmcross.github.io/MvvmCross/)
([source](https://github.com/MvvmCross/MvvmCross/tree/master/docs))
If you would like to explore more examples, you can find a list of sites
and their sources on the ["Sites" page in the Jekyll wiki][jekyll-sites].
[jekyll-sites]: {{ site.repository }}/wiki/Sites

View File

@ -2,11 +2,7 @@
title: Static Files title: Static Files
permalink: /docs/static-files/ permalink: /docs/static-files/
--- ---
A static file is a file that does not contain any front matter. These
In addition to renderable and convertible content, we also have **static
files**.
A static file is a file that does not contain any YAML front matter. These
include images, PDFs, and other un-rendered content. include images, PDFs, and other un-rendered content.
They're accessible in Liquid via `site.static_files` and contain the They're accessible in Liquid via `site.static_files` and contain the
@ -70,7 +66,7 @@ Note that in the above table, `file` can be anything. It's simply an arbitrarily
## Add front matter to static files ## Add front matter to static files
Although you can't directly add front matter values to static files, you can set front matter values through the [defaults property](../configuration/#front-matter-defaults) in your configuration file. When Jekyll builds the site, it will use the front matter values you set. Although you can't directly add front matter values to static files, you can set front matter values through the [defaults property](/docs/configuration/front-matter-defaults/) in your configuration file. When Jekyll builds the site, it will use the front matter values you set.
Here's an example: Here's an example:

View File

@ -0,0 +1,73 @@
---
layout: step
title: Setup
menu_name: Step by Step Tutorial
position: 1
---
Welcome to Jekyll's step-by-step tutorial. The goal of this tutorial is to take
you from having some front end web development experience to building your
first Jekyll site. Let's get into it!
## Installation
Jekyll is a Ruby program so you need to install Ruby on your machine to begin
with. Head over to the [install guide](/docs/installation/) and follow the
instructions for your operating system.
With Ruby setup you can install Jekyll by running the following in your
terminal:
```
gem install jekyll bundler
```
## Create a site
It's time to create a site! Create a new directory for your site, you can name
it whatever you'd like. Through the rest of this tutorial we'll refer to this
directory as “root”.
If you're feeling adventurous, you can also initialize a Git repository here.
One of the great things about Jekyll is there's no database. All content and
site structure are files which a Git repository can version. Using a repository
is completely optional but it's a great habit to get into. You can learn more
about using Git by reading through the
[Git Handbook](https://guides.github.com/introduction/git-handbook/).
Let's add your first file. Create `index.html` in the root with the following
content:
```html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Home</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
```
## Build
Jekyll is a static site generator so we need Jekyll to build the site
before we can view it. There's two commands you can run in the root of your site
to build it:
* `jekyll build` - Builds the site and outputs a static site to a directory
called `_site`.
* `jekyll serve` - Does the same thing except it rebuilds any time you make
a change and runs a local web server at `http://localhost:4000`.
When you're developing a site you'll use `jekyll serve` as it updates with any
changes you make.
Run `jekyll serve` and go to
<a href="http://localhost:4000" target="_blank" data-proofer-ignore>http://localhost:4000</a> in
your browser. You should see "Hello World!".
Well, you might be thinking what's the point in this? Jekyll just copied an
HTML file from one place to another. Well patience young grasshopper, there's
still much to learn!

View File

@ -0,0 +1,70 @@
---
layout: step
title: Liquid
position: 2
---
Liquid is where Jekyll starts to get more interesting. Liquid is a templating
language which has three main parts: [objects](#objects), [tags](#tags) and
[filters](#filters).
## Objects
Objects tell Liquid where to output content. They're denoted by double curly
braces: {% raw %}`{{`{% endraw %} and {% raw %}`}}`{% endraw %}. For example:
{% raw %}
```liquid
{{ page.title }}
```
{% endraw %}
Outputs a variable called `page.title` on the page.
## Tags
Tags create the logic and control flow for templates. They are denoted by curly
braces and percent signs: {% raw %}`{%`{% endraw %} and
{% raw %}`%}`{% endraw %}. For example:
{% raw %}
```liquid
{% if page.show_sidebar %}
<div class="sidebar">
sidebar content
</div>
{% endif %}
```
{% endraw %}
Outputs the sidebar if `page.show_sidebar` is true. You can learn more about the
tags available to Jekyll [here](/docs/liquid/tags/).
## Filters
Filters change the output of a Liquid object. They are used within an output
and are separated by a `|`. For example:
{% raw %}
```liquid
{{ "hi" | capitalize }}
```
{% endraw %}
Outputs `Hi`. You can learn more about the filters available to Jekyll
[here](/docs/liquid/filters/).
## Use Liquid
Now it's your turn, change the Hello World! on your page to output as lowercase:
{% raw %}
```liquid
...
<h1>{{ "Hello World!" | downcase }}</h1>
...
```
{% endraw %}
It may not seem like it now, but much of Jekyll's power comes from combining
Liquid with other features. Let's keep going.

View File

@ -0,0 +1,49 @@
---
layout: step
title: Front Matter
position: 3
---
Front matter is a snippet of [YAML](http://yaml.org/) which sits between two
triple-dashed lines at the top of a file. Front matter is used to set variables
for the page, for example:
```liquid
---
my_number: 5
---
```
Front matter variables are available in Liquid under the `page` variable. For
example to output the variable above you would use:
{% raw %}
```liquid
{{ page.my_number }}
```
{% endraw %}
## Use front matter
Let's change the `<title>` on your site to populate using front matter:
{% raw %}
```html
---
title: Home
---
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>{{ page.title }}</title>
</head>
<body>
<h1>{{ "Hello World!" | downcase }}</h1>
</body>
</html>
```
{% endraw %}
You may still be wondering why you'd output it this way as it takes
more source code than raw HTML. In this next step, you'll see why we've
been doing this.

View File

@ -0,0 +1,89 @@
---
layout: step
title: Layouts
position: 4
---
Websites typically have more than one page and this website is no different.
Jekyll supports [Markdown](https://daringfireball.net/projects/markdown/syntax)
as well as HTML for pages. Markdown is a great choice for pages with a simple
content structure (just paragraphs, headings and images), as it's less verbose
than raw HTML. Let's try it out on the next page.
Create `about.md` in the root.
For the structure you could copy `index.html` and modify it for the about page.
The problem with doing this is duplicate code. Let's say you wanted to add a
stylesheet to your site, you would have to go to each page and add it to the
`<head>`. It might not sound so bad for a two page site, imagine doing it
for 100 pages. Even simple changes will take a long time to make.
## Creating a layout
Using a layout is a much better choice. Layouts are templates that wrap around
your content. They live in a directory called `_layouts`.
Create your first layout at `_layouts/default.html` with the following content:
{% raw %}
```liquid
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>{{ page.title }}</title>
</head>
<body>
{{ content }}
</body>
</html>
```
{% endraw %}
You'll notice this is almost identical to `index.html` except there's
no front matter and the content of the page is replaced with a `content`
variable. `content` is a special variable which has the value of the rendered
content of the page its called on.
To have `index.html` use this layout, you can set a `layout` variable in front
matter. The layout wraps around the content of the page so all you need in
`index.html` is:
{% raw %}
```html
---
layout: default
title: Home
---
<h1>{{ "Hello World!" | downcase }}</h1>
```
{% endraw %}
After doing this, the output will be exactly the same as before. Note that you
can access the `page` front matter from the layout. In this case `title` is
set in the index page's front matter but is output in the layout.
## About page
Back to the about page, instead of copying from `index.html`, you can use the
layout.
Add the following to `about.md`:
{% raw %}
```html
---
layout: default
title: About
---
# About page
This page tells you a little bit about me.
```
{% endraw %}
Open <a href="http://localhost:4000/about.html" target="_blank" data-proofer-ignore>http://localhost:4000/about.html</a>
in your browser and view your new page.
Congratulations, you now have a two page website! But how do you
navigate from one page to another? Keep reading to find out.

View File

@ -0,0 +1,83 @@
---
layout: step
title: Includes
position: 5
---
The site is coming together however, there's no way to navigate between
pages. Let's fix that.
Navigation should be on every page so adding it to your layout is the correct
place to do this. Instead of adding it directly to the layout, let's use this
as an opportunity to learn about includes.
## Include tag
The `include` tag allows you to include content from another file stored
in an `_includes` folder. Includes are useful for having a single source for
source code that repeats around the site or for improving the readability.
Navigation source code can get complex so sometimes it's nice to move it into an
include.
## Include usage
Create a file for the navigation at `_includes/navigation.html` with the
following content:
```liquid
<nav>
<a href="/">Home</a>
<a href="/about.html">About</a>
</nav>
```
Try using the include tag to add the navigation to `_layouts/default.html`:
{% raw %}
```liquid
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>{{ page.title }}</title>
</head>
<body>
{% include navigation.html %}
{{ content }}
</body>
</html>
```
{% endraw %}
Open <a href="http://localhost:4000" target="_blank" data-proofer-ignore>http://localhost:4000</a>
in your browser and try switching between the pages.
## Current page highlighting
Let's take this a step further and highlight the current page in the navigation.
`_includes/navigation.html` needs to know the URL of the page it's inserted into
so it can add styling. Jekyll has useful [variables](/docs/variables/) available
one of which is `page.url`.
Using `page.url` you can check if each link is the current page and color it red
if true:
{% raw %}
```liquid
<nav>
<a href="/" {% if page.url == "/" %}style="color: red;"{% endif %}>
Home
</a>
<a href="/about.html" {% if page.url == "/about.html" %}style="color: red;"{% endif %}>
About
</a>
</nav>
```
{% endraw %}
Take a look at <a href="http://localhost:4000" target="_blank" data-proofer-ignore>http://localhost:4000</a>
and see your red link for the current page.
There's still a lot of repetition here if you wanted to add a new item to the
navigation or change the highlight color. In the next step we'll address this.

View File

@ -0,0 +1,48 @@
---
layout: step
title: Data Files
position: 6
---
Jekyll supports loading data from YAML, JSON, and CSV files located in a `_data`
directory. Data files are a great way to separate content from source code to
make the site easier to maintain.
In this step you'll store the contents of the navigation in a data file
and then iterate over it in the navigation include.
## Data file usage
[YAML](http://yaml.org/) is a format that's common in the Ruby ecosystem. You'll
use it to store an array of navigation items each with a name and link.
Create a data file for the navigation at `_data/navigation.yml` with the
following:
```yaml
- name: Home
link: /
- name: About
link: /about.html
```
Jekyll makes this data file available to you at `site.data.navigation`. Instead
of outputting each link in `_includes/navigation.html`, now you can iterate over
the data file instead:
{% raw %}
```liquid
<nav>
{% for item in site.data.navigation %}
<a href="{{ item.link }}" {% if page.url == item.link %}style="color: red;"{% endif %}>
{{ item.name }}
</a>
{% endfor %}
</nav>
```
{% endraw %}
The output will be exactly the same. The difference is youve made it easier to
add new navigation items and change the HTML structure.
What good is a site without CSS, JS and images? Lets look at how to handle
assets in Jekyll.

View File

@ -0,0 +1,89 @@
---
layout: step
title: Assets
position: 7
---
Using CSS, JS, images and other assets is straight forward with Jekyll. Place
them in your site folder and theyll copy across to the built site.
Jekyll sites often use this structure to keep assets organized:
```sh
.
├── assets
| ├── css
| ├── images
| └── js
...
```
## Sass
The inline styles used in `_includes/navigation.html` is not a best practice,
let's style the current page with a class instead.
{% raw %}
```liquid
<nav>
{% for item in site.data.navigation %}
<a href="{{ item.link }}" {% if page.url == item.link %}class="current"{% endif %}>{{ item.name }}</a>
{% endfor %}
</nav>
```
{% endraw %}
You could use a standard CSS file for styling, we're going to take it a step
further by using [Sass](https://sass-lang.com/). Sass is a fantastic extension
to CSS baked right into Jekyll.
First create a Sass file at `/assets/css/styles.scss` with the following
content:
{% raw %}
```css
---
---
@import "main";
```
{% endraw %}
The empty front matter at the top tells Jekyll it needs to process the file. The
`@import "main"` tells Sass to look for a file called `main.scss` in the sass
directory (`_sass/` by default).
At this stage you'll just have a main css file. For larger projects, this is a
great way to keep your CSS organized.
Create `_sass/main.scss` with the following content:
```sass
.current {
color: green
}
```
You'll need to reference the stylesheet in your layout.
Open `_layouts/default.html` and add the stylesheet to the `<head>`:
{% raw %}
```liquid
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>{{ page.title }}</title>
<link rel="stylesheet" href="/assets/styles.css">
</head>
<body>
{% include navigation.html %}
{{ content }}
</body>
</html>
```
{% endraw %}
Load up <a href="http://localhost:4000" target="_blank" data-proofer-ignore>http://localhost:4000</a>
and check the active link in the navigation is green.
Next we're looking at one of Jekyll's most popular features, blogging.

View File

@ -0,0 +1,145 @@
---
layout: step
title: Blogging
position: 8
---
You might be wondering how you can have a blog without a database. In true
Jekyll style, blogging is powered by text files and is easy to set up.
## Posts
Blog posts live in a folder called `_posts`. The filename for posts have a
special format: the publish date, then a title, followed by an extension.
Create your first post at `_posts/2018-08-20-bananas.md` with the
following content:
```markdown
---
layout: post
author: jill
---
A banana is an edible fruit botanically a berry produced by several kinds
of large herbaceous flowering plants in the genus Musa.
In some countries, bananas used for cooking may be called "plantains",
distinguishing them from dessert bananas. The fruit is variable in size, color,
and firmness, but is usually elongated and curved, with soft flesh rich in
starch covered with a rind, which may be green, yellow, red, purple, or brown
when ripe.
```
This is like the `about.md` you created before except it has an author and
a different layout. `author` is a custom variable, it's not required and could
have been named something like `creator`.
## Layout
The `post` layout doesn't exist so you'll need to create it at
`_layouts/post.html` with the following content:
{% raw %}
```html
---
layout: default
---
<h1>{{ page.title }}</h1>
<p>{{ page.date | date_to_string }} - {{ page.author }}</p>
{{ content }}
```
{% endraw %}
This is an example of layout inheritance. The post layout outputs the title,
date, author and content body which is wrapped by the default layout.
Also note the `date_to_string` filter, this formats a date into a nicer format.
## List posts
There's currently no way to navigate to the blog post. Typically a blog has a
page which lists all the posts, let's do that next.
Jekyll makes posts available at `site.posts`.
Create `blog.html` with the following content:
{% raw %}
```html
---
layout: default
title: Blog
---
<h1>Latest Posts</h1>
<ul>
{% for post in site.posts %}
<li>
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<p>{{ post.excerpt }}</p>
</li>
{% endfor %}
</ul>
```
{% endraw %}
There's a few things to note with this code:
* `post.url` is automatically set by Jekyll to the output path of the post
* `post.title` is pulled from the post filename and can be overridden by
setting `title` in front matter
* `post.excerpt` is the first paragraph of content by default
You also need a way to navigate to this page through the main navigation. Open
`_data/navigation.yml` and add an entry for the blog page:
```yaml
- name: Home
link: /
- name: About
link: /about.html
- name: Blog
link: /blog.html
```
## More posts
A blog isn't very exciting with a single post. Add a few more:
`_posts/2018-08-21-apples.md`:
```markdown
---
layout: post
author: jill
---
An apple is a sweet, edible fruit produced by an apple tree.
Apple trees are cultivated worldwide, and are the most widely grown species in
the genus Malus. The tree originated in Central Asia, where its wild ancestor,
Malus sieversii, is still found today. Apples have been grown for thousands of
years in Asia and Europe, and were brought to North America by European
colonists.
```
`_posts/2018-08-22-kiwifruit.md`:
```markdown
---
layout: post
author: ted
---
Kiwifruit (often abbreviated as kiwi), or Chinese gooseberry is the edible
berry of several species of woody vines in the genus Actinidia.
The most common cultivar group of kiwifruit is oval, about the size of a large
hen's egg (58 cm (2.03.1 in) in length and 4.55.5 cm (1.82.2 in) in
diameter). It has a fibrous, dull greenish-brown skin and bright green or
golden flesh with rows of tiny, black, edible seeds. The fruit has a soft
texture, with a sweet and unique flavor.
```
Open <a href="http://localhost:4000" target="_blank" data-proofer-ignore>http://localhost:4000</a> and have
a look through your blog posts.
Next we'll focus on creating a page for each post author.

View File

@ -0,0 +1,251 @@
---
layout: step
title: Collections
position: 9
---
Let's look at fleshing out authors so each author has their own page with a
blurb and the posts they've published.
To do this you'll use collections. Collections are similar to posts except the
content doesn't have to be grouped by date.
## Configuration
To set up a collection you need to tell Jekyll about it. Jekyll configuration
happens in a file called `_config.yml` (by default).
Create `_config.yml` in the root with the following:
```yaml
collections:
authors:
```
## Add authors
Documents (the items in a collection) live in a folder in the root of the site
named `_*collection_name*`. In this case, `_authors`.
Create a document for each author:
`_authors/jill.md`:
```markdown
---
short_name: jill
name: Jill Smith
position: Chief Editor
---
Jill is an avid fruit grower based in the south of France.
```
`_authors/ted.md`:
```markdown
---
short_name: ted
name: Ted Doe
position: Writer
---
Ted has been eating fruit since he was baby.
```
## Staff page
Let's add a page which lists all the authors on the site. Jekyll makes the
collection available at `site.authors`.
Create `staff.html` and iterate over `site.authors` to output all the staff:
{% raw %}
```html
---
layout: default
title: Staff
---
<h1>Staff</h1>
<ul>
{% for author in site.authors %}
<li>
<h2>{{ author.name }}</h2>
<h3>{{ author.position }}</h3>
<p>{{ author.content | markdownify }}</p>
</li>
{% endfor %}
</ul>
```
{% endraw %}
Since the content is markdown, you need to run it through the
`markdownify` filter. This happens automatically when outputting using
{% raw %}`{{ content }}`{% endraw %} in a layout.
You also need a way to navigate to this page through the main navigation. Open
`_data/navigation.yml` and add an entry for the staff page:
```yaml
- name: Home
link: /
- name: About
link: /about.html
- name: Blog
link: /blog.html
- name: Staff
link: /staff.html
```
## Output a page
By default, collections do not output a page for documents. In this case we
want each author to have their own page so let's tweak the collection
configuration.
Open `_config.yml` and add `output: true` to the author collection
configuration:
```yaml
collections:
authors:
output: true
```
You can link to the output page using `author.url`.
Add the link to the `staff.html` page:
{% raw %}
```html
---
layout: default
---
<h1>Staff</h1>
<ul>
{% for author in site.authors %}
<li>
<h2><a href="{{ author.url }}">{{ author.name }}</a></h2>
<h3>{{ author.position }}</h3>
<p>{{ author.content | markdownify }}</p>
</li>
{% endfor %}
</ul>
```
{% endraw %}
Just like posts you'll need to create a layout for authors.
Create `_layouts/author.html` with the following content:
{% raw %}
```html
---
layout: default
---
<h1>{{ page.name }}</h1>
<h2>{{ page.position }}</h2>
{{ content }}
```
{% endraw %}
## Front matter defaults
Now you need to configure the author documents to use the `author` layout. You
could do this in the front matter like we have previously but that's getting
repetitive.
What you really want is all posts to automatically have the post
layout, authors to have author and everything else to use the default.
You can achieve this by using [front matter defaults](/docs/configuration/front-matter-defaults/)
in `_config.yml`. You set a scope of what the default applies to, then the
default front matter you'd like.
Add defaults for layouts to your `_config.yml`,
```yaml
collections:
authors:
output: true
defaults:
- scope:
path: ""
type: "authors"
values:
layout: "author"
- scope:
path: ""
type: "posts"
values:
layout: "post"
- scope:
path: ""
values:
layout: "default"
```
Now you can remove layout the front matter of all pages and posts. Note that
any time you update `_config.yml` you'll need to restart Jekyll for the changes
to take affect.
## List author's posts
Let's list the posts an author has published on their page. To do
this you need to match the author `short_name` to the post `author`. You
use this to filter the posts by author.
Iterate over this filtered list in `_layouts/author.html` to output the
author's posts:
{% raw %}
```html
---
layout: default
---
<h1>{{ page.name }}</h1>
<h2>{{ page.position }}</h2>
{{ content }}
<h2>Posts</h2>
<ul>
{% assign filtered_posts = site.posts | where: 'author', page.short_name %}
{% for post in filtered_posts %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
```
{% endraw %}
## Link to authors page
The posts have a reference to the author so let's link it to the author's page.
You can do this using a similar filtering technique in `_layouts/post.html`:
{% raw %}
```html
---
layout: default
---
<h1>{{ page.title }}</h1>
<p>
{{ page.date | date_to_string }}
{% assign author = site.authors | where: 'short_name', page.author | first %}
{% if author %}
- <a href="{{ author.url }}">{{ author.name }}</a>
{% endif %}
</p>
{{ content }}
```
{% endraw %}
Open up <a href="http://localhost:4000" target="_blank" data-proofer-ignore>http://localhost:4000</a> and
have a look at the staff page and the author links on posts to check everything
is linked together correctly.
In the next and final step of this tutorial, we'll add polish to the site and
get it ready for a production deployment.

View File

@ -0,0 +1,140 @@
---
layout: step
title: Deployment
position: 10
---
In this final step we'll get the site ready for production.
## Gemfile
It's good practice to have a [Gemfile](/docs/ruby-101/#gemfile) for your site.
This ensures the version of Jekyll and other gems remains consistent across
different environments.
Create `Gemfile` in the root with the following:
```
source 'https://rubygems.org'
gem 'jekyll'
```
Then run `bundle install` in your terminal. This installs the gems and
creates `Gemfile.lock` which locks the current gem versions for a future
`bundle install`. If you ever want to update your gem versions you can run
`bundle update`.
When using a `Gemfile`, you'll run commands like `jekyll serve` with
`bundle exec` prefixed. So the full command is:
```bash
bundle exec jekyll serve
```
This restricts you Ruby environment to only use gems set in your `Gemfile`.
## Plugins
Jekyll plugins allow you to create custom generated content specific to your
site. There's many [plugins](/docs/plugins/) available or you can even
write your own.
There's three official plugins which are useful on almost any Jekyll site:
* [jekyll-sitemap](https://github.com/jekyll/jekyll-sitemap) - Creates a sitemap
file to help search engines index content
* [jekyll-feed](https://github.com/jekyll/jekyll-feed) - Creates an RSS feed for
your posts
* [jekyll-seo-tag](https://github.com/jekyll/jekyll-seo-tag) - Adds meta tags to help
with SEO
To use these first you need to add them to your `Gemfile`. If you put them
in a `jekyll_plugins` group they'll automatically be required into Jekyll:
```
source 'https://rubygems.org'
gem 'jekyll'
group :jekyll_plugins do
gem 'jekyll-sitemap'
gem 'jekyll-feed'
gem 'jekyll-seo-tag'
end
```
Now install them by running a `bundle update`.
`jekyll-sitemap` doesn't need any setup, it will create your sitemap on build.
For `jekyll-feed` and `jekyll-seo-tag` you need to add tags to
`_layouts/default.html`:
{% raw %}
```liquid
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>{{ page.title }}</title>
<link rel="stylesheet" href="/assets/styles.css">
{% feed_meta %}
{% seo %}
</head>
<body>
{% include navigation.html %}
{{ content }}
</body>
</html>
```
{% endraw %}
Restart your Jekyll server and check these tags are added to the `<head>`.
## Environments
Sometimes you might want to output something in production but not
in development. Analytics scripts are the most common example of this.
To do this you can use [environments](/docs/configuration/environments/). You
can set the environment by using the `JEKYLL_ENV` environment variable when
running a command. For example:
```bash
JEKYLL_ENV=production bundle exec jekyll build
```
By default `JEKYLL_ENV` is development. The `JEKYLL_ENV` is available to you
in liquid using `jekyll.environment`. So to only output the analytics script
on production you would do the following:
{% raw %}
```liquid
{% if jekyll.environment == "production" %}
<script src="my-analytics-script.js"></script>
{% endif %}
```
{% endraw %}
## Deployment
The final step is to get the site onto a production server. The most basic way
to do this is to run a production build:
```bash
JEKYLL_ENV=production bundle exec jekyll build
```
And copy the contents of `_site` to your server.
A better way is to automate this process using a [CI](/docs/deployment/automated/)
or [3rd party](/docs/deployment/third-party/).
## Wrap up
That brings us to the end of this step-by-step tutorial and the beginning of
your Jekyll journey!
* Come say hi to the [community forums](https://talk.jekyllrb.com)
* Help us make Jekyll better by [contributing](/docs/contributing/)
* Keep building Jekyll sites!

View File

@ -1,17 +1,7 @@
--- ---
title: Directory structure title: Directory Structure
permalink: /docs/structure/ permalink: /docs/structure/
--- ---
Jekyll is, at its core, a text transformation engine. The concept behind the
system is this: you give it text written in your favorite markup language, be
that Markdown, [Textile](https://github.com/jekyll/jekyll-textile-converter)
, or just plain HTML, and it churns that through a layout
or a series of layout files. Throughout that process you can tweak how you want
the site URLs to look, what data gets displayed in the layout, and more. This
is all done through editing text files; the static web site is the final
product.
A basic Jekyll site usually looks something like this: A basic Jekyll site usually looks something like this:
```sh ```sh
@ -36,13 +26,13 @@ A basic Jekyll site usually looks something like this:
| └── _layout.scss | └── _layout.scss
├── _site ├── _site
├── .jekyll-metadata ├── .jekyll-metadata
└── index.html # can also be an 'index.md' with valid YAML Frontmatter └── index.html # can also be an 'index.md' with valid front matter
``` ```
<div class="note info"> <div class="note info">
<h5>Directory structure of Jekyll sites using gem-based themes</h5> <h5>Directory structure of Jekyll sites using gem-based themes</h5>
<p> <p>
Starting <strong>Jekyll 3.2</strong>, a new Jekyll project bootstrapped with <code>jekyll new</code> uses <a href="../themes/">gem-based themes</a> to define the look of the site. This results in a lighter default directory structure : <code>_layouts</code>, <code>_includes</code> and <code>_sass</code> are stored in the theme-gem, by default. Starting <strong>Jekyll 3.2</strong>, a new Jekyll project bootstrapped with <code>jekyll new</code> uses <a href="/docs/themes/">gem-based themes</a> to define the look of the site. This results in a lighter default directory structure : <code>_layouts</code>, <code>_includes</code> and <code>_sass</code> are stored in the theme-gem, by default.
</p> </p>
<br /> <br />
<p> <p>
@ -67,7 +57,7 @@ An overview of what each of these does:
</td> </td>
<td> <td>
<p> <p>
Stores <a href="../configuration/">configuration</a> data. Many of Stores <a href="/docs/configuration/">configuration</a> data. Many of
these options can be specified from the command line executable but these options can be specified from the command line executable but
its easier to specify them here so you dont have to remember them. its easier to specify them here so you dont have to remember them.
</p> </p>
@ -80,7 +70,7 @@ An overview of what each of these does:
<td> <td>
<p> <p>
Drafts are unpublished posts. The format of these files is without a Drafts are unpublished posts. The format of these files is without a
date: <code>title.MARKUP</code>. Learn how to <a href="../drafts/"> date: <code>title.MARKUP</code>. Learn how to <a href="/docs/posts/#drafts">
work with drafts</a>. work with drafts</a>.
</p> </p>
</td> </td>
@ -107,7 +97,7 @@ An overview of what each of these does:
<p> <p>
These are the templates that wrap posts. Layouts are chosen on a These are the templates that wrap posts. Layouts are chosen on a
post-by-post basis in the post-by-post basis in the
<a href="../frontmatter/">YAML Front Matter</a>, <a href="/docs/front-matter/">front matter</a>,
which is described in the next section. The liquid tag which is described in the next section. The liquid tag
<code>{% raw %}{{ content }}{% endraw %}</code> <code>{% raw %}{{ content }}{% endraw %}</code>
is used to inject content into the web page. is used to inject content into the web page.
@ -123,7 +113,7 @@ An overview of what each of these does:
Your dynamic content, so to speak. The naming convention of these Your dynamic content, so to speak. The naming convention of these
files is important, and must follow the format: files is important, and must follow the format:
<code>YEAR-MONTH-DAY-title.MARKUP</code>. <code>YEAR-MONTH-DAY-title.MARKUP</code>.
The <a href="../permalinks/">permalinks</a> can be customized for The <a href="/docs/permalinks/">permalinks</a> can be customized for
each post, but the date and markup language are determined solely by each post, but the date and markup language are determined solely by
the file name. the file name.
</p> </p>
@ -190,8 +180,8 @@ An overview of what each of these does:
</td> </td>
<td> <td>
<p> <p>
Provided that the file has a <a href="../frontmatter/">YAML Front Provided that the file has a <a href="/docs/front-matter/">front
Matter</a> section, it will be transformed by Jekyll. The same will matter</a> section, it will be transformed by Jekyll. The same will
happen for any <code>.html</code>, <code>.markdown</code>, happen for any <code>.html</code>, <code>.markdown</code>,
<code>.md</code>, or <code>.textile</code> file in your sites root <code>.md</code>, or <code>.textile</code> file in your sites root
directory or directories not listed above. directory or directories not listed above.
@ -207,7 +197,7 @@ An overview of what each of these does:
Every other directory and file except for those listed above—such as Every other directory and file except for those listed above—such as
<code>css</code> and <code>images</code> folders, <code>css</code> and <code>images</code> folders,
<code>favicon.ico</code> files, and so forth—will be copied verbatim <code>favicon.ico</code> files, and so forth—will be copied verbatim
to the generated site. There are plenty of <a href="../sites/">sites to the generated site. There are plenty of <a href="/showcase/">sites
already using Jekyll</a> if youre curious to see how theyre laid already using Jekyll</a> if youre curious to see how theyre laid
out. out.
</p> </p>

View File

@ -15,10 +15,3 @@ If you're looking for support for Jekyll, there are a lot of options:
* Chat with Jekyllers &mdash; Join [our Gitter channel](https://gitter.im/jekyll/jekyll) or [our IRC channel on Freenode](irc:irc.freenode.net/jekyll) * Chat with Jekyllers &mdash; Join [our Gitter channel](https://gitter.im/jekyll/jekyll) or [our IRC channel on Freenode](irc:irc.freenode.net/jekyll)
There are a bunch of helpful community members on these services that should be willing to point you in the right direction. There are a bunch of helpful community members on these services that should be willing to point you in the right direction.
## Report a bug
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository &mdash; First [look for the plugin on rubygems](https://rubygems.org/) then click on the `Homepage` link to access the plugin repository.
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new).
Happy Jekyllin'!

View File

@ -7,7 +7,7 @@ Jekyll has an extensive theme system that allows you to leverage community-maint
## Understanding gem-based themes ## Understanding gem-based themes
When you [create a new Jekyll site](/docs/quickstart) (by running the `jekyll new <PATH>` command), Jekyll installs a site that uses a gem-based theme called [Minima](https://github.com/jekyll/minima). When you [create a new Jekyll site](/docs/) (by running the `jekyll new <PATH>` command), Jekyll installs a site that uses a gem-based theme called [Minima](https://github.com/jekyll/minima).
With gem-based themes, some of the site's directories (such as the `assets`, `_layouts`, `_includes`, and `_sass` directories) are stored in the theme's gem, hidden from your immediate view. Yet all of the necessary directories will be read and processed during Jekyll's build process. With gem-based themes, some of the site's directories (such as the `assets`, `_layouts`, `_includes`, and `_sass` directories) are stored in the theme's gem, hidden from your immediate view. Yet all of the necessary directories will be read and processed during Jekyll's build process.
@ -238,14 +238,14 @@ Add your template files in the corresponding folders. Then complete the `.gemspe
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. 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 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 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 ### Assets
Any file in `/assets` will be copied over to the user's site upon build unless they have a file with the same relative path. You can ship any kind of asset here: SCSS, an image, a webfont, etc. These files behave like pages and static files in Jekyll: Any file in `/assets` will be copied over to the user's site upon build unless they have a file with the same relative path. You can ship any kind of asset here: SCSS, an image, a webfont, etc. These files behave like pages and static files in Jekyll:
- If the file has [YAML front matter](/docs/frontmatter/) at the top, it will be rendered. - If the file has [front matter](/docs/front-matter/) at the top, it will be rendered.
- If the file does not have YAML front matter, it will simply be copied over into the resulting site. - If the file does not have front matter, it will simply be copied over into the resulting site.
This allows theme creators to ship a default `/assets/styles.scss` file which their layouts can depend on as `/assets/styles.css`. This allows theme creators to ship a default `/assets/styles.scss` file which their layouts can depend on as `/assets/styles.css`.

View File

@ -103,12 +103,12 @@ Xcode.app can interfere with the command line tools downloaded above. If
you run into this issue, upgrade Xcode and install the upgraded Command you run into this issue, upgrade Xcode and install the upgraded Command
Line Tools. Line Tools.
### Running Jekyll as Non-Superuser (no sudo!) ### Running Jekyll as Non-Superuser (no sudo!)
{: #no-sudo} {: #no-sudo}
On most flavors of Linux, macOS, and Bash on Ubuntu on Windows, it is On most flavors of Linux, macOS, and Bash on Ubuntu on Windows, it is
possible to run Jekyll as a non-superuser and without having to install possible to run Jekyll as a non-superuser and without having to install
gems to system-wide locations by adding the following lines to the end gems to system-wide locations by adding the following lines to the end
of your `.bashrc` file: of your `.bashrc` file:
``` ```
@ -118,16 +118,16 @@ export GEM_HOME=$HOME/gems
export PATH=$HOME/gems/bin:$PATH export PATH=$HOME/gems/bin:$PATH
``` ```
This tells `gem` to place its gems within the user's home folder, This tells `gem` to place its gems within the user's home folder,
not in a system-wide location, and adds the local `jekyll` command to the not in a system-wide location, and adds the local `jekyll` command to the
user's `PATH` ahead of any system-wide paths. user's `PATH` ahead of any system-wide paths.
This is also useful for many shared webhosting services, where user accounts This is also useful for many shared webhosting services, where user accounts
have only limited privileges. Adding these exports to `.bashrc` before running have only limited privileges. Adding these exports to `.bashrc` before running
`gem install jekyll bundler` allows a complete non-`sudo` install of Jekyll. `gem install jekyll bundler` allows a complete non-`sudo` install of Jekyll.
To activate the new exports, either close and restart Bash, logout and To activate the new exports, either close and restart Bash, logout and
log back into your shell account, or run `. .bashrc` in the log back into your shell account, or run `. .bashrc` in the
currently-running shell. currently-running shell.
If you see the following error when running the `jekyll new` command, If you see the following error when running the `jekyll new` command,
@ -239,7 +239,7 @@ http://localhost:4000/blog
## Configuration problems ## Configuration problems
The order of precedence for conflicting [configuration settings](../configuration/) The order of precedence for conflicting [configuration settings](/docs/configuration/)
is as follows: is as follows:
1. Command-line flags 1. Command-line flags
@ -257,7 +257,7 @@ specified elsewhere.
------------------------------------ ------------------------------------
Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>':
Document 'vendor/bundle/gems/jekyll-3.4.3/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' Document 'vendor/bundle/gems/jekyll-3.4.3/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb'
does not have a valid date in the YAML front matter. does not have a valid date in front matter.
``` ```
Simply adding `vendor/bundle` to the `exclude:` list will solve this problem but will lead to having other sub-directories under `/vendor/` (and also `/node_modules/`, if present) be processed to the destination folder `_site`. Simply adding `vendor/bundle` to the `exclude:` list will solve this problem but will lead to having other sub-directories under `/vendor/` (and also `/node_modules/`, if present) be processed to the destination folder `_site`.
@ -309,7 +309,7 @@ run into these errors, try setting `excerpt_separator: ""` in your
If you run into an issue that a static file can't be found in your If you run into an issue that a static file can't be found in your
production environment during build since v3.2.0 you should set your production environment during build since v3.2.0 you should set your
[environment to `production`](../configuration/#specifying-a-jekyll-environment-at-build-time). [environment to `production`](/docs/configuration/environments/).
The issue is caused by trying to copy a non-existing symlink. The issue is caused by trying to copy a non-existing symlink.
<div class="note"> <div class="note">

View File

@ -82,7 +82,7 @@ generate when running `jekyll build` or `jekyll serve`.
Introducing: `layout`. In Jekyll 2 and below, any metadata in the layout was merged onto Introducing: `layout`. In Jekyll 2 and below, any metadata in the layout was merged onto
the `page` variable in Liquid. This caused a lot of confusion in the way the data was the `page` variable in Liquid. This caused a lot of confusion in the way the data was
merged and some unexpected behaviour. In Jekyll 3, all layout data is accessible via `layout` merged and some unexpected behaviour. In Jekyll 3, all layout data is accessible via `layout`
in Liquid. For example, if your layout has `class: my-layout` in its YAML front matter, in Liquid. For example, if your layout has `class: my-layout` in its front matter,
then the layout can access that via `{% raw %}{{ layout.class }}{% endraw %}`. then the layout can access that via `{% raw %}{{ layout.class }}{% endraw %}`.
### Syntax highlighter changed ### Syntax highlighter changed

View File

@ -1,115 +1,20 @@
--- ---
title: Basic Usage title: Command Line Usage
permalink: /docs/usage/ permalink: /docs/usage/
--- ---
The Jekyll gem makes a `jekyll` executable available to you in your Terminal The Jekyll gem makes a `jekyll` executable available to you in your terminal.
window. You can use this command in a number of ways:
```sh You can use this command in a number of ways:
jekyll build
# => The current folder will be generated into ./_site
jekyll build --destination <destination> * `jekyll new` - Creates a new Jekyll site scaffold
# => The current folder will be generated into <destination> * `jekyll build` or `jekyll b` - Performs a one off build your site to `./_site` (by default)
* `jekyll serve` or `jekyll s` - Builds your site any time a source file changes and serves it locally
* `jekyll doctor` - Outputs any deprecation or configuration issues
* `jekyll new-theme` - Creates a new Jekyll theme scaffold
* `jekyll clean` - Removes the generated site and metadata file
* `jekyll help` - Shows a help message or these commands
jekyll build --source <source> --destination <destination> Typically you'll use `jekyll serve` while developing locally and `jekyll build` when you need to generate the site for production.
# => The <source> folder will be generated into <destination>
jekyll build --watch To change Jekyll's default build behavior have a look through the [configuration options](/docs/configuration/).
# => The current folder will be generated into ./_site,
# watched for changes, and regenerated automatically.
```
## Override default development settings
Default URL is set to `http://localhost:4000` in development environment. {% include docs_version_badge.html version="3.3.0" %}
If you want to build for your production environment:
- Set your production URL in `_config.yml` e.g. `url: https://example.com`.
- Run `JEKYLL_ENV=production bundle exec jekyll build`.
<div class="note info">
<h5>Changes to <code>_config.yml</code> are not included during automatic regeneration.</h5>
<p>
The <code>_config.yml</code> master configuration file contains global configurations
and variable definitions that are read once at execution time. Changes made to <code>_config.yml</code>
during automatic regeneration are not loaded until the next execution.
</p>
<p>
Note <a href="../datafiles">Data Files</a> are included and reloaded during automatic regeneration.
</p>
</div>
<div class="note warning">
<h5>Destination folders are cleaned on site builds</h5>
<p>
The contents of <code>&lt;destination&gt;</code> are automatically
cleaned, by default, when the site is built. Files or folders that are not
created by your site will be removed. Files and folders you wish to retain
in <code>&lt;destination&gt;</code> may be specified within the <code>&lt;keep_files&gt;</code>
configuration directive.
</p>
<p>
Do not use an important location for <code>&lt;destination&gt;</code>;
instead, use it as a staging area and copy files from there to your web server.
</p>
</div>
Jekyll also comes with a built-in development server that will allow you to
preview what the generated site will look like in your browser locally.
```sh
jekyll serve
# => A development server will run at http://localhost:4000/
# Auto-regeneration: enabled. Use `--no-watch` to disable.
jekyll serve --livereload
# LiveReload refreshes your browser after a change.
jekyll serve --incremental
# Incremental will perform a partial build in order to reduce regeneration time.
jekyll serve --detach
# => Same as `jekyll serve` but will detach from the current terminal.
# If you need to kill the server, you can `kill -9 1234` where "1234" is the PID.
# If you cannot find the PID, then do, `ps aux | grep jekyll` and kill the instance.
```
```sh
jekyll serve --no-watch
# => Same as `jekyll serve` but will not watch for changes.
```
These are just a few of the available [configuration options](../configuration/).
Many configuration options can either be specified as flags on the command line,
or alternatively (and more commonly) they can be specified in a `_config.yml`
file at the root of the source directory. Jekyll will automatically use the
options from this file when run. For example, if you place the following lines
in your `_config.yml` file:
```yaml
source: _source
destination: _deploy
```
Then the following two commands will be equivalent:
```sh
jekyll build
jekyll build --source _source --destination _deploy
```
For more about the possible configuration options, see the
[configuration](../configuration/) page.
<div class="note info">
<h5>Call for help</h5>
<p>
The <code>help</code> command is always here to remind you of all available options and usage, and also works with the <code>build</code>, <code>serve</code> and <code>new</code> subcommands, e.g <code>jekyll help new</code> or <code>jekyll help build</code>.
</p>
</div>
If you're interested in browsing these docs on-the-go, install the
`jekyll-docs` gem and run `jekyll docs` in your terminal.

View File

@ -3,11 +3,10 @@ title: Variables
permalink: /docs/variables/ permalink: /docs/variables/
--- ---
Jekyll traverses your site looking for files to process. Any files with [YAML Jekyll traverses your site looking for files to process. Any files with
front matter](../frontmatter/) are subject to processing. For each of these [front matter](/docs/front-matter/) are subject to processing. For each of these
files, Jekyll makes a variety of data available via the [Liquid templating files, Jekyll makes a variety of data available via the [Liquid](/docs/liquid/).
system](https://github.com/Shopify/liquid/wiki). The The following is a reference of the available data.
following is a reference of the available data.
## Global Variables ## Global Variables
@ -33,8 +32,8 @@ following is a reference of the available data.
<td><p><code>page</code></p></td> <td><p><code>page</code></p></td>
<td><p> <td><p>
Page specific information + the <a href="../frontmatter/">YAML front Page specific information + the <a href="/docs/front-matter/">front
matter</a>. Custom variables set via the YAML Front Matter will be matter</a>. Custom variables set via the front matter will be
available here. See below for details. available here. See below for details.
</p></td> </p></td>
@ -43,8 +42,8 @@ following is a reference of the available data.
<td><p><code>layout</code></p></td> <td><p><code>layout</code></p></td>
<td><p> <td><p>
Layout specific information + the <a href="../frontmatter/">YAML front Layout specific information + the <a href="/docs/front-matter/">front
matter</a>. Custom variables set via the YAML Front Matter in matter</a>. Custom variables set via front matter in
layouts will be available here. layouts will be available here.
</p></td> </p></td>
@ -294,7 +293,7 @@ following is a reference of the available data.
directory. For example, a post at directory. For example, a post at
<code>/work/code/_posts/2008-12-24-closures.md</code> would have this <code>/work/code/_posts/2008-12-24-closures.md</code> would have this
field set to <code>['work', 'code']</code>. These can also be specified field set to <code>['work', 'code']</code>. These can also be specified
in the <a href="../frontmatter/">YAML Front Matter</a>. in the <a href="/docs/front-matter/">front matter</a>.
</p></td> </p></td>
</tr> </tr>
@ -303,7 +302,7 @@ following is a reference of the available data.
<td><p> <td><p>
The list of tags to which this post belongs. These can be specified in The list of tags to which this post belongs. These can be specified in
the <a href="../frontmatter/">YAML Front Matter</a>. the <a href="/docs/front-matter/">front matter</a>.
</p></td> </p></td>
</tr> </tr>
@ -313,7 +312,7 @@ following is a reference of the available data.
The path to the raw post or page. Example usage: Linking back to the The path to the raw post or page. Example usage: Linking back to the
page or posts source on GitHub. This can be overridden in the page or posts source on GitHub. This can be overridden in the
<a href="../frontmatter/">YAML Front Matter</a>. <a href="/docs/front-matter/">front matter</a>.
</p></td> </p></td>
</tr> </tr>

View File

@ -1,8 +1,8 @@
<div class="unit one-fifth hide-on-mobiles"> <div class="unit one-fifth hide-on-mobiles">
<aside> <aside>
{% for section in site.data.docs %} {% for section in site.data.docs_nav %}
<h4>{{ section.title }}</h4> <h4>{{ section.title }}</h4>
{% include docs_ul.html items=section.docs %} {% include docs_ul.html items=section.docs %}
{% endfor %} {% endfor %}
</aside> </aside>
</div> </div>

View File

@ -1,7 +1,7 @@
<div class="docs-nav-mobile unit whole show-on-mobiles"> <div class="docs-nav-mobile unit whole show-on-mobiles">
<select onchange="if (this.value) window.location.href=this.value"> <select onchange="if (this.value) window.location.href=this.value">
<option value="">Navigate the docs…</option> <option value="">Navigate the docs…</option>
{% for section in site.data.docs %} {% for section in site.data.docs_nav %}
<optgroup label="{{ section.title }}"> <optgroup label="{{ section.title }}">
{% include docs_option.html items=section.docs %} {% include docs_option.html items=section.docs %}
</optgroup> </optgroup>

View File

@ -1,5 +1,10 @@
{% for item in include.items %} {% for item in include.items %}
{% assign item_url = item | prepend:"/docs/" | append:"/" %} {% assign p = site.documents | where: "url", item.link | first %}
{% assign doc = site.docs | where: "url", item_url | first %} <option value="{{ p.url }}">
<option value="{{ doc.url }}">{{ doc.title }}</option> {% if p.menu_name %}
{{ p.menu_name }}
{% else %}
{{ p.title }}
{% endif %}
</option>
{% endfor %} {% endfor %}

View File

@ -1,7 +1,18 @@
<ul> <ul>
{% for item in include.items %} {% for item in include.items %}
{% assign item_url = item | prepend:"/docs/" | append:"/" %} {% assign p = site.documents | where: "url", item.link | first %}
{% assign p = site.docs | where:"url", item_url | first %} <li class="{% if p.url == '/docs/' %}
<li class="{% if item_url == page.url %}current{% endif %}"><a href="{{ p.url }}">{{ p.title }}</a></li> {% if page.url == '/docs/' %}current{% endif %}
{% endfor %} {% else %}
{% if page.url contains p.url %}current{% endif %}
{% endif %}">
<a href="{{ p.url }}">
{% if p.menu_name %}
{{ p.menu_name }}
{% else %}
{{ p.title }}
{% endif %}
</a>
</li>
{% endfor %}
</ul> </ul>

View File

@ -1,6 +1,7 @@
<footer> <footer>
<div class="grid"> <div class="grid">
<div class="unit one-third center-on-mobiles"> <div class="unit one-third center-on-mobiles">
<p>Jekyll is lovingly maintained by the <a href="/team/">core team</a> of volunteers. </p>
<p>The contents of this website are <br />&copy;&nbsp;{{ site.time | date: '%Y' }} under the terms of the <a href="{{ site.repository }}/blob/master/LICENSE">MIT&nbsp;License</a>.</p> <p>The contents of this website are <br />&copy;&nbsp;{{ site.time | date: '%Y' }} under the terms of the <a href="{{ site.repository }}/blob/master/LICENSE">MIT&nbsp;License</a>.</p>
</div> </div>
<div class="unit two-thirds align-right center-on-mobiles"> <div class="unit two-thirds align-right center-on-mobiles">

View File

@ -1,16 +1,16 @@
<ul> <ul>
<li class="{% if page.overview %}current{% endif %}"> {% for p in site.data.primary_nav %}
<a href="/">Home</a> {% if p.show_on_mobile %}
</li> <li class="
<li class="{% if page.url contains '/docs/' %}current{% endif %}"> {% if p.link == '/' %}
<a href="/docs/home/">Docs</a> {% if page.url == '/' %}current{% endif %}
</li> {% else %}
<li class="{% if page.author %}current{% endif %}"> {% if page.url contains p.link %}current{% endif %}
<a href="/news/">News</a> {% endif %}">
</li> <a href="{{ p.link }}">{{ p.title }}</a>
<li class="{% if page.url contains '/help/' %}current{% endif %}"> </li>
<a href="/help/">Help</a> {% endif %}
</li> {% endfor %}
<li> <li>
<a href="{{ site.repository }}">GitHub</a> <a href="{{ site.repository }}">GitHub</a>
</li> </li>

View File

@ -1,14 +1,12 @@
<ul> <ul>
<li class="{% if page.overview %}current{% endif %}"> {% for p in site.data.primary_nav %}
<a href="/">Home</a> <li class="
</li> {% if p.link == '/' %}
<li class="{% if page.url contains '/docs/' %}current{% endif %}"> {% if page.url == '/' %}current{% endif %}
<a href="/docs/home/">Docs</a> {% else %}
</li> {% if page.url contains p.link %}current{% endif %}
<li class="{% if page.author %}current{% endif %}"> {% endif %}">
<a href="/news/">News</a> <a href="{{ p.link }}">{{ p.title }}</a>
</li>
<li class="{% if page.url contains '/help/' %}current{% endif %}">
<a href="/help/">Help</a>
</li> </li>
{% endfor %}
</ul> </ul>

View File

@ -1,39 +0,0 @@
{% comment %}
Map grabs the doc sections, giving us an array of arrays. Join, flattens all
the items to a comma delimited string. Split turns it into an array again.
{% endcomment %}
{% assign docs = site.data.docs | map: 'docs' | join: ',' | split: ',' %}
{% comment %}
Because this is built for every page, lets find where we are in the ordered
document list by comparing url strings. Then if there's something previous or
next, lets build a link to it.
{% endcomment %}
{% for document in docs %}
{% assign document_url = document | prepend:"/docs/" | append:"/" %}
{% if document_url == page.url %}
<div class="section-nav">
<div class="left align-right">
{% if forloop.first %}
<span class="prev disabled">Back</span>
{% else %}
{% assign previous = forloop.index0 | minus: 1 %}
{% assign previous_page = docs[previous] | prepend:"/docs/" | append:"/" %}
<a href="{{ previous_page }}" class="prev">Back</a>
{% endif %}
</div>
<div class="right align-left">
{% if forloop.last %}
<span class="next disabled">Next</span>
{% else %}
{% assign next = forloop.index0 | plus: 1 %}
{% assign next_page = docs[next] | prepend:"/docs/" | append:"/" %}
<a href="{{ next_page }}" class="next">Next</a>
{% endif %}
</div>
</div>
<div class="clear"></div>
{% break %}
{% endif %}
{% endfor %}

View File

@ -0,0 +1,67 @@
{% assign docs = site.docs | where_exp: "doc", "doc.url contains '/step-by-step/'" %}
{% for tutorial in tutorials %}
{% assign tutorial_url = tutorial | prepend:"/tutorials/" | append:"/" %}
{% if tutorial_url == page.url %}
<div class="section-nav">
<div class="left align-right">
{% if forloop.first %}
<span class="prev disabled">Back</span>
{% else %}
{% assign previous = forloop.index0 | minus: 1 %}
{% assign previous_page = tutorials[previous] | prepend:"/tutorials/" | append:"/" %}
<a href="{{ previous_page }}" class="prev">Back</a>
{% endif %}
</div>
<div class="right align-left">
{% if forloop.last %}
<span class="next disabled">Next</span>
{% else %}
{% assign next = forloop.index0 | plus: 1 %}
{% assign next_page = tutorials[next] | prepend:"/tutorials/" | append:"/" %}
<a href="{{ next_page }}" class="next">Next</a>
{% endif %}
</div>
</div>
<div class="clear"></div>
{% break %}
{% endif %}
{% endfor %}
{% for doc in docs %}
{% if doc.url == page.url %}
<div class="section-nav">
<div class="left align-right">
{% if forloop.first %}
<span class="prev disabled">Back</span>
{% else %}
{% assign previous = forloop.index0 | minus: 1 %}
<a href="{{ docs[previous].url }}" class="prev">Back</a>
{% endif %}
</div>
<div class="right align-left">
{% if forloop.last %}
<span class="next disabled">Next</span>
{% else %}
{% assign next = forloop.index0 | plus: 1 %}
<a href="{{ docs[next].url }}" class="next">Next</a>
{% endif %}
</div>
</div>
<div class="clear"></div>
{% break %}
{% endif %}
{% endfor %}
<ol class="step-nav">
{% for step in docs %}
<li {% if step.url == page.url %}class="current"{% endif %}>
<a href="{{ step.url }}">
{{ step.title }}
</a>
</li>
{% endfor %}
</ol>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Jekyll v{{ jekyll.version }}"> <meta name="generator" content="Jekyll v{{ jekyll.version }}">
{% feed_meta %} {% feed_meta %}
<link rel="alternate" type="application/atom+xml" title="Recent commits to Jekylls master branch" href="{{ site.repository }}/commits/master.atom"> <link rel="alternate" type="application/atom+xml" title="Recent commits to Jekylls master branch" href="{{ site.repository }}/commits/master.atom">
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin data-proofer-ignore>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<link rel="stylesheet" href="/css/screen.css"> <link rel="stylesheet" href="/css/screen.css">

View File

@ -10,11 +10,10 @@ layout: default
<div class="unit four-fifths"> <div class="unit four-fifths">
<article> <article>
<div class="improve right hide-on-mobiles"> <div class="improve right hide-on-mobiles">
<a href="https://github.com/jekyll/jekyll/edit/master/docs/{{ page.path }}"><i class="fa fa-pencil"></i> &nbsp;Improve this page</a> <a data-proofer-ignore href="https://github.com/jekyll/jekyll/edit/master/docs/{{ page.path }}"><i class="fa fa-pencil"></i> &nbsp;Improve this page</a>
</div> </div>
<h1>{{ page.title }}</h1> <h1>{{ page.title }}</h1>
{{ content }} {{ content }}
{% include section_nav.html %}
</article> </article>
</div> </div>

26
docs/_layouts/step.html Normal file
View File

@ -0,0 +1,26 @@
---
layout: default
---
<section class="docs">
<div class="grid">
{% include docs_contents_mobile.html %}
<div class="unit four-fifths">
<article>
<div class="improve right hide-on-mobiles">
<a data-proofer-ignore href="https://github.com/jekyll/jekyll/edit/master/docs/{{ page.path }}"><i class="fa fa-pencil"></i> &nbsp;Improve this page</a>
</div>
<h1>Step by Step Tutorial</h1>
<h2>{{ page.position }}. {{ page.title }}</h2>
{{ content }}
{% include step-index.html %}
</article>
</div>
{% include docs_contents.html %}
<div class="clear"></div>
</div>
</section>

View File

@ -12,9 +12,9 @@ Jam-packed with some [highly-requested features and bugfixes galore][changelog],
1. [Collections](/docs/collections/) - Collections allow you to define an unlimited number of custom document types (beyond just posts and pages) for different types of content you may want to author in Jekyll such as API documentation or a cookbook! 1. [Collections](/docs/collections/) - Collections allow you to define an unlimited number of custom document types (beyond just posts and pages) for different types of content you may want to author in Jekyll such as API documentation or a cookbook!
2. [Brand new site template](https://github.com/jekyll/jekyll/pull/2050#issuecomment-35938016) (thanks [@jglovier][]!) - Getting started with Jekyll just got a lot easier and a lot more beautiful. Just run `jekyll new <path>` and you're good to go. 2. [Brand new site template](https://github.com/jekyll/jekyll/pull/2050#issuecomment-35938016) (thanks [@jglovier][]!) - Getting started with Jekyll just got a lot easier and a lot more beautiful. Just run `jekyll new <path>` and you're good to go.
3. [Native Sass & CoffeeScript support](/docs/assets/) - We love CSS and JavaScript as much as the next guy, but there will always be a special place in our hearts for Sass and CoffeeScript. We now offer native support for these file types &mdash; no more messing around with Rake or Grunt! 3. [Native Sass & CoffeeScript support](/docs/assets/) - We love CSS and JavaScript as much as the next guy, but there will always be a special place in our hearts for Sass and CoffeeScript. We now offer native support for these file types &mdash; no more messing around with Rake or Grunt!
4. [YAML Front Matter defaults](/docs/configuration/#front-matter-defaults) - If you've set `layout: post` more than once in your life, you'll love this new feature: set front matter defaults for a given directory or type. 4. [Front Matter defaults](/docs/configuration/front-matter-defaults/) - If you've set `layout: post` more than once in your life, you'll love this new feature: set front matter defaults for a given directory or type.
5. [Custom markdown processors](/docs/configuration/#custom-markdown-processors) - Always wanted to use your favourite home-grown Markdown converter, but couldn't with Jekyll? Now you can. Simply specify `markdown: MyConverterClass` and you're on your way. 5. [Custom markdown processors](/docs/configuration/markdown/) - Always wanted to use your favourite home-grown Markdown converter, but couldn't with Jekyll? Now you can. Simply specify `markdown: MyConverterClass` and you're on your way.
6. [Addition of `where` and `group_by` Liquid filters](/docs/templates/#filters) - Simplifying your Liquid templates one filter at a time. The `where` filter selects from an array all items within which have a given value for a property. The `group_by` filter groups all items in an array which have the same value for a given property. 6. [Addition of `where` and `group_by` Liquid filters](/docs/liquid/filters/) - Simplifying your Liquid templates one filter at a time. The `where` filter selects from an array all items within which have a given value for a property. The `group_by` filter groups all items in an array which have the same value for a given property.
7. [Switch from Maruku to Kramdown as default markdown converter](https://github.com/jekyll/jekyll/pull/1988) - Maruku is dead. We've replaced it with the converter which has the closest feature parity: Kramdown! 7. [Switch from Maruku to Kramdown as default markdown converter](https://github.com/jekyll/jekyll/pull/1988) - Maruku is dead. We've replaced it with the converter which has the closest feature parity: Kramdown!
Check out our [changelog][] for a complete list of all (200+) changes. Check out our [changelog][] for a complete list of all (200+) changes.

View File

@ -14,5 +14,5 @@ that you could have a sticker honoring your beloved Jekyll.
The StickerMule team says, *"Pine no longer!"* StickerMule has **[discounted the The StickerMule team says, *"Pine no longer!"* StickerMule has **[discounted the
price of Jekyll stickers down to $1 and are offering free (domestic) price of Jekyll stickers down to $1 and are offering free (domestic)
shipping](https://www.stickermule.com/marketplace/825-jekyll-stickers)!** shipping](https://www.stickermule.com/marketplace/825-jekyll-stickers)!**
Go grab one now on the StickerMule marketplace [they'll look Go grab one now on the StickerMule marketplace they'll look
swell on your favourite hardware.](https://twitter.com/parkr/status/430826309707902976/photo/1) swell on your favourite hardware.

View File

@ -14,7 +14,7 @@ fixes. Some of the highlights:
* Pages, Posts, and Drafts can now be converted by multiple converters. * Pages, Posts, and Drafts can now be converted by multiple converters.
* Static files can now be safely included in collections. They'll be placed * Static files can now be safely included in collections. They'll be placed
in a `collection.files` array. `collection.docs` still holds exclusively in a `collection.files` array. `collection.docs` still holds exclusively
content with YAML front matter. content with front matter.
* Sass files can once again be rendered by Liquid. However, neither Sass * Sass files can once again be rendered by Liquid. However, neither Sass
nor CoffeeScript can ever have a layout. Bonus: `scssify` and `sassify` nor CoffeeScript can ever have a layout. Bonus: `scssify` and `sassify`
Liquid filters. Liquid filters.

View File

@ -13,7 +13,7 @@ milestone with a pretty big release. What's changed in 2.5.0? Here are some
highlights: highlights:
* Require plugins in the `:jekyll_plugins` Gemfile group (turned off with an environment variable) * Require plugins in the `:jekyll_plugins` Gemfile group (turned off with an environment variable)
* YAML Front Matter permalinks can now contain placeholders like `:name`. Check out all the placeholders on the [Permalinks docs page](/docs/permalinks/). * Front matter permalinks can now contain placeholders like `:name`. Check out all the placeholders on the [Permalinks docs page](/docs/permalinks/).
* The `jsonify` filter now deep-converts arrays to liquid. * The `jsonify` filter now deep-converts arrays to liquid.
* Shorted `build` and `serve` commands with `b` and `s` aliases, respectively * Shorted `build` and `serve` commands with `b` and `s` aliases, respectively
* WEBrick will now list your directory if it can't find an index file. * WEBrick will now list your directory if it can't find an index file.
@ -28,8 +28,8 @@ about in [the changelog!](/docs/history/)
As always, if you run into issues, please [check the issues]({{ site.repository }}/issues) As always, if you run into issues, please [check the issues]({{ site.repository }}/issues)
and [create an issue if one doesn't exist for the bug you encountered]({{ site.repository }}/issues/new). and [create an issue if one doesn't exist for the bug you encountered]({{ site.repository }}/issues/new).
If you just need some help, the extraordinary [jekyll help team is here for If you just need some help, the extraordinary jekyll help team is here for
you!]({{ site.help_url }}) you!
*When was the [first commit to Jekyll](https://github.com/jekyll/jekyll/commit/d189e05d236769c1e5594af9db4d6eacb86fc16e)? *When was the [first commit to Jekyll](https://github.com/jekyll/jekyll/commit/d189e05d236769c1e5594af9db4d6eacb86fc16e)?
All the way back on October 19, 2008. It features interesting historical All the way back on October 19, 2008. It features interesting historical

Some files were not shown because too many files have changed in this diff Show More