From 805f438f24466825685506350dc73af132b972a4 Mon Sep 17 00:00:00 2001 From: Mike Neumegen Date: Sat, 1 Sep 2018 01:39:57 -0700 Subject: [PATCH] New docs (#7205) Merge pull request 7205 --- History.markdown | 26 +- README.markdown | 4 +- docs/_data/docs.yml | 53 - docs/_data/docs_nav.yml | 36 + docs/_data/jekyllconf-talks.yml | 6 +- docs/_data/primary_nav.yml | 15 + docs/_data/showcase.yml | 222 ++++ docs/_docs/assets.md | 16 +- docs/_docs/collections.md | 298 +----- docs/_docs/community/bug.md | 8 + docs/_docs/community/community.md | 38 + docs/_docs/configuration.md | 841 +--------------- docs/_docs/configuration/default.md | 86 ++ docs/_docs/configuration/environments.md | 43 + .../configuration/front-matter-defaults.md | 152 +++ .../configuration/incremental-regeneration.md | 36 + docs/_docs/configuration/liquid.md | 18 + docs/_docs/configuration/markdown.md | 124 +++ docs/_docs/configuration/options.md | 409 ++++++++ docs/_docs/configuration/webrick.md | 20 + .../continuous-integration/buddyworks.md | 2 - docs/_docs/continuous-integration/circleci.md | 2 +- docs/_docs/continuous-integration/index.md | 10 - docs/_docs/datafiles.md | 12 +- docs/_docs/deployment-methods.md | 220 ---- docs/_docs/deployment.md | 11 + docs/_docs/deployment/automated.md | 63 ++ docs/_docs/deployment/manual.md | 36 + docs/_docs/deployment/third-party.md | 39 + docs/_docs/drafts.md | 19 - docs/_docs/extras.md | 31 - .../_docs/{frontmatter.md => front-matter.md} | 46 +- docs/_docs/github-pages.md | 8 +- docs/_docs/history.md | 30 +- docs/_docs/includes.md | 38 - docs/_docs/index.md | 72 +- docs/_docs/installation.md | 212 +--- docs/_docs/installation/macos.md | 69 ++ docs/_docs/installation/other-linux.md | 11 + docs/_docs/installation/ubuntu.md | 30 + docs/_docs/{ => installation}/windows.md | 41 +- docs/_docs/layouts.md | 131 +++ docs/_docs/liquid.md | 19 + .../_docs/{templates.md => liquid/filters.md} | 175 +--- docs/_docs/liquid/tags.md | 142 +++ .../maintaining/merging-a-pull-request.md | 2 +- docs/_docs/maintaining/triaging-an-issue.md | 2 +- docs/_docs/markdown-101.md | 6 + docs/_docs/migrations.md | 2 +- docs/_docs/pages.md | 67 +- docs/_docs/pagination.md | 65 +- docs/_docs/permalinks.md | 201 ++-- docs/_docs/plugins.md | 951 +----------------- docs/_docs/plugins/commands.md | 62 ++ docs/_docs/plugins/converters.md | 91 ++ docs/_docs/plugins/filters.md | 30 + docs/_docs/plugins/generators.md | 103 ++ docs/_docs/plugins/hooks.md | 244 +++++ docs/_docs/plugins/installation.md | 82 ++ docs/_docs/plugins/tags.md | 72 ++ docs/_docs/plugins/your-first-plugin.md | 137 +++ docs/_docs/posts.md | 304 ++---- docs/_docs/quickstart.md | 53 - docs/_docs/resources.md | 2 - docs/_docs/ruby-101.md | 45 + docs/_docs/sites.md | 22 - docs/_docs/static_files.md | 8 +- docs/_docs/step-by-step/01-setup.md | 73 ++ docs/_docs/step-by-step/02-liquid.md | 70 ++ docs/_docs/step-by-step/03-front-matter.md | 49 + docs/_docs/step-by-step/04-layouts.md | 89 ++ docs/_docs/step-by-step/05-includes.md | 83 ++ docs/_docs/step-by-step/06-data-files.md | 48 + docs/_docs/step-by-step/07-assets.md | 89 ++ docs/_docs/step-by-step/08-blogging.md | 145 +++ docs/_docs/step-by-step/09-collections.md | 251 +++++ docs/_docs/step-by-step/10-deployment.md | 140 +++ docs/_docs/structure.md | 30 +- docs/_docs/support.md | 7 - docs/_docs/themes.md | 8 +- docs/_docs/troubleshooting.md | 20 +- docs/_docs/upgrading/2-to-3.md | 2 +- docs/_docs/usage.md | 119 +-- docs/_docs/variables.md | 23 +- docs/_includes/docs_contents.html | 6 +- docs/_includes/docs_contents_mobile.html | 2 +- docs/_includes/docs_option.html | 11 +- docs/_includes/docs_ul.html | 21 +- docs/_includes/footer.html | 1 + docs/_includes/mobile-nav-items.html | 24 +- docs/_includes/primary-nav-items.html | 22 +- docs/_includes/section_nav.html | 39 - docs/_includes/step-index.html | 67 ++ docs/_includes/top.html | 2 +- docs/_layouts/docs.html | 3 +- docs/_layouts/step.html | 26 + .../2014-05-06-jekyll-turns-2-0-0.markdown | 6 +- ...yll-stickers-1-dollar-stickermule.markdown | 4 +- .../2014-08-10-jekyll-2-3-0-released.markdown | 2 +- ...midlife-crisis-jekyll-turns-2-5-0.markdown | 6 +- ...015-02-26-introducing-jekyll-talk.markdown | 2 +- .../2016-01-24-jekyll-3-1-0-released.markdown | 2 +- docs/_posts/2016-10-06-jekyll-3-3-is-here.md | 2 +- .../2017-01-18-jekyll-3-4-0-released.markdown | 4 +- .../2017-03-09-jekyll-3-4-2-released.markdown | 10 +- .../2017-10-21-jekyll-3-6-2-released.markdown | 2 +- .../2018-01-02-jekyll-3-7-0-released.md | 2 +- .../2018-01-25-jekyll-3-7-2-released.md | 4 +- .../2018-08-01-jekyll-sponsoring.markdown | 2 +- docs/_sass/_style.scss | 42 + .../convert-existing-site-to-jekyll.md | 19 +- docs/_tutorials/custom-404-page.md | 2 +- docs/_tutorials/navigation.md | 26 +- docs/_tutorials/orderofinterpretation.md | 2 +- docs/help/index.md | 62 -- docs/{ => pages}/404.html | 0 docs/{ => pages}/index.html | 1 + .../index.md => pages/jekyllconf.md} | 1 - docs/{news/index.html => pages/news.html} | 0 docs/{ => pages}/philosophy.md | 1 + docs/{ => pages}/redirects/github.html | 0 docs/{ => pages}/redirects/issues.html | 0 .../index.html => pages/releases.html} | 0 docs/pages/resources.md | 80 ++ docs/pages/showcase.html | 40 + docs/{team/index.md => pages/team.md} | 1 + 126 files changed, 4496 insertions(+), 3770 deletions(-) delete mode 100644 docs/_data/docs.yml create mode 100644 docs/_data/docs_nav.yml create mode 100644 docs/_data/primary_nav.yml create mode 100644 docs/_data/showcase.yml create mode 100644 docs/_docs/community/bug.md create mode 100644 docs/_docs/community/community.md create mode 100644 docs/_docs/configuration/default.md create mode 100644 docs/_docs/configuration/environments.md create mode 100644 docs/_docs/configuration/front-matter-defaults.md create mode 100644 docs/_docs/configuration/incremental-regeneration.md create mode 100644 docs/_docs/configuration/liquid.md create mode 100644 docs/_docs/configuration/markdown.md create mode 100644 docs/_docs/configuration/options.md create mode 100644 docs/_docs/configuration/webrick.md delete mode 100644 docs/_docs/continuous-integration/index.md delete mode 100644 docs/_docs/deployment-methods.md create mode 100644 docs/_docs/deployment.md create mode 100644 docs/_docs/deployment/automated.md create mode 100644 docs/_docs/deployment/manual.md create mode 100644 docs/_docs/deployment/third-party.md delete mode 100644 docs/_docs/drafts.md delete mode 100644 docs/_docs/extras.md rename docs/_docs/{frontmatter.md => front-matter.md} (81%) create mode 100644 docs/_docs/installation/macos.md create mode 100644 docs/_docs/installation/other-linux.md create mode 100644 docs/_docs/installation/ubuntu.md rename docs/_docs/{ => installation}/windows.md (73%) create mode 100644 docs/_docs/layouts.md create mode 100644 docs/_docs/liquid.md rename docs/_docs/{templates.md => liquid/filters.md} (68%) create mode 100644 docs/_docs/liquid/tags.md create mode 100644 docs/_docs/markdown-101.md create mode 100644 docs/_docs/plugins/commands.md create mode 100644 docs/_docs/plugins/converters.md create mode 100644 docs/_docs/plugins/filters.md create mode 100644 docs/_docs/plugins/generators.md create mode 100644 docs/_docs/plugins/hooks.md create mode 100644 docs/_docs/plugins/installation.md create mode 100644 docs/_docs/plugins/tags.md create mode 100644 docs/_docs/plugins/your-first-plugin.md delete mode 100644 docs/_docs/quickstart.md create mode 100644 docs/_docs/ruby-101.md delete mode 100644 docs/_docs/sites.md create mode 100644 docs/_docs/step-by-step/01-setup.md create mode 100644 docs/_docs/step-by-step/02-liquid.md create mode 100644 docs/_docs/step-by-step/03-front-matter.md create mode 100644 docs/_docs/step-by-step/04-layouts.md create mode 100644 docs/_docs/step-by-step/05-includes.md create mode 100644 docs/_docs/step-by-step/06-data-files.md create mode 100644 docs/_docs/step-by-step/07-assets.md create mode 100644 docs/_docs/step-by-step/08-blogging.md create mode 100644 docs/_docs/step-by-step/09-collections.md create mode 100644 docs/_docs/step-by-step/10-deployment.md delete mode 100644 docs/_includes/section_nav.html create mode 100644 docs/_includes/step-index.html create mode 100644 docs/_layouts/step.html delete mode 100644 docs/help/index.md rename docs/{ => pages}/404.html (100%) rename docs/{ => pages}/index.html (99%) rename docs/{community/index.md => pages/jekyllconf.md} (96%) rename docs/{news/index.html => pages/news.html} (100%) rename docs/{ => pages}/philosophy.md (98%) rename docs/{ => pages}/redirects/github.html (100%) rename docs/{ => pages}/redirects/issues.html (100%) rename docs/{news/releases/index.html => pages/releases.html} (100%) create mode 100644 docs/pages/resources.md create mode 100644 docs/pages/showcase.html rename docs/{team/index.md => pages/team.md} (98%) diff --git a/History.markdown b/History.markdown index 72f1288de52..e373fb98b8b 100644 --- a/History.markdown +++ b/History.markdown @@ -457,7 +457,7 @@ * add SUPPORT file for GitHub (#6324) * Rename CODE_OF_CONDUCT to show in banner (#6325) * 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) * Fix typo in site.url section of variables.md :-[ (#6337) * Docs: updates (#6343) @@ -1123,7 +1123,7 @@ * Fix typo on Chocolatey name in Windows documentation (#4686) * Use the correct URL, Fixes #4698 (#4699) * 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) * Add Hawkins to the list of third-party plugins (#4755) * Fix a typo in pagination doc (#4763) @@ -1291,7 +1291,7 @@ * Drop: fix hash setter precedence (#4312) * utils: `has_yaml_header?` should accept files with extraneous spaces (#4290) * 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) * Page should respect output extension of its permalink (#4373) * Disable auto-regeneration when running server detached (#4376) @@ -1511,7 +1511,7 @@ * Fix nav items alignment when on multiple rows (#3264) * Highlight: Only Strip Newlines/Carriage Returns, not Spaces (#3278) * 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) * Template: Fix nav items alignment when in "burger" mode (#3329) * 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) * Be smarter about extracting the extname in `StaticFile` (#3632) * 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) * Create #mock_expects that goes directly to RSpec Mocks. (#3658) * 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) * Semantic structure improvements to the post and page layouts (#3251) * 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) * Update configuration docs to mention `keep_files` for `destination` (#3288, #3296) * Break when we successfully generate nav link to save CPU cycles. (#3291) @@ -2143,7 +2143,7 @@ * Clean up the `` in the site template (#2186) * 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) - * 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 `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) @@ -2821,7 +2821,7 @@ * Bullet-proof `limit_posts` option (#1004) * Read in YAML as UTF-8 to accept non-ASCII chars (#836) * 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) * Filter out directories with valid post names (#875) * 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) * Order plugin execution by priority (#864) * 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) * Tumblr Migrator: finds `_posts` dir correctly, fixes truncation of long post names (#775) * Force Categories to be Strings (#767) @@ -3024,7 +3024,7 @@ * Bug Fixes * 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 @@ -3056,7 +3056,7 @@ * Added --paginate option to the executable along with a paginator object for the payload (@calavera) * Upgraded RedCloth to 4.2.1, which makes `` tags work once again. * 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 * 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) @@ -3064,7 +3064,7 @@ * Index.html file should always have index.html permalink (@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) - * Allow CRLFs in yaml front matter (@juretta) + * Allow CRLFs in front matter (@juretta) * Added Date#xmlschema for Ruby versions < 1.9 ## 0.5.1 / 2009-05-06 @@ -3143,7 +3143,7 @@ * Added post categories based on directories containing `_posts` (@mreid) * Added post topics based on directories underneath `_posts` * 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` * Bug Fixes * Change YAML delimiter matcher so as to not chew up 2nd level markdown headers (@mreid) diff --git a/README.markdown b/README.markdown index 30f63686518..ee0a3bda8eb 100644 --- a/README.markdown +++ b/README.markdown @@ -7,7 +7,7 @@ [![Test Coverage](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/test_coverage)][coverage] [![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)][hakiri] [![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 [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 * [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/) * 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 diff --git a/docs/_data/docs.yml b/docs/_data/docs.yml deleted file mode 100644 index ef468fa1c9b..00000000000 --- a/docs/_data/docs.yml +++ /dev/null @@ -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 diff --git a/docs/_data/docs_nav.yml b/docs/_data/docs_nav.yml new file mode 100644 index 00000000000..8aac2befcef --- /dev/null +++ b/docs/_data/docs_nav.yml @@ -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/ diff --git a/docs/_data/jekyllconf-talks.yml b/docs/_data/jekyllconf-talks.yml index 93bf6252f88..6ef34e429ef 100644 --- a/docs/_data/jekyllconf-talks.yml +++ b/docs/_data/jekyllconf-talks.yml @@ -53,7 +53,7 @@ year: 2016 - speaker: Amy Johnston - twitter_handle: amybeukenex + twitter_handle: AmyJohnstonXL youtube_id: HR12JiUI2Zc topic: Jekyll for Technical Documentation year: 2016 @@ -83,7 +83,7 @@ year: 2016 - speaker: Julio Faerman - twitter_handle: jmfaerman + twitter_handle: juliodevrel youtube_id: SOMonG8Iqak topic: Jekyll on AWS year: 2016 @@ -131,7 +131,7 @@ year: 2016 - speaker: Nils Borchers - twitter_handle: nilsborchers + twitter_handle: nilsbo youtube_id: DtNMjuv6Rbo topic: Building a living brand guide with Jekyll and Hologram year: 2016 diff --git a/docs/_data/primary_nav.yml b/docs/_data/primary_nav.yml new file mode 100644 index 00000000000..02ff6e99a79 --- /dev/null +++ b/docs/_data/primary_nav.yml @@ -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 diff --git a/docs/_data/showcase.yml b/docs/_data/showcase.yml new file mode 100644 index 00000000000..b72092df3c0 --- /dev/null +++ b/docs/_data/showcase.yml @@ -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 diff --git a/docs/_docs/assets.md b/docs/_docs/assets.md index 1ead08af464..ca407f4dcaa 100644 --- a/docs/_docs/assets.md +++ b/docs/_docs/assets.md @@ -3,10 +3,11 @@ title: Assets permalink: /docs/assets/ --- -Jekyll provides built-in support for Sass and can work with CoffeeScript via -a Ruby gem. In order to use them, you must first create a file with the -proper extension name (one of `.sass`, `.scss`, or `.coffee`) and ***start the -file with two lines of triple dashes***, like this: +Jekyll provides built-in support for [Sass](https://sass-lang.com/) +and can work with [CoffeeScript](https://coffeescript.org/) via a Ruby gem. +In order to use them, you must first create a file with the proper extension +name (one of `.sass`, `.scss`, or `.coffee`) and +***start the file with two lines of triple dashes***, like this: ```sass --- @@ -42,8 +43,7 @@ them to be in the output file, such as `/css`. For an example, take 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 -`sass_dir` is set to the base directory that contains your Sass files. You -can do that thusly: +`sass_dir` is set to the base directory that contains your Sass files: ```yaml sass: @@ -61,7 +61,7 @@ The Sass converter will default the `sass_dir` configuration option to Note that the sass_dir becomes the load path for Sass imports, 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 folder should only contain imports. @@ -89,5 +89,5 @@ To enable Coffeescript in Jekyll 3.0 and up you must ```yaml plugins: - - jekyll-coffeescript + - jekyll-coffeescript ``` diff --git a/docs/_docs/collections.md b/docs/_docs/collections.md index 6309517c011..45bacc49bac 100644 --- a/docs/_docs/collections.md +++ b/docs/_docs/collections.md @@ -3,47 +3,25 @@ title: Collections permalink: /docs/collections/ --- -Not everything is a post or a page. Maybe you want to document the various -methods in your open source project, members of a team, or talks at a -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. +Collections are a great way to group related content like members of a team or +talks at a conference. -## Using Collections +## Setup -To start using collections, follow these 3 steps: - -* [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: +To use a Collection you first need to define it in your `_config.yml`. For +example here's a collection of staff members: ```yaml collections: -- my_collection + - staff_members ``` You can optionally specify metadata for your collection in the configuration: ```yaml collections: - my_collection: - foo: bar -``` - -Default attributes can also be set for a collection: - -```yaml -defaults: - - scope: - path: "" - type: my_collection - values: - layout: page + staff_members: + people: true ```
@@ -61,13 +39,24 @@ defaults:

If you specify a directory to store all your collections in the same place with collections_dir: my_collections, then you will need to move your _drafts and _posts directory to my_collections/_drafts and my_collections/_posts. Note that, the name of your collections directory cannot start with an underscore (`_`).

-### Step 2: Add your content {#step2} +## Add content -Create a corresponding folder (e.g. `/_my_collection`) and add -documents. YAML 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 +Create a corresponding folder (e.g. `/_staff_members`) and add +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 front 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*. +``` +
Be sure to name your directories correctly

@@ -76,190 +65,57 @@ your _config.yml file, with the addition of the preceding _

-### Step 3: Optionally render your collection's documents into independent files {#step3} - -If you'd like Jekyll to create a public-facing, rendered version of each -document in your collection, set the `output` key to `true` in your collection -metadata in your `_config.yml`: +## Output -```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 `/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: +Now you can iterate over `site.staff_members` on a page and output the content +for each staff member. Similar to posts, the body of the document is accessed +using the `content` variable: {% raw %} ```liquid -{% for item in site.my_collection %} -

{{ item.title }}

-

{{ item.description }}

-

{{ item.title }}

+{% for staff_member in site.staff_members %} +

{{ staff_member.name }} - {{ staff_member.position }}

+

{{ staff_member.content | markdownify }}

{% endfor %} ``` {% endraw %} -
-
Don't forget to add YAML for processing
-

- Files in collections that do not have front matter are treated as - static files and simply copied to their - output location without processing. -

-
- -## Configuring permalinks for collections {#permalinks} -If you wish to specify a custom pattern for the URLs where your Collection pages -will reside, you may do so with the [`permalink` property](../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 +metadata in `_config.yml`: ```yaml collections: - my_collection: + staff_members: output: true - permalink: /:collection/:name ``` -### Examples - -For a collection with the following source file structure, +You can link to the generated page using the `url` attribute: +{% raw %} +```liquid +{% for staff_member in site.staff_members %} +

+ + {{ staff_member.name }} - {{ staff_member.position }} + +

+

{{ staff_member.content | markdownify }}

+{% endfor %} ``` -_my_collection/ -└── some_subdir - └── some_doc.md -``` +{% endraw %} -each of the following `permalink` configurations will produce the document structure shown below it. - -* **Default** - Same as `permalink: /:collection/:path`. - - ``` - _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 +## Permalinks -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VariableDescription
-

:collection

-
-

Label of the containing collection.

-
-

:path

-
-

Path to the document relative to the collection's directory.

-
-

:name

-
-

The document's base filename, with every sequence of spaces - and non-alphanumeric characters replaced by a hyphen.

-
-

:title

-
-

- The :title template variable will take the - slug front matter - variable value if any is present in the document; if none is - defined then :title will be equivalent to - :name, aka the slug generated from the filename. -

-
-

:output_ext

-
-

Extension of the output file. (Included by default and usually unnecessary.)

-
-
+There are special [permalink variables for collections](/docs/permalinks/) to +help you control the output url for the entire collection. ## Liquid Attributes ### Collections -Each collection is accessible as a field on the `site` variable. For example, if -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 +Collections are also available under `site.collections`, with the metadata you specified in your `_config.yml` (if present) and the following information:
@@ -365,7 +221,7 @@ you specified in your `_config.yml` (if present) and the following information: ### 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:
@@ -383,9 +239,9 @@ file, each document has the following attributes:

- 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 - 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 `---` of the front matter.

@@ -455,51 +311,3 @@ file, each document has the following attributes:
- -## 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 %} -

{{ album.title }}

-

Performed by {{ album.artist }}{% if album.director %}, directed by {{ album.director }}{% endif %}

- {% for work in album.works %} -

{{ work.title }}

-

Composed by {{ work.composer }}

-
    - {% for track in work.tracks %} -
  • {{ track.title }} ({{ track.duration }})
  • - {% endfor %} -
- {% endfor %} -{% endfor %} -{% endraw %} -``` diff --git a/docs/_docs/community/bug.md b/docs/_docs/community/bug.md new file mode 100644 index 00000000000..06d4ab5d8a8 --- /dev/null +++ b/docs/_docs/community/bug.md @@ -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 — 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). diff --git a/docs/_docs/community/community.md b/docs/_docs/community/community.md new file mode 100644 index 00000000000..023f0260d81 --- /dev/null +++ b/docs/_docs/community/community.md @@ -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 — 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 they’ve learned or meta Jekyll topics. + +## Jekyll on Twitter + +The [official Jekyll Twitter account](https://twitter.com/jekyllrb). diff --git a/docs/_docs/configuration.md b/docs/_docs/configuration.md index e9c2269e7bb..c2c08ad7935 100644 --- a/docs/_docs/configuration.md +++ b/docs/_docs/configuration.md @@ -3,831 +3,16 @@ title: Configuration permalink: /docs/configuration/ --- -Jekyll allows you to concoct your sites in any way you can dream up, and it’s -thanks to the powerful and flexible configuration options that this is possible. -These options can either be specified in a `_config.yml` file placed in your -site’s root directory, or can be specified as flags for the `jekyll` executable -in the terminal. - -## Configuration Settings - -### Global Configuration - -The table below lists the available settings for Jekyll, and the various options (specified in the configuration file) and flags (specified on the command-line) that control them. - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Setting - Options and Flags -
-

Site Source

-

Change the directory where Jekyll will read files

-
-

source: DIR

-

-s, --source DIR

-
-

Site Destination

-

Change the directory where Jekyll will write files

-
-

destination: DIR

-

-d, --destination DIR

-
-

Safe

-

Disable custom plugins, and ignore symbolic links.

-
-

safe: BOOL

-

--safe

-
-

Exclude

-

- 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. -

-
-

exclude: [DIR, FILE, ...]

-
-

Include

-

- Force inclusion of directories and/or files in the conversion. - .htaccess is a good example since dotfiles are excluded - by default. -

-
-

include: [DIR, FILE, ...]

-
-

Keep files

-

- 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 destination. -

-
-

keep_files: [DIR, FILE, ...]

-
-

Time Zone

-

- Set the time zone for site generation. This sets the TZ - environment variable, which Ruby uses to handle time and date - creation and manipulation. Any entry from the - IANA Time Zone - Database is valid, e.g. America/New_York. A list of all - available values can be found - here. 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. -

-
-

timezone: TIMEZONE

-
-

Encoding

-

- Set the encoding of files by name (only available for Ruby - 1.9 or later). - The default value is utf-8 starting in 2.0.0, - and nil before 2.0.0, which will yield the Ruby - default of ASCII-8BIT. - Available encodings can be shown by the - command ruby -e 'puts Encoding::list.join("\n")'. -

-
-

encoding: ENCODING

-
-

Defaults

-

- Set defaults for YAML Front Matter - variables. -

-
-

see below

-
-
- -
-
Destination folders are cleaned on site builds
-

- The contents of <destination> 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 <keep_files> configuration directive. -

-

- Do not use an important location for <destination>; instead, use it as - a staging area and copy files from there to your web server. -

-
- -### Build Command Options - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SettingOptions and Flags
-

Regeneration

-

Enable auto-regeneration of the site when files are modified.

-
-

-w, --[no-]watch

-
-

Configuration

-

Specify config files instead of using _config.yml automatically. Settings in later files override settings in earlier files.

-
-

--config FILE1[,FILE2,...]

-
-

Drafts

-

Process and render draft posts.

-
-

show_drafts: BOOL

-

--drafts

-
-

Environment

-

Use a specific environment value in the build.

-
-

JEKYLL_ENV=production

-
-

Future

-

Publish posts or collection documents with a future date.

-
-

future: BOOL

-

--future

-
-

Unpublished

-

Render posts that were marked as unpublished.

-
-

unpublished: BOOL

-

--unpublished

-
-

LSI

-

Produce an index for related posts. Requires the classifier-reborn plugin.

-
-

lsi: BOOL

-

--lsi

-
-

Limit Posts

-

Limit the number of posts to parse and publish.

-
-

limit_posts: NUM

-

--limit_posts NUM

-
-

Force polling

-

Force watch to use polling.

-
-

--force_polling

-
-

Verbose output

-

Print verbose output.

-
-

-V, --verbose

-
-

Silence Output

-

Silence the normal output from Jekyll - during a build

-
-

-q, --quiet

-
-

Incremental build

-

- 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. -

-
-

incremental: BOOL

-

-I, --incremental

-
-

Liquid profiler

-

- Generate a Liquid rendering profile to help you identify performance bottlenecks. -

-
-

profile: BOOL

-

--profile

-
-

Strict Front Matter

-

- Cause a build to fail if there is a YAML syntax error in a page's front matter. -

-
-

strict_front_matter: BOOL

-

--strict_front_matter

-
-
- - -### 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. - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SettingOptions and Flags
-

Local Server Port

-

Listen on the given port.

-
-

port: PORT

-

--port PORT

-
-

Local Server Hostname

-

Listen at the given hostname.

-
-

host: HOSTNAME

-

--host HOSTNAME

-
-

Base URL

-

Serve the website from the given base URL

-
-

baseurl: URL

-

--baseurl URL

-
-

Detach

-

Detach the server from the terminal

-
-

detach: BOOL

-

-B, --detach

-
-

Skips the initial site build.

-

Skips the initial site build which occurs before the server is started.

-
-

--skip-initial-build

-
-

X.509 (SSL) Private Key

-

SSL Private Key.

-
-

--ssl-key

-
-

X.509 (SSL) Certificate

-

SSL Public certificate.

-
-

--ssl-cert

-
-
- -
-
Do not use tabs in configuration files
-

- This will either lead to parsing errors, or Jekyll will revert to the - default settings. Use spaces instead. -

-
- -## 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" -``` - -
-
Please stop and rerun `jekyll serve` command.
-

- The _config.yml master configuration file contains global configurations - and variable definitions that are read once at execution time. Changes made to _config.yml - during automatic regeneration are not loaded until the next execution. -

-

- Note Data Files are included and reloaded during automatic regeneration. -

-
- -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" -``` - -
-
Globbing and Performance
-

- 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. -

-
- - -### 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. - -
-
There are two unsupported kramdown options
-

- Please note that both remove_block_html_tags and - remove_span_html_tags are currently unsupported in Jekyll due - to the fact that they are not included within the kramdown HTML converter. -

-
- -```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 `` 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 -
-
Incremental regeneration is still an experimental feature
-

- 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 - opening an issue on GitHub. -

-
- -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. +Jekyll gives you a lot of flexibility to customize how it builds your site. These +options can either be specified in a `_config.yml` file placed in your site’s +root directory, or can be specified as flags for the `jekyll` executable in the +terminal. + +* [Configuration Options](/docs/configuration/options/) +* [Default Configuration](/docs/configuration/default/) +* [Front Matter Defaults](/docs/configuration/front-matter-defaults/) +* [Environments](/docs/configuration/environments/) +* [Markdown Options](/docs/configuration/markdown/) +* [Liquid Options](/docs/configuration/liquid/) +* [Webrick Options](/docs/configuration/webrick/) +* [Incremental Regeneration](/docs/configuration/incremental-regeneration/) diff --git a/docs/_docs/configuration/default.md b/docs/_docs/configuration/default.md new file mode 100644 index 00000000000..8908578da0a --- /dev/null +++ b/docs/_docs/configuration/default.md @@ -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 +``` diff --git a/docs/_docs/configuration/environments.md b/docs/_docs/configuration/environments.md new file mode 100644 index 00000000000..8ce0e41845c --- /dev/null +++ b/docs/_docs/configuration/environments.md @@ -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. diff --git a/docs/_docs/configuration/front-matter-defaults.md b/docs/_docs/configuration/front-matter-defaults.md new file mode 100644 index 00000000000..f8292b2cc2b --- /dev/null +++ b/docs/_docs/configuration/front-matter-defaults.md @@ -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" +``` + +
+
Stop and rerun `jekyll serve` command.
+

+ The _config.yml master configuration file contains global configurations + and variable definitions that are read once at execution time. Changes made to _config.yml + during automatic regeneration are not loaded until the next execution. +

+

+ Note Data Files are included and reloaded during automatic regeneration. +

+
+ +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" +``` + +
+
Globbing and Performance
+

+ 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. +

+
+ + +### 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. diff --git a/docs/_docs/configuration/incremental-regeneration.md b/docs/_docs/configuration/incremental-regeneration.md new file mode 100644 index 00000000000..b538c374491 --- /dev/null +++ b/docs/_docs/configuration/incremental-regeneration.md @@ -0,0 +1,36 @@ +--- +title: Default Configuration +permalink: "/docs/configuration/incremental-regeneration/" +--- + +## Incremental Regeneration +
+
Incremental regeneration is still an experimental feature
+

+ 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 + opening an issue on GitHub. +

+
+ +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. diff --git a/docs/_docs/configuration/liquid.md b/docs/_docs/configuration/liquid.md new file mode 100644 index 00000000000..fd050f616ef --- /dev/null +++ b/docs/_docs/configuration/liquid.md @@ -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. diff --git a/docs/_docs/configuration/markdown.md b/docs/_docs/configuration/markdown.md new file mode 100644 index 00000000000..865d6e7e7df --- /dev/null +++ b/docs/_docs/configuration/markdown.md @@ -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 + +
+
There are two unsupported kramdown options
+

+ Please note that both remove_block_html_tags and + remove_span_html_tags are currently unsupported in Jekyll due + to the fact that they are not included within the kramdown HTML converter. +

+
+ +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 `` 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 +``` diff --git a/docs/_docs/configuration/options.md b/docs/_docs/configuration/options.md new file mode 100644 index 00000000000..cd17c0b2356 --- /dev/null +++ b/docs/_docs/configuration/options.md @@ -0,0 +1,409 @@ +--- +title: Configuration Options +permalink: "/docs/configuration/options/" +--- + +The tables below list the available settings for Jekyll, and the various options (specified in the configuration file) and flags (specified on the command-line) that control them. + +### Global Configuration + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Setting + Options and Flags +
+

Site Source

+

Change the directory where Jekyll will read files

+
+

source: DIR

+

-s, --source DIR

+
+

Site Destination

+

Change the directory where Jekyll will write files

+
+

destination: DIR

+

-d, --destination DIR

+
+

Safe

+

Disable custom plugins, and ignore symbolic links.

+
+

safe: BOOL

+

--safe

+
+

Exclude

+

+ 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. +

+
+

exclude: [DIR, FILE, ...]

+
+

Include

+

+ Force inclusion of directories and/or files in the conversion. + .htaccess is a good example since dotfiles are excluded + by default. +

+
+

include: [DIR, FILE, ...]

+
+

Keep files

+

+ 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 destination. +

+
+

keep_files: [DIR, FILE, ...]

+
+

Time Zone

+

+ Set the time zone for site generation. This sets the TZ + environment variable, which Ruby uses to handle time and date + creation and manipulation. Any entry from the + IANA Time Zone + Database is valid, e.g. America/New_York. A list of all + available values can be found + here. 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. +

+
+

timezone: TIMEZONE

+
+

Encoding

+

+ Set the encoding of files by name (only available for Ruby + 1.9 or later). + The default value is utf-8 starting in 2.0.0, + and nil before 2.0.0, which will yield the Ruby + default of ASCII-8BIT. + Available encodings can be shown by the + command ruby -e 'puts Encoding::list.join("\n")'. +

+
+

encoding: ENCODING

+
+

Defaults

+

+ Set defaults for front matter + variables. +

+
+

see below

+
+
+ +
+
Destination folders are cleaned on site builds
+

+ The contents of <destination> 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 <keep_files> configuration directive. +

+

+ Do not use an important location for <destination>; instead, use it as + a staging area and copy files from there to your web server. +

+
+ +### Build Command Options + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SettingOptions and Flags
+

Regeneration

+

Enable auto-regeneration of the site when files are modified.

+
+

-w, --[no-]watch

+
+

Configuration

+

Specify config files instead of using _config.yml automatically. Settings in later files override settings in earlier files.

+
+

--config FILE1[,FILE2,...]

+
+

Drafts

+

Process and render draft posts.

+
+

show_drafts: BOOL

+

--drafts

+
+

Environment

+

Use a specific environment value in the build.

+
+

JEKYLL_ENV=production

+
+

Future

+

Publish posts or collection documents with a future date.

+
+

future: BOOL

+

--future

+
+

Unpublished

+

Render posts that were marked as unpublished.

+
+

unpublished: BOOL

+

--unpublished

+
+

LSI

+

Produce an index for related posts. Requires the classifier-reborn plugin.

+
+

lsi: BOOL

+

--lsi

+
+

Limit Posts

+

Limit the number of posts to parse and publish.

+
+

limit_posts: NUM

+

--limit_posts NUM

+
+

Force polling

+

Force watch to use polling.

+
+

--force_polling

+
+

Verbose output

+

Print verbose output.

+
+

-V, --verbose

+
+

Silence Output

+

Silence the normal output from Jekyll + during a build

+
+

-q, --quiet

+
+

Incremental build

+

+ 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. +

+
+

incremental: BOOL

+

-I, --incremental

+
+

Liquid profiler

+

+ Generate a Liquid rendering profile to help you identify performance bottlenecks. +

+
+

profile: BOOL

+

--profile

+
+

Strict Front Matter

+

+ Cause a build to fail if there is a YAML syntax error in a page's front matter. +

+
+

strict_front_matter: BOOL

+

--strict_front_matter

+
+
+ + +### 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. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SettingOptions and Flags
+

Local Server Port

+

Listen on the given port.

+
+

port: PORT

+

--port PORT

+
+

Local Server Hostname

+

Listen at the given hostname.

+
+

host: HOSTNAME

+

--host HOSTNAME

+
+

Base URL

+

Serve the website from the given base URL

+
+

baseurl: URL

+

--baseurl URL

+
+

Detach

+

Detach the server from the terminal

+
+

detach: BOOL

+

-B, --detach

+
+

Skips the initial site build.

+

Skips the initial site build which occurs before the server is started.

+
+

--skip-initial-build

+
+

X.509 (SSL) Private Key

+

SSL Private Key.

+
+

--ssl-key

+
+

X.509 (SSL) Certificate

+

SSL Public certificate.

+
+

--ssl-cert

+
+
+ +
+
Do not use tabs in configuration files
+

+ This will either lead to parsing errors, or Jekyll will revert to the + default settings. Use spaces instead. +

+
diff --git a/docs/_docs/configuration/webrick.md b/docs/_docs/configuration/webrick.md new file mode 100644 index 00000000000..c760b850cf9 --- /dev/null +++ b/docs/_docs/configuration/webrick.md @@ -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. diff --git a/docs/_docs/continuous-integration/buddyworks.md b/docs/_docs/continuous-integration/buddyworks.md index aef1ce8ed53..5dd43e3ce5e 100644 --- a/docs/_docs/continuous-integration/buddyworks.md +++ b/docs/_docs/continuous-integration/buddyworks.md @@ -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. -![Jekyll Build](https://buddy.works/data/blog/_images/buddyworks-jekyll-small.png) - [jekyll-docker-image]: https://hub.docker.com/r/jekyll/jekyll/ ## 3. Using YAML for configuration diff --git a/docs/_docs/continuous-integration/circleci.md b/docs/_docs/continuous-integration/circleci.md index ce58a0092ae..9380a90ce8b 100644 --- a/docs/_docs/continuous-integration/circleci.md +++ b/docs/_docs/continuous-integration/circleci.md @@ -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: -1. Visit the 'Add Projects' page: +1. Visit the 'Add Projects' page 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. 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. diff --git a/docs/_docs/continuous-integration/index.md b/docs/_docs/continuous-integration/index.md deleted file mode 100644 index c0826fc54a6..00000000000 --- a/docs/_docs/continuous-integration/index.md +++ /dev/null @@ -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) diff --git a/docs/_docs/datafiles.md b/docs/_docs/datafiles.md index f59715198c1..9d7cc6864a9 100644 --- a/docs/_docs/datafiles.md +++ b/docs/_docs/datafiles.md @@ -18,9 +18,8 @@ Plugins/themes can also leverage Data Files to set configuration variables. ## The Data Folder -As explained on the [directory structure](../structure/) page, the `_data` -folder is where you can store additional data for Jekyll to use when generating -your site. These files must be YAML, JSON, or CSV files (using either +The `_data` folder is where you can store additional data for Jekyll to use when +generating your site. These files must be YAML, JSON, or CSV files (using either the `.yml`, `.yaml`, `.json` or `.csv` extension), and they will be accessible via `site.data`. @@ -70,10 +69,7 @@ You can now render the list of members in a template: ``` {% endraw %} -{: .note .info } -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 +## Subfolders 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 @@ -134,7 +130,7 @@ dave: 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 %} ```liquid diff --git a/docs/_docs/deployment-methods.md b/docs/_docs/deployment-methods.md deleted file mode 100644 index cfdd465bec3..00000000000 --- a/docs/_docs/deployment-methods.md +++ /dev/null @@ -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. - -
-
ProTip™: Use GitHub Pages for zero-hassle Jekyll hosting
-

GitHub Pages are powered by Jekyll behind the scenes, so if you’re looking for a zero-hassle, zero-cost solution, GitHub Pages are a great way to host your Jekyll-powered website for free.

-
- -## 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 you’ve got another method that isn’t listed below, we’d 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?), it’s 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 you’ve generated the `_site` directory, you can easily scp its content using a -`tasks/deploy` shell script similar to [this deploy script][]. You’d obviously -need to change the values to reflect your site’s 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 you’ve 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). You’d obviously need to change the values to reflect your site’s 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 ",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ssh-rsa -``` - -`` 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 @: -``` - -Command line parameters are: - -- `--rsh=ssh -p2222` — The port for SSH access. It is required if -your host uses a different port than the default (e.g, HostGator) -- `` — The name of the local output folder (defaults to `_site`) -- `` — The username for your hosting account -- `` — 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-Admin’s [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). diff --git a/docs/_docs/deployment.md b/docs/_docs/deployment.md new file mode 100644 index 00000000000..d6e841c0ae9 --- /dev/null +++ b/docs/_docs/deployment.md @@ -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/) diff --git a/docs/_docs/deployment/automated.md b/docs/_docs/deployment/automated.md new file mode 100644 index 00000000000..8ba9cc53520 --- /dev/null +++ b/docs/_docs/deployment/automated.md @@ -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 +``` diff --git a/docs/_docs/deployment/manual.md b/docs/_docs/deployment/manual.md new file mode 100644 index 00000000000..627fa66c735 --- /dev/null +++ b/docs/_docs/deployment/manual.md @@ -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. diff --git a/docs/_docs/deployment/third-party.md b/docs/_docs/deployment/third-party.md new file mode 100644 index 00000000000..b20d785202d --- /dev/null +++ b/docs/_docs/deployment/third-party.md @@ -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 you’re 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). diff --git a/docs/_docs/drafts.md b/docs/_docs/drafts.md deleted file mode 100644 index 0e6bfd7dfb8..00000000000 --- a/docs/_docs/drafts.md +++ /dev/null @@ -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. diff --git a/docs/_docs/extras.md b/docs/_docs/extras.md deleted file mode 100644 index 05d4682e874..00000000000 --- a/docs/_docs/extras.md +++ /dev/null @@ -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 - -``` - -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 - -``` - -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). diff --git a/docs/_docs/frontmatter.md b/docs/_docs/front-matter.md similarity index 81% rename from docs/_docs/frontmatter.md rename to docs/_docs/front-matter.md index 761c8bb5089..c30530db5be 100644 --- a/docs/_docs/frontmatter.md +++ b/docs/_docs/front-matter.md @@ -1,13 +1,13 @@ --- 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 -contains a [YAML](http://yaml.org/) front matter block will be processed by -Jekyll as a special file. The front matter must be the first thing in the file -and must take the form of valid YAML set between triple-dashed lines. Here is a -basic example: +Any file that contains a [YAML](http://yaml.org/) front matter block will be +processed by Jekyll as a special file. The front matter must be the first thing +in the file and must take the form of valid YAML set between triple-dashed +lines. Here is a basic example: ```yaml --- @@ -28,14 +28,14 @@ relies on. If you use UTF-8 encoding, make sure that no BOM header characters exist in your files or very, very bad things will happen to Jekyll. This is especially relevant if you’re running - Jekyll on Windows. + Jekyll on Windows.

ProTip™: Front Matter Variables Are Optional

- If you want to use Liquid tags and variables + If you want to use Liquid tags and variables but don’t 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 process your file. (This is useful for things like CSS and RSS feeds!) @@ -72,12 +72,12 @@ front matter of a page or post.

  • Using null will produce a file without using a layout file. However this is overridden if the file is a post/document and has a - layout defined in the - frontmatter defaults. + layout defined in the + front matter defaults.
  • Starting from version 3.5.0, using none 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 none in a page, however, will cause Jekyll to attempt to use a layout named "none".
  • @@ -117,27 +117,25 @@ front matter of a page or post.
    ProTip™: Render Posts Marked As Unpublished

    To preview unpublished pages, simply run `jekyll serve` or `jekyll build` - with the `--unpublished` switch. Jekyll also has a handy drafts + with the `--unpublished` switch. Jekyll also has a handy drafts feature tailored specifically for blog posts.

    ## Custom Variables -Any variables in the front matter that are not predefined are mixed into the -data that is sent to the Liquid templating engine during the conversion. For -instance, if you set a title, you can use that in your layout to set the page -title: +You can also set your own front matter variables you can access in Liquid. For +instance, if you set a variable called `food`, you can use that in your page: +{% raw %} ```liquid - - - - {% raw %}{{ page.title }}{% endraw %} - - - … +--- +food: Pizza +--- + +

    {{ page.food }}

    ``` +{% endraw %} ## 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.
    ProTip™: Don't repeat yourself

    If you don't want to repeat your frequently used front matter variables - over and over, just define defaults + over and over, just define defaults for them and only override them where necessary (or not at all). This works both for predefined and custom variables.

    diff --git a/docs/_docs/github-pages.md b/docs/_docs/github-pages.md index 01af5e50e41..58cbc190453 100644 --- a/docs/_docs/github-pages.md +++ b/docs/_docs/github-pages.md @@ -11,7 +11,7 @@ website for free. 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, -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 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` 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 -site builds properly, use the handy [URL filters](../templates/#filters): +site builds properly, use the handy [URL filters](/docs/liquid/filters/): {% raw %} ```liquid @@ -122,7 +122,7 @@ to see more detailed examples.
    Source files must be in the root directory

    GitHub Pages overrides - the “Site Source” + the Windows-specific docs page. + Windows-specific docs page.

    diff --git a/docs/_docs/history.md b/docs/_docs/history.md index 1e6c14d8716..cae0a403a35 100644 --- a/docs/_docs/history.md +++ b/docs/_docs/history.md @@ -400,7 +400,7 @@ note: This file is autogenerated. Edit /History.markdown instead. - add SUPPORT file for GitHub ([#6324]({{ site.repository }}/issues/6324)) - Rename CODE_OF_CONDUCT to show in banner ([#6325]({{ site.repository }}/issues/6325)) - Docs : illustrate page.id for a collection's document ([#6329]({{ site.repository }}/issues/6329)) -- Docs: post's date can be overriden in YAML front matter ([#6334]({{ site.repository }}/issues/6334)) +- Docs: post'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)) - Fix typo in site.url section of variables.md :-[ ([#6337]({{ site.repository }}/issues/6337)) - 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)) - Use the correct URL, Fixes [#4698]({{ site.repository }}/issues/4698) ([#4699]({{ site.repository }}/issues/4699)) - 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)) - 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)) @@ -1315,7 +1315,7 @@ note: This file is autogenerated. Edit /History.markdown instead. - 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)) - 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)) - 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)) @@ -1539,7 +1539,7 @@ note: This file is autogenerated. Edit /History.markdown instead. - Internal: trigger hooks by owner symbol ([#3871]({{ site.repository }}/issues/3871)) - 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)) -- 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)) - 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)) @@ -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)) - 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)) -- 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)) - 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)) @@ -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)) - Be smarter about extracting the extname in `StaticFile` ([#3632]({{ site.repository }}/issues/3632)) - 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)) - 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)) @@ -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)) - 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)) -- 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)) - 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)) @@ -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 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)) -- 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)) - Add permalink warning to pagination docs ([#3551]({{ site.repository }}/issues/3551)) - 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 `` 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)) - 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 `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)) @@ -3022,7 +3022,7 @@ note: This file is autogenerated. Edit /History.markdown instead. - 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)) - 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)) - 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)) @@ -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)) - Order plugin execution by priority ([#864]({{ site.repository }}/issues/864)) - 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)) - 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)) @@ -3265,7 +3265,7 @@ note: This file is autogenerated. Edit /History.markdown instead. - Bug Fixes - 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-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) - Upgraded RedCloth to 4.2.1, which makes `` tags work once again. - 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 - 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) @@ -3314,7 +3314,7 @@ note: This file is autogenerated. Edit /History.markdown instead. - Index.html file should always have index.html permalink (@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) -- Allow CRLFs in yaml front matter (@juretta) +- Allow CRLFs in front matter (@juretta) - 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 topics based on directories underneath `_posts` - 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` - Bug Fixes - Change YAML delimiter matcher so as to not chew up 2nd level markdown headers (@mreid) diff --git a/docs/_docs/includes.md b/docs/_docs/includes.md index 8fa2af12ed6..00d0a57f0e5 100644 --- a/docs/_docs/includes.md +++ b/docs/_docs/includes.md @@ -152,41 +152,3 @@ Then pass this captured variable into the parameter for the include. Omit the qu {% include note.html content=download_note %} ``` {% endraw %} - -### Passing references to YAML files as parameter values - -Instead of passing string variables to the include, you can pass a reference to a YAML data file stored in the `_data` folder. - -Here's an example. In the `_data` folder, suppose you have a YAML file called `profiles.yml`. Its content looks like this: - -```yaml -- name: John Doe - login_age: old - image: johndoe.jpg - -- name: Jane Doe - login_age: new - image: janedoe.jpg -``` - -In the `_includes` folder, assume you have a file called `spotlight.html` with this code: - -{% 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`. diff --git a/docs/_docs/index.md b/docs/_docs/index.md index cbe0bd894d0..d71629fed03 100644 --- a/docs/_docs/index.md +++ b/docs/_docs/index.md @@ -1,41 +1,35 @@ --- -title: Welcome -permalink: /docs/home/ -redirect_from: /docs/index.html +title: Quickstart +permalink: /docs/ +redirect_from: /docs/home/index.html --- - -This site aims to be a comprehensive guide to Jekyll. We’ll cover topics such as getting your site up and running, creating and managing content, customizing your build, and deploying. - -## What is Jekyll, exactly? - -Jekyll is a simple, blog-aware, static site generator. - -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. - -Jekyll happens to be the engine behind [GitHub Pages](https://pages.github.com), so you can host your project’s Jekyll page/blog/website on GitHub’s servers **for free**. - -## Navigating the Guide - -Throughout this guide, you'll see these special sections that help you get the most out of Jekyll: - -
    -
    ProTips™
    -

    Tips and tricks that'll make you a Jekyll wizard!

    -
    - -
    -
    Notes
    -

    Extra tidbits that are sometimes necessary to understand Jekyll.

    -
    - -
    -
    Warnings
    -

    Common pitfalls to avoid.

    -
    - -
    -
    Unreleased
    -

    Features planned for future versions of Jekyll, but not available yet.

    -
    - -If you find anything we haven’t covered, or would like to share a tip that others might find handy, please [file an issue]({{ site.repository }}/issues/new) and we’ll see about adding it to the guide. +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. + +## Instructions + +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"} + +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. diff --git a/docs/_docs/installation.md b/docs/_docs/installation.md index f2a56b31385..aa0c3f92c99 100644 --- a/docs/_docs/installation.md +++ b/docs/_docs/installation.md @@ -4,211 +4,19 @@ description: Official guide to install Jekyll on macOS, GNU/Linux or Windows. permalink: /docs/installation/ --- -Jekyll is a [Ruby Gem](http://guides.rubygems.org/rubygems-basics/), and can be -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) +Jekyll is a [Ruby Gem](/docs/ruby-101/#gems) that can be installed on most systems. ## 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 installation 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) - -## Install on macOS {#macOS} - -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). - -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 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. - -
    - -##### Problems installing Jekyll? - -Check out the [troubleshooting](../troubleshooting/) page or -[ask for help on our forum](https://talk.jekyllrb.com). - -
    - -## 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' -``` +* [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) -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. +## Guides -```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 -``` +For detailed install instructions have a look at the guide for your operating system. -Now that you’ve got everything up-to-date and installed, let’s get to work! +* [macOS](/docs/installation/macos/) +* [Ubuntu Linux](/docs/installation/ubuntu/) +* [Other Linux distros](/docs/installation/other-linux) +* [Windows](/docs/installation/windows/) diff --git a/docs/_docs/installation/macos.md b/docs/_docs/installation/macos.md new file mode 100644 index 00000000000..c8f8f532b4d --- /dev/null +++ b/docs/_docs/installation/macos.md @@ -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). diff --git a/docs/_docs/installation/other-linux.md b/docs/_docs/installation/other-linux.md new file mode 100644 index 00000000000..d66ce1c34a7 --- /dev/null +++ b/docs/_docs/installation/other-linux.md @@ -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 +``` diff --git a/docs/_docs/installation/ubuntu.md b/docs/_docs/installation/ubuntu.md new file mode 100644 index 00000000000..8962b144f0b --- /dev/null +++ b/docs/_docs/installation/ubuntu.md @@ -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. diff --git a/docs/_docs/windows.md b/docs/_docs/installation/windows.md similarity index 73% rename from docs/_docs/windows.md rename to docs/_docs/installation/windows.md index 3e97d297908..ebb3ae86d50 100644 --- a/docs/_docs/windows.md +++ b/docs/_docs/installation/windows.md @@ -1,31 +1,27 @@ --- 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. ## 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 -[RubyInstaller][] is a self-contained Windows-based installer that includes the Ruby language, an execution environment, important documentation, and more. -We only cover RubyInstaller-2.4 and newer here, older versions need to [install the Devkit][Devkit-install] manually. +[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](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. 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` 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`. - -[RubyInstaller]: https://rubyinstaller.org/ -[RubyInstaller-downloads]: https://rubyinstaller.org/downloads/ -[Devkit-install]: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit - +That's it, you're ready to use Jekyll! ### Encoding @@ -38,27 +34,24 @@ Additionally, you might need to change the code page of the console window to UT chcp 65001 ``` - ### 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. 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]. -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: +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: ```ruby # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] ``` -[IANA-database]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - ### 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. -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 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 -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: @@ -118,12 +111,6 @@ bundle config path vendor/bundle **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.
    @@ -132,7 +119,3 @@ You can make sure time management is working properly by inspecting your `_posts
    **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 - diff --git a/docs/_docs/layouts.md b/docs/_docs/layouts.md new file mode 100644 index 00000000000..31b10875a65 --- /dev/null +++ b/docs/_docs/layouts.md @@ -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 %} +``` + + + + + {{ page.title }} + + + + +

    {{ page.title }}

    +
    + {{ content }} +
    +
    + © to me +
    + + +``` +{% 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: + +``` + + + + + My First Page + + + + +

    My First Page

    +
    + This is the content of my page +
    +
    + © to me +
    + + +``` + + +## 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 +--- +

    {{ page.date }} - Written by {{ page.author }}

    + +{{ 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 +--- +

    {{ layout.city }}

    + +{{ content }} +``` +{% endraw %} diff --git a/docs/_docs/liquid.md b/docs/_docs/liquid.md new file mode 100644 index 00000000000..a7c21550a47 --- /dev/null +++ b/docs/_docs/liquid.md @@ -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/) diff --git a/docs/_docs/templates.md b/docs/_docs/liquid/filters.md similarity index 68% rename from docs/_docs/templates.md rename to docs/_docs/liquid/filters.md index 052c74e8da5..078a4b7f6de 100644 --- a/docs/_docs/templates.md +++ b/docs/_docs/liquid/filters.md @@ -1,16 +1,12 @@ --- -title: Templates -permalink: /docs/templates/ +title: Liquid Filters +permalink: "/docs/liquid/filters/" --- - -Jekyll uses the [Liquid](https://shopify.github.io/liquid/) templating language to -process templates. All of the standard Liquid [tags](https://shopify.github.io/liquid/tags/control-flow/) and -[filters](https://shopify.github.io/liquid/filters/abs/) are -supported. To make common tasks easier, Jekyll even adds a few handy filters -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 +All of the standard Liquid +[filters](https://shopify.github.io/liquid/filters/abs/) are supported. To make +common tasks easier, Jekyll even adds a few handy filters of its own, +all of which you can find on this page. You can also create your own filters +using [plugins](/docs/plugins/).
    @@ -461,159 +457,4 @@ The default is `default`. They are as follows (with what they filter): - `default`: spaces and non-alphanumeric characters - `pretty`: spaces and non-alphanumeric characters except for `._~!$&'()+,;=@` - `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" -%} - -## 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/). - -
    -
    Jekyll processes all Liquid filters in code blocks
    -

    If you are using a language that contains curly braces, you - will likely need to place {% raw %} and - {% endraw %} tags around your code.

    -
    - -#### 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, you’ll 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 — 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 %} +- `latin`: like `default`, except Latin characters are first transliterated (e.g. `àèïòü` to `aeiou`) {%- include docs_version_badge.html version="3.7.0" -%}. diff --git a/docs/_docs/liquid/tags.md b/docs/_docs/liquid/tags.md new file mode 100644 index 00000000000..50bed0cb133 --- /dev/null +++ b/docs/_docs/liquid/tags.md @@ -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/). + +
    +
    Jekyll processes all Liquid filters in code blocks
    +

    If you are using a language that contains curly braces, you + will likely need to place {% raw %} and + {% endraw %} tags around your code.

    +
    + +### 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, you’ll 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 — 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 %} diff --git a/docs/_docs/maintaining/merging-a-pull-request.md b/docs/_docs/maintaining/merging-a-pull-request.md index c89e7e4a13d..0403d05abc2 100644 --- a/docs/_docs/maintaining/merging-a-pull-request.md +++ b/docs/_docs/maintaining/merging-a-pull-request.md @@ -7,7 +7,7 @@ title: "Merging a Pull Request" ## 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. diff --git a/docs/_docs/maintaining/triaging-an-issue.md b/docs/_docs/maintaining/triaging-an-issue.md index 23660b17ef8..36bfdcc95a9 100644 --- a/docs/_docs/maintaining/triaging-an-issue.md +++ b/docs/_docs/maintaining/triaging-an-issue.md @@ -51,4 +51,4 @@ Is what they wanted to get something we want to happen? Sometimes a bug report i ### 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). diff --git a/docs/_docs/markdown-101.md b/docs/_docs/markdown-101.md new file mode 100644 index 00000000000..c1090dbb873 --- /dev/null +++ b/docs/_docs/markdown-101.md @@ -0,0 +1,6 @@ +--- +title: Markdown 101 +permalink: /docs/markdown-101/ +--- + +# TO WRITE diff --git a/docs/_docs/migrations.md b/docs/_docs/migrations.md index fd8676a40ea..c3a69caef84 100644 --- a/docs/_docs/migrations.md +++ b/docs/_docs/migrations.md @@ -1,5 +1,5 @@ --- -title: Blog migrations +title: Blog Migrations permalink: /docs/migrations/ --- diff --git a/docs/_docs/pages.md b/docs/_docs/pages.md index 8852bc32b8e..fcfc62d3bbe 100644 --- a/docs/_docs/pages.md +++ b/docs/_docs/pages.md @@ -1,74 +1,27 @@ --- -title: Creating pages +title: 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. - -## Homepage - -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 you’re using is configured to look -for some different filename as the default, this file will turn into the -homepage of your Jekyll-generated site. - -
    -
    ProTip™: Use layouts on your homepage
    -

    - 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. -

    -
    - -## 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 +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 +members or recipes). 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, here’s what the root directory and associated URLs might look like: ```sh . -|-- _config.yml -|-- _includes/ -|-- _layouts/ -|-- _posts/ -|-- _site/ -|-- about.html # => http://example.com/about.html +|-- about.md # => http://example.com/about.html |-- index.html # => http://example.com/ -|-- other.md # => http://example.com/other.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. - -## Flattening pages from subfolders into the root directory - -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: - -```yaml ---- -title: My page -permalink: mypageurl.html ---- -``` - -### Named folders containing index HTML files +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. -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. +## Changing the output URL -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. +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. diff --git a/docs/_docs/pagination.md b/docs/_docs/pagination.md index 1735ee64012..d9554a99ab6 100644 --- a/docs/_docs/pagination.md +++ b/docs/_docs/pagination.md @@ -42,10 +42,10 @@ paginate_path: "/blog/page:num/" 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 -pagination page number, starting with `2`. If a site has 12 posts and specifies -`paginate: 5`, Jekyll will write `blog/index.html` with the first 5 posts, `blog/page2/index.html` with the next 5 posts -and `blog/page3/index.html` with the last 2 posts into the destination -directory. +pagination page number, starting with `2`.
    +If a site has 12 posts and specifies `paginate: 5`, Jekyll will write `blog/index.html` +with the first 5 posts, `blog/page2/index.html` with the next 5 posts and +`blog/page3/index.html` with the last 2 posts into the destination directory.
    Don't set a permalink
    @@ -58,8 +58,11 @@ directory.
    Pagination for categories, tags and collections

    - The more recent jekyll-paginate-v2 plugin supports more features. See the pagination examples in the repository. - This plugin is not supported by GitHub Pages. + The more recent + jekyll-paginate-v2 plugin supports more features. See the + + pagination examples in the repository. This plugin is not + supported by GitHub Pages.

    @@ -100,19 +103,19 @@ attributes:
    @@ -127,10 +130,10 @@ attributes: @@ -140,7 +143,7 @@ attributes:
    Pagination does not support tags or categories

    Pagination pages through every post in the posts - variable unless a post has hidden: true in its YAML Front Matter. + variable unless a post has hidden: true in its front matter. It does not currently allow paging over groups of posts linked by a common tag or category. It cannot include any collection of documents because it is restricted to posts.

    @@ -174,11 +177,15 @@ title: My Blog

    previous_page

    -

    - page number of the previous pagination page, - or nil if no previous page exists -

    +

    + page number of the previous pagination page, + or nil if no previous page exists +

    previous_page_path

    -

    - path of previous pagination page, - or nil if no previous page exists -

    +

    + path of previous pagination page, + or nil if no previous page exists +

    next_page_path

    -

    - path of next pagination page, - or nil if no subsequent page exists -

    +

    + path of next pagination page, + or nil if no subsequent page exists +

    @@ -68,7 +62,7 @@ The following table lists the template variables available for permalinks. You c @@ -79,7 +73,7 @@ The following table lists the template variables available for permalinks. You c @@ -90,7 +84,7 @@ The following table lists the template variables available for permalinks. You c @@ -101,7 +95,7 @@ The following table lists the template variables available for permalinks. You c @@ -112,14 +106,14 @@ The following table lists the template variables available for permalinks. You c _ + @@ -131,7 +125,7 @@ The following table lists the template variables available for permalinks. You c @@ -173,7 +167,7 @@ The following table lists the template variables available for permalinks. You c @@ -185,7 +179,7 @@ The following table lists the template variables available for permalinks. You c

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

    @@ -206,11 +200,9 @@ The following table lists the template variables available for permalinks. You c

    Year from the post's filename. May be overridden via the document’s - date YAML front matter + date front matter

    Month from the post's filename. May be overridden via the document’s - date YAML front matter + date front matter

    Month without leading zeros from the post's filename. May be - overridden via the document’s date YAML front matter + overridden via the document’s date front matter

    Day from the post's filename. May be overridden via the document’s - date YAML front matter + date front matter

    Day without leading zeros from the post's filename. May be overridden - via the document’s date YAML front matter + via the document’s date front matter

    y_day

    -

    Day of the year from the post's filename, with leading zeros.

    Year without the century from the post's filename. May be overridden - via the document’s date YAML front matter + via the document’s date front matter

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

    -Note that all template variables relating to time or categories are available to posts only. - -## Built-in permalink styles {#builtinpermalinkstyles} +### Built-in formats -Although you can specify a custom permalink pattern using [template variables](#template-variables), Jekyll also provides the following built-in styles for convenience. +For posts, Jekyll also provides the following built-in styles for convenience:
    @@ -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`.
    -
    Specifying permalinks through the YAML Front Matter
    -

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

    +
    Specifying permalinks through the front matter
    +

    Built-in permalink styles are not recognized in front matter. As a result, permalink: pretty will not work.

    -## Permalink style examples with posts {#permalink-style-examples} +### Collections + +For collections, you have the option to override the global permalink in the +collection configuration in `_config.yml`: -Here are a few examples to clarify how permalink styles get applied with posts. +```yaml +collections: + my_collection: + output: true + permalink: /:collection/:name +``` -Given a post named: `/2009-04-29-slap-chop.md` +Collections have the following placeholders available:
    - - + +
    URL TemplateResulting Permalink URLVariableDescription
    -

    None specified, or permalink: date

    +

    :collection

    -

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

    +

    Label of the containing collection.

    -

    pretty

    +

    :path

    -

    /2009/04/29/slap-chop/

    +

    Path to the document relative to the collection's directory.

    -

    /:month-:day-:year/:title:output_ext

    +

    :name

    -

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

    +

    The document's base filename, with every sequence of spaces + and non-alphanumeric characters replaced by a hyphen.

    -

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

    +

    :title

    -

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

    +

    + The :title template variable will take the + slug front matter + variable value if any is present in the document; if none is + defined then :title will be equivalent to + :name, aka the slug generated from the filename. +

    -

    /:year/:month/:title

    -

    See Extensionless permalinks with no trailing slashes for details.

    +

    :output_ext

    -

    /2009/04/slap-chop

    +

    Extension of the output file. (Included by default and usually unnecessary.)

    - -## 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 — 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. diff --git a/docs/_docs/plugins.md b/docs/_docs/plugins.md index 70c5a12c984..b53ed8d65e0 100644 --- a/docs/_docs/plugins.md +++ b/docs/_docs/plugins.md @@ -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 having to modify the Jekyll source itself. -
    -
    Plugins on GitHub Pages
    -

    - GitHub Pages is powered by Jekyll. - However, all Pages sites are generated using the --safe option - to disable custom plugins for security reasons. Unfortunately, this means - your plugins won’t work if you’re deploying to GitHub Pages.

    - You can still use GitHub Pages to publish your site, but you’ll need to - convert the site locally and push the generated static files to your GitHub - repository instead of the Jekyll source files. -

    -
    - -## 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`. - -
    -
    - _plugins, _config.yml and Gemfile - can be used simultaneously -
    -

    - 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. -

    -
    - -### 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. - -
    -

    - Gems included in the :jekyll-plugins group are activated - regardless of the --safe mode setting. Be aware of what - gems are included under this group! -

    -
    - - -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: - -
    - - - - - - - - - - - - - -
    MethodDescription
    -

    generate

    -
    -

    Generates content as a side-effect.

    -
    -
    - -## Converters - -If you have a new markup language you’d 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. - -
    -
    Remember your YAML Front Matter
    -

    - Jekyll will only convert files that have a YAML header at the top, even for - converters you add using a plugin. -

    -
    - -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: - -
    - - - - - - - - - - - - - - - - - - - - - -
    MethodDescription
    -

    matches

    -

    - Does the given extension match this converter’s list of acceptable - extensions? Takes one argument: the file’s extension (including the - dot). Must return true if it matches, false - otherwise. -

    -

    output_ext

    -

    - The extension to be given to the output file (including the dot). - Usually this will be ".html". -

    -

    convert

    -

    - Logic to do the content conversion. Takes one argument: the raw content - of the file (without YAML Front Matter). Must return a String. -

    -
    - -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 we’re -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: - -
    - - - - - - - - - - - - - -
    MethodDescription
    -

    init_with_program

    -

    - This method accepts one parameter, the - Mercenary::Program - 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. -

    -
    - -## Tags - -If you’d 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: - -
    - - - - - - - - - - - - - -
    MethodDescription
    -

    render

    -
    -

    Outputs the content of the tag.

    -
    -
    - -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 -

    {% render_time page rendered at: %}

    -``` -{% endraw %} - -And we would get something like this on the page: - -```html -

    page rendered at: Tue June 22 23:38:47 –0500 2010

    -``` - -### 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) -``` - -
    -
    ProTip™: Access the site object using Liquid
    -

    - Jekyll lets you access the site object through the - context.registers feature of Liquid at context.registers[:site]. For example, you can - access the global configuration file _config.yml using - context.registers[:site].config. -

    -
    - -### Flags - -There are two flags to be aware of when writing a plugin: - -
    - - - - - - - - - - - - - - - - - -
    FlagDescription
    -

    safe

    -
    -

    - 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 true. - GitHub Pages still won’t load your plugin, but if you submit it for - inclusion in core, it’s best for this to be correct! -

    -
    -

    priority

    -
    -

    - This flag determines what order the plugin is loaded in. Valid values - are: :lowest, :low, :normal, - :high, and :highest. Highest priority - matches are applied first, lowest priority are applied last. -

    -
    -
    - -To use one of the example plugins above as an illustration, here is how you’d -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 :site, :pages, -:posts, and :documents. 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: - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ContainerEventCalled
    -

    :site

    -
    -

    :after_init

    -
    -

    Just after the site initializes, but before setup & render. Good - for modifying the configuration of the site.

    -
    -

    :site

    -
    -

    :after_reset

    -
    -

    Just after site reset

    -
    -

    :site

    -
    -

    :post_read

    -
    -

    After site data has been read and loaded from disk

    -
    -

    :site

    -
    -

    :pre_render

    -
    -

    Just before rendering the whole site

    -
    -

    :site

    -
    -

    :post_render

    -
    -

    After rendering the whole site, but before writing any files

    -
    -

    :site

    -
    -

    :post_write

    -
    -

    After writing the whole site to disk

    -
    -

    :pages

    -
    -

    :post_init

    -
    -

    Whenever a page is initialized

    -
    -

    :pages

    -
    -

    :pre_render

    -
    -

    Just before rendering a page

    -
    -

    :pages

    -
    -

    :post_render

    -
    -

    After rendering a page, but before writing it to disk

    -
    -

    :pages

    -
    -

    :post_write

    -
    -

    After writing a page to disk

    -
    -

    :posts

    -
    -

    :post_init

    -
    -

    Whenever a post is initialized

    -
    -

    :posts

    -
    -

    :pre_render

    -
    -

    Just before rendering a post

    -
    -

    :posts

    -
    -

    :post_render

    -
    -

    After rendering a post, but before writing it to disk

    -
    -

    :posts

    -
    -

    :post_write

    -
    -

    After writing a post to disk

    -
    -

    :documents

    -
    -

    :post_init

    -
    -

    Whenever a document is initialized

    -
    -

    :documents

    -
    -

    :pre_render

    -
    -

    Just before rendering a document

    -
    -

    :documents

    -
    -

    :post_render

    -
    -

    After rendering a document, but before writing it to disk

    -
    -

    :documents

    -
    -

    :post_write

    -
    -

    After writing a document to disk

    -
    -
    - -## 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 <h1> 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 site’s 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 pandoc’s 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 Twitter’s 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 [``](https://html.spec.whatwg.org/multipage/embedded-content.html#the-picture-element) element, polyfilled with Scott Jehl’s [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 (``, `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 Twitter’s 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 `
    ` 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. - -
    -
    Submit your gem plugins
    -

    - You're encouraged to add your Jekyll gem plugins to this list, read the contributing page to find - out how to make that happen. -

    -
    +* [Installation](/docs/plugins/installation/) - How to install plugins +* [Your first plugin](/docs/plugins/your-first-plugin/) - How to write plugins +* [Generators](/docs/plugins/generators/) - Create additional content on your site +* [Converters](/docs/plugins/converters/) - Change a markup language into another format +* [Commands](/docs/plugins/commands/) - Extend the `jekyll` executable with subcommands +* [Tags](/docs/plugins/tags) - Create custom Liquid tags +* [Filters](/docs/plugins/filters/) - Create custom Liquid filters +* [Hooks](/docs/plugins/hooks/) - Fine-grained control to extend the build process diff --git a/docs/_docs/plugins/commands.md b/docs/_docs/plugins/commands.md new file mode 100644 index 00000000000..cd704346ea8 --- /dev/null +++ b/docs/_docs/plugins/commands.md @@ -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: + +
    + + + + + + + + + + + + + +
    MethodDescription
    +

    init_with_program

    +

    + This method accepts one parameter, the + Mercenary::Program + 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. +

    +
    diff --git a/docs/_docs/plugins/converters.md b/docs/_docs/plugins/converters.md new file mode 100644 index 00000000000..31c99e939fb --- /dev/null +++ b/docs/_docs/plugins/converters.md @@ -0,0 +1,91 @@ +--- +title: Converters +permalink: /docs/plugins/converters/ +--- + +If you have a new markup language you’d 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. + +
    +
    Remember your Front Matter
    +

    + Jekyll will only convert files that have a YAML header at the top, even for + converters you add using a plugin. +

    +
    + +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: + +
    + + + + + + + + + + + + + + + + + + + + + +
    MethodDescription
    +

    matches

    +

    + Does the given extension match this converter’s list of acceptable + extensions? Takes one argument: the file’s extension (including the + dot). Must return true if it matches, false + otherwise. +

    +

    output_ext

    +

    + The extension to be given to the output file (including the dot). + Usually this will be ".html". +

    +

    convert

    +

    + Logic to do the content conversion. Takes one argument: the raw content + of the file (without front matter). Must return a String. +

    +
    + +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 we’re +simply uppercasing the entire content string. Finally, when it saves the page, +it will do so with a `.html` extension. diff --git a/docs/_docs/plugins/filters.md b/docs/_docs/plugins/filters.md new file mode 100644 index 00000000000..811b0f0afb5 --- /dev/null +++ b/docs/_docs/plugins/filters.md @@ -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) +``` + +
    +
    ProTip™: Access the site object using Liquid
    +

    + Jekyll lets you access the site object through the + context.registers feature of Liquid at context.registers[:site]. For example, you can + access the global configuration file _config.yml using + context.registers[:site].config. +

    +
    diff --git a/docs/_docs/plugins/generators.md b/docs/_docs/plugins/generators.md new file mode 100644 index 00000000000..43b5b06856e --- /dev/null +++ b/docs/_docs/plugins/generators.md @@ -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: + +
    + + + + + + + + + + + + + +
    MethodDescription
    +

    generate

    +
    +

    Generates content as a side-effect.

    +
    +
    diff --git a/docs/_docs/plugins/hooks.md b/docs/_docs/plugins/hooks.md new file mode 100644 index 00000000000..55e44dd9843 --- /dev/null +++ b/docs/_docs/plugins/hooks.md @@ -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 :site, :pages, +:posts, and :documents. 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: + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ContainerEventCalled
    +

    :site

    +
    +

    :after_init

    +
    +

    Just after the site initializes, but before setup & render. Good + for modifying the configuration of the site.

    +
    +

    :site

    +
    +

    :after_reset

    +
    +

    Just after site reset

    +
    +

    :site

    +
    +

    :post_read

    +
    +

    After site data has been read and loaded from disk

    +
    +

    :site

    +
    +

    :pre_render

    +
    +

    Just before rendering the whole site

    +
    +

    :site

    +
    +

    :post_render

    +
    +

    After rendering the whole site, but before writing any files

    +
    +

    :site

    +
    +

    :post_write

    +
    +

    After writing the whole site to disk

    +
    +

    :pages

    +
    +

    :post_init

    +
    +

    Whenever a page is initialized

    +
    +

    :pages

    +
    +

    :pre_render

    +
    +

    Just before rendering a page

    +
    +

    :pages

    +
    +

    :post_render

    +
    +

    After rendering a page, but before writing it to disk

    +
    +

    :pages

    +
    +

    :post_write

    +
    +

    After writing a page to disk

    +
    +

    :posts

    +
    +

    :post_init

    +
    +

    Whenever a post is initialized

    +
    +

    :posts

    +
    +

    :pre_render

    +
    +

    Just before rendering a post

    +
    +

    :posts

    +
    +

    :post_render

    +
    +

    After rendering a post, but before writing it to disk

    +
    +

    :posts

    +
    +

    :post_write

    +
    +

    After writing a post to disk

    +
    +

    :documents

    +
    +

    :post_init

    +
    +

    Whenever a document is initialized

    +
    +

    :documents

    +
    +

    :pre_render

    +
    +

    Just before rendering a document

    +
    +

    :documents

    +
    +

    :post_render

    +
    +

    After rendering a document, but before writing it to disk

    +
    +

    :documents

    +
    +

    :post_write

    +
    +

    After writing a document to disk

    +
    +
    diff --git a/docs/_docs/plugins/installation.md b/docs/_docs/plugins/installation.md new file mode 100644 index 00000000000..8c1307dc958 --- /dev/null +++ b/docs/_docs/plugins/installation.md @@ -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`. + +
    +
    Plugins on GitHub Pages
    +

    + GitHub Pages is powered by Jekyll. + However, all Pages sites are generated using the --safe option + to disable plugins (with the exception of some + whitelisted plugins) for + security reasons. Unfortunately, this means + your plugins won’t work if you’re deploying to GitHub Pages.

    + You can still use GitHub Pages to publish your site, but you’ll need to + convert the site locally and push the generated static files to your GitHub + repository instead of the Jekyll source files. +

    +
    + +
    +
    + _plugins, _config.yml and Gemfile + can be used simultaneously +
    +

    + 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. +

    +
    + +### 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. + +
    +

    + Gems included in the :jekyll-plugins group are activated + regardless of the --safe mode setting. Be aware of what + gems are included under this group! +

    +
    diff --git a/docs/_docs/plugins/tags.md b/docs/_docs/plugins/tags.md new file mode 100644 index 00000000000..3681d623db5 --- /dev/null +++ b/docs/_docs/plugins/tags.md @@ -0,0 +1,72 @@ +--- +title: Tags +permalink: /docs/plugins/tags/ +--- + +If you’d 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: + +
    + + + + + + + + + + + + + +
    MethodDescription
    +

    render

    +
    +

    Outputs the content of the tag.

    +
    +
    + +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 +

    {% render_time page rendered at: %}

    +``` +{% endraw %} + +And we would get something like this on the page: + +```html +

    page rendered at: Tue June 22 23:38:47 –0500 2010

    +``` diff --git a/docs/_docs/plugins/your-first-plugin.md b/docs/_docs/plugins/your-first-plugin.md new file mode 100644 index 00000000000..dfa15e65a21 --- /dev/null +++ b/docs/_docs/plugins/your-first-plugin.md @@ -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: + +
    + + + + + + + + + + + + + + + + + +
    FlagDescription
    +

    safe

    +
    +

    + 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 true. + GitHub Pages still won’t load your plugin, but if you submit it for + inclusion in core, it’s best for this to be correct! +

    +
    +

    priority

    +
    +

    + This flag determines what order the plugin is loaded in. Valid values + are: :lowest, :low, :normal, + :high, and :highest. Highest priority + matches are applied first, lowest priority are applied last. +

    +
    +
    + +To use one of the example plugins above as an illustration, here is how you’d +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). diff --git a/docs/_docs/posts.md b/docs/_docs/posts.md index f0019971d29..f678c7d8183 100644 --- a/docs/_docs/posts.md +++ b/docs/_docs/posts.md @@ -1,30 +1,21 @@ --- -title: Writing posts +title: Posts permalink: /docs/posts/ --- -One of Jekyll’s best aspects is that it is “blog aware”. What does this mean, -exactly? Well, simply put, it means that blogging is baked into Jekyll’s -functionality. If you write articles and publish them online, you can publish -and maintain a blog simply by managing a folder of text-files on your computer. -Compared to the hassle of configuring and maintaining databases and web-based -CMS systems, this will be a welcome change! +Blogging is baked into Jekyll. You write blog posts as text files and Jekyll +provides everything you need to turn it into a blog. ## The Posts Folder -As explained on the [directory structure](../structure/) page, the `_posts` -folder is where your blog posts will live. These files are generally -[Markdown](https://daringfireball.net/projects/markdown/) or HTML, but can -be other formats with the proper converter installed. -All posts must have [YAML Front Matter](../frontmatter/), and they will be -converted from their source format into an HTML page that is part of your -static site. +The `_posts` folder is where your blog posts live. You typically write posts +in [Markdown](https://daringfireball.net/projects/markdown/), however HTML is +also supported. -### Creating Post Files +## Creating Posts -To create a new post, all you need to do is create a file in the `_posts` -directory. How you name files in this folder is important. Jekyll requires blog -post files to be named according to the following format: +To create a post, add a file to your `_posts` directory with the following +format: ``` 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 ``` +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! +``` +
    ProTip™: Link to other posts

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

    -### Content Formats -All blog post files must begin with [YAML Front Matter](../frontmatter/). After -that, it's simply a matter of deciding which format you prefer. Jekyll supports -[Markdown](https://daringfireball.net/projects/markdown/) out of the box, -and has [myriad extensions for other formats as well](/docs/plugins/#converters-1), -including the popular [Textile](http://redcloth.org/textile) format. These -formats each have their own way of marking up different types of content -within a post, so you should familiarize yourself with these formats and -decide which one best suits your needs.
    Be aware of character sets
    @@ -73,66 +72,31 @@ decide which one best suits your needs. ## Including images and resources -Chances are, at some point, you'll want to include images, downloads, or other -digital assets along with your text content. While the syntax for linking to -these resources differs between Markdown and Textile, the problem of working -out where to store these files in your site is something everyone will face. - -There are a number of ways to include digital assets in Jekyll. -One common solution is to create a folder in the root of the project directory -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 site’s root as the path for the asset to include. Again, this will -depend on the way your site’s (sub)domain and path are configured, but here are -some examples in Markdown of how you could do this using the `absolute_url` -filter in a post. +At some point, you'll want to include images, downloads, or other +digital assets along with your text content. One common solution is to create +a folder in the root of the project directory 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 site’s root as the path for the asset +to include. The best way to do this depends on the way your site’s (sub)domain +and path are configured, but here are some simple examples in Markdown: Including an image asset in a post: -{% raw %} ```markdown ... 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: -{% raw %} ```markdown -... you can [get the PDF]({{ "/assets/mydoc.pdf" | absolute_url }}) directly. +... you can [get the PDF]("/assets/mydoc.pdf") directly. ``` -{% endraw %} - -
    - -
    - -## 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 ---- - -You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `bundle exec jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. - -To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. -``` - -Everything in between the first and second `---` are part of the YAML Front Matter, and everything after the second `---` will be rendered with Markdown and show up as "Content". ## Displaying an index of posts -It’s all well and good to have posts in a folder, but a blog is no use unless -you have a list of posts somewhere. Creating an index of posts on another page -(or in a [template](../templates/)) is easy, thanks to the [Liquid template -language](https://docs.shopify.com/themes/liquid/basics) and its tags. Here’s a +Creating an index of posts on another page is easy thanks to +[Liquid](https://docs.shopify.com/themes/liquid/basics) and its tags. Here’s a basic example of how to create a list of links to your blog posts: {% raw %} @@ -147,188 +111,98 @@ basic example of how to create a list of links to your blog posts: ``` {% 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 -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 you wish to access the currently-rendering page/posts's variables (the variables of the post/page that has the `for` loop in it), use the `page` variable instead. -## Displaying post categories or tags - -Hey, that's pretty neat, but what about showing just some of your posts that are -related to each other? For that you can use any of the [variables definable in -Front Matter](https://jekyllrb.com/docs/frontmatter/). In the "typical post" -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 -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 -that file put (at least) the following: +## Categories and Tags -{% raw %} -```liquid ---- -layout: page ---- - -{% for post in site.categories[page.category] %} - - {{ post.title }} - -{% endfor %} -``` -{% endraw %} - -Next, in the root directory of your Jekyll install, create a new directory -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 ---- -``` +Jekyll has first class support for categories and tags in blog posts. The difference +between categories and tags is a category can be part of the URL for a post +whereas a tag cannot. -In this case, the listing pages will be accessible at `{baseurl}/category/blog.html` +To use these, first set your categories and tags in front matter: -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 ] +categories: [blog, travel] +tags: [hot, summer] --- ``` -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 -Each post automatically takes the first block of text, from the beginning of -the content to the first occurrence of `excerpt_separator`, and sets it in the -post's data hash. -Take the above example of an index of posts. Perhaps you want to include -a little hint about the post's content by adding the first paragraph of each of -your posts: +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 %} ```liquid -
      - {% for post in site.posts %} -
    • - {{ post.title }} - {{ post.excerpt }} -
    • - {% endfor %} -
    +{% for category in site.categories %} +

    {{ category[0] }}

    + +{% endfor %} ``` {% endraw %} -Because Jekyll grabs the first paragraph you will not need to wrap the excerpt -in `p` tags, which is already done for you. These tags can be removed with the -following if you'd prefer: +For tags it's exactly the same except the variable is `site.tags`. -{% raw %} -```liquid -{{ post.excerpt | remove: '

    ' | remove: '

    ' }} -``` -{% endraw %} +## Post excerpts -If you don't like the automatically-generated post excerpt, it can be -explicitly overridden by adding an `excerpt` value to your post's YAML -Front Matter. Alternatively, you can choose to define a custom -`excerpt_separator` in the post's YAML front matter: +You can access a snippet of a posts's content by using `excerpt` variable on a +post. By default this is the first paragraph of content in the post however it +can be customized by setting a `excerpt_separator` variable in front matter or +`_config.yml`. ```yaml --- excerpt_separator: --- -Excerpt +Excerpt with multiple paragraphs + +Here's another paragraph in the excerpt. Out-of-excerpt ``` -You can also set the `excerpt_separator` globally in your `_config.yml` -configuration file. - -Completely disable excerpts by setting your `excerpt_separator` to `""`. - -Also, as with any output generated by Liquid tags, you can pass the -`| strip_html` filter to remove any html tags in the output. This is -particularly helpful if you wish to output a post excerpt as a -`meta="description"` tag within the post `head`, or anywhere else having -html tags along with the content is not desirable. - -## Highlighting code snippets - -Jekyll also has built-in support for syntax highlighting of code snippets using -either Pygments or Rouge, and including a code snippet in any post is easy. -Just use the dedicated Liquid tag as follows: +Here's an example of outputting a list of blog posts with an excerpt: {% 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 %} +
      + {% for post in site.posts %} +
    • + {{ post.title }} + {{ post.excerpt }} +
    • + {% endfor %} +
    ``` {% endraw %} -And the output will look like this: +## Drafts -```ruby -def show - @widget = Widget(params[:id]) - respond_to do |format| - format.html # show.html.erb - format.json { render json: @widget } - end -end -``` +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 and create your first draft: -
    -
    ProTip™: Show line numbers
    -

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

    -
    +```text +|-- _drafts/ +| |-- a-draft-post.md +``` -These basics should be enough to get you started writing your first posts. When -you’re ready to dig into what else is possible, you might be interested in -doing things like [customizing post permalinks](../permalinks/) or -using [custom variables](../variables/) in your posts and elsewhere on your -site. +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. diff --git a/docs/_docs/quickstart.md b/docs/_docs/quickstart.md deleted file mode 100644 index 9c88d0cf871..00000000000 --- a/docs/_docs/quickstart.md +++ /dev/null @@ -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 — 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 ` 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 help command to remind you of all available options and usage, it also works with the new, build and serve subcommands, e.g. jekyll help new or jekyll help build. -{: .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. diff --git a/docs/_docs/resources.md b/docs/_docs/resources.md index d345f0e1600..982a8bae46d 100644 --- a/docs/_docs/resources.md +++ b/docs/_docs/resources.md @@ -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." -- [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. - [Using your Rails layouts in Jekyll](http://numbers.brighterplanet.com/2010/08/09/sharing-rails-views-with-jekyll) diff --git a/docs/_docs/ruby-101.md b/docs/_docs/ruby-101.md new file mode 100644 index 00000000000..85c1cc11e34 --- /dev/null +++ b/docs/_docs/ruby-101.md @@ -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 — 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. diff --git a/docs/_docs/sites.md b/docs/_docs/sites.md deleted file mode 100644 index f01a7a77f15..00000000000 --- a/docs/_docs/sites.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Sites using Jekyll -permalink: /docs/sites/ ---- - -It’s 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 diff --git a/docs/_docs/static_files.md b/docs/_docs/static_files.md index 7b712c13505..2e96527b9ac 100644 --- a/docs/_docs/static_files.md +++ b/docs/_docs/static_files.md @@ -2,11 +2,7 @@ title: Static Files permalink: /docs/static-files/ --- - -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 +A static file is a file that does not contain any front matter. These include images, PDFs, and other un-rendered content. 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 -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: diff --git a/docs/_docs/step-by-step/01-setup.md b/docs/_docs/step-by-step/01-setup.md new file mode 100644 index 00000000000..8b87645f8e0 --- /dev/null +++ b/docs/_docs/step-by-step/01-setup.md @@ -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 + + + + + Home + + +

    Hello World!

    + + +``` + +## 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 +http://localhost:4000 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! diff --git a/docs/_docs/step-by-step/02-liquid.md b/docs/_docs/step-by-step/02-liquid.md new file mode 100644 index 00000000000..56051b4c78a --- /dev/null +++ b/docs/_docs/step-by-step/02-liquid.md @@ -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 %} + +{% 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 +... +

    {{ "Hello World!" | downcase }}

    +... +``` +{% 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. diff --git a/docs/_docs/step-by-step/03-front-matter.md b/docs/_docs/step-by-step/03-front-matter.md new file mode 100644 index 00000000000..22fb87ac501 --- /dev/null +++ b/docs/_docs/step-by-step/03-front-matter.md @@ -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 `` on your site to populate using front matter: + +{% raw %} +```html +--- +title: Home +--- +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>{{ page.title }} + + +

    {{ "Hello World!" | downcase }}

    + + +``` +{% 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. diff --git a/docs/_docs/step-by-step/04-layouts.md b/docs/_docs/step-by-step/04-layouts.md new file mode 100644 index 00000000000..cb7ecd9e679 --- /dev/null +++ b/docs/_docs/step-by-step/04-layouts.md @@ -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 +``. 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 + + + + + {{ page.title }} + + + {{ content }} + + +``` +{% 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 +--- +

    {{ "Hello World!" | downcase }}

    +``` +{% 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 http://localhost:4000/about.html +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. diff --git a/docs/_docs/step-by-step/05-includes.md b/docs/_docs/step-by-step/05-includes.md new file mode 100644 index 00000000000..9aab5f6eb6c --- /dev/null +++ b/docs/_docs/step-by-step/05-includes.md @@ -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 + +``` + +Try using the include tag to add the navigation to `_layouts/default.html`: + +{% raw %} +```liquid + + + + + {{ page.title }} + + + {% include navigation.html %} + {{ content }} + + +``` +{% endraw %} + +Open http://localhost:4000 +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 + +``` +{% endraw %} + +Take a look at http://localhost:4000 +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. diff --git a/docs/_docs/step-by-step/06-data-files.md b/docs/_docs/step-by-step/06-data-files.md new file mode 100644 index 00000000000..d87a40c99b3 --- /dev/null +++ b/docs/_docs/step-by-step/06-data-files.md @@ -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 + +``` +{% endraw %} + +The output will be exactly the same. The difference is you’ve made it easier to +add new navigation items and change the HTML structure. + +What good is a site without CSS, JS and images? Let’s look at how to handle +assets in Jekyll. diff --git a/docs/_docs/step-by-step/07-assets.md b/docs/_docs/step-by-step/07-assets.md new file mode 100644 index 00000000000..a0248d6191c --- /dev/null +++ b/docs/_docs/step-by-step/07-assets.md @@ -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 they’ll 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 + +``` +{% 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 ``: + +{% raw %} +```liquid + + + + + {{ page.title }} + + + + {% include navigation.html %} + {{ content }} + + +``` +{% endraw %} + +Load up http://localhost:4000 +and check the active link in the navigation is green. + +Next we're looking at one of Jekyll's most popular features, blogging. diff --git a/docs/_docs/step-by-step/08-blogging.md b/docs/_docs/step-by-step/08-blogging.md new file mode 100644 index 00000000000..dfcb3dc0ea2 --- /dev/null +++ b/docs/_docs/step-by-step/08-blogging.md @@ -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 +--- +

    {{ page.title }}

    +

    {{ page.date | date_to_string }} - {{ page.author }}

    + +{{ 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 +--- +

    Latest Posts

    + +
      + {% for post in site.posts %} +
    • +

      {{ post.title }}

      +

      {{ post.excerpt }}

      +
    • + {% endfor %} +
    +``` +{% 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 (5–8 cm (2.0–3.1 in) in length and 4.5–5.5 cm (1.8–2.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 http://localhost:4000 and have +a look through your blog posts. + +Next we'll focus on creating a page for each post author. diff --git a/docs/_docs/step-by-step/09-collections.md b/docs/_docs/step-by-step/09-collections.md new file mode 100644 index 00000000000..149b852899f --- /dev/null +++ b/docs/_docs/step-by-step/09-collections.md @@ -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 +--- +

    Staff

    + +
      + {% for author in site.authors %} +
    • +

      {{ author.name }}

      +

      {{ author.position }}

      +

      {{ author.content | markdownify }}

      +
    • + {% endfor %} +
    +``` +{% 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 +--- +

    Staff

    + +
      + {% for author in site.authors %} +
    • +

      {{ author.name }}

      +

      {{ author.position }}

      +

      {{ author.content | markdownify }}

      +
    • + {% endfor %} +
    +``` +{% 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 +--- +

    {{ page.name }}

    +

    {{ page.position }}

    + +{{ 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 +--- +

    {{ page.name }}

    +

    {{ page.position }}

    + +{{ content }} + +

    Posts

    +
      + {% assign filtered_posts = site.posts | where: 'author', page.short_name %} + {% for post in filtered_posts %} +
    • {{ post.title }}
    • + {% endfor %} +
    +``` +{% 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 +--- +

    {{ page.title }}

    + +

    + {{ page.date | date_to_string }} + {% assign author = site.authors | where: 'short_name', page.author | first %} + {% if author %} + - {{ author.name }} + {% endif %} +

    + +{{ content }} +``` +{% endraw %} + +Open up http://localhost:4000 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. diff --git a/docs/_docs/step-by-step/10-deployment.md b/docs/_docs/step-by-step/10-deployment.md new file mode 100644 index 00000000000..343e07a3d4a --- /dev/null +++ b/docs/_docs/step-by-step/10-deployment.md @@ -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 + + + + + {{ page.title }} + + {% feed_meta %} + {% seo %} + + + {% include navigation.html %} + {{ content }} + + +``` +{% endraw %} + +Restart your Jekyll server and check these tags are added to the ``. + +## 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" %} + +{% 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! diff --git a/docs/_docs/structure.md b/docs/_docs/structure.md index f8a19059e49..b94193ad4d6 100644 --- a/docs/_docs/structure.md +++ b/docs/_docs/structure.md @@ -1,17 +1,7 @@ --- -title: Directory structure +title: Directory 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: ```sh @@ -36,13 +26,13 @@ A basic Jekyll site usually looks something like this: | └── _layout.scss ├── _site ├── .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 ```
    Directory structure of Jekyll sites using gem-based themes

    - Starting Jekyll 3.2, a new Jekyll project bootstrapped with jekyll new uses gem-based themes to define the look of the site. This results in a lighter default directory structure : _layouts, _includes and _sass are stored in the theme-gem, by default. + Starting Jekyll 3.2, a new Jekyll project bootstrapped with jekyll new uses gem-based themes to define the look of the site. This results in a lighter default directory structure : _layouts, _includes and _sass are stored in the theme-gem, by default.


    @@ -67,7 +57,7 @@ An overview of what each of these does:

    - Stores configuration data. Many of + Stores configuration data. Many of these options can be specified from the command line executable but it’s easier to specify them here so you don’t have to remember them.

    @@ -80,7 +70,7 @@ An overview of what each of these does:

    Drafts are unpublished posts. The format of these files is without a - date: title.MARKUP. Learn how to + date: title.MARKUP. Learn how to work with drafts.

    @@ -107,7 +97,7 @@ An overview of what each of these does:

    These are the templates that wrap posts. Layouts are chosen on a post-by-post basis in the - YAML Front Matter, + front matter, which is described in the next section. The liquid tag {% raw %}{{ content }}{% endraw %} 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 files is important, and must follow the format: YEAR-MONTH-DAY-title.MARKUP. - The permalinks can be customized for + The permalinks can be customized for each post, but the date and markup language are determined solely by the file name.

    @@ -190,8 +180,8 @@ An overview of what each of these does:

    - Provided that the file has a YAML Front - Matter section, it will be transformed by Jekyll. The same will + Provided that the file has a front + matter section, it will be transformed by Jekyll. The same will happen for any .html, .markdown, .md, or .textile file in your site’s root 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 css and images folders, favicon.ico files, and so forth—will be copied verbatim - to the generated site. There are plenty of sites + to the generated site. There are plenty of sites already using Jekyll if you’re curious to see how they’re laid out.

    diff --git a/docs/_docs/support.md b/docs/_docs/support.md index d22331879e1..4baa421ea69 100644 --- a/docs/_docs/support.md +++ b/docs/_docs/support.md @@ -15,10 +15,3 @@ If you're looking for support for Jekyll, there are a lot of options: * Chat with Jekyllers — Join [our Gitter channel](https://gitter.im/jekyll/jekyll) or [our IRC channel on Freenode](irc:irc.freenode.net/jekyll) There are a bunch of helpful community members on these services that should be willing to point you in the right direction. - -## Report a bug - -* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository — 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'! diff --git a/docs/_docs/themes.md b/docs/_docs/themes.md index 460686157d6..c687b6253de 100644 --- a/docs/_docs/themes.md +++ b/docs/_docs/themes.md @@ -7,7 +7,7 @@ Jekyll has an extensive theme system that allows you to leverage community-maint ## Understanding gem-based themes -When you [create a new Jekyll site](/docs/quickstart) (by running the `jekyll new ` 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 ` 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. @@ -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. -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 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 does not have YAML front matter, it will simply be copied over into the resulting site. +- If the file has [front matter](/docs/front-matter/) at the top, it will be rendered. +- 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`. diff --git a/docs/_docs/troubleshooting.md b/docs/_docs/troubleshooting.md index 819241218bc..ce062aa0645 100644 --- a/docs/_docs/troubleshooting.md +++ b/docs/_docs/troubleshooting.md @@ -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 Line Tools. -### Running Jekyll as Non-Superuser (no sudo!) +### Running Jekyll as Non-Superuser (no sudo!) {: #no-sudo} 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 -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: ``` @@ -118,16 +118,16 @@ export GEM_HOME=$HOME/gems export PATH=$HOME/gems/bin:$PATH ``` -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 +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 user's `PATH` ahead of any system-wide paths. 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. -To activate the new exports, either close and restart Bash, logout and -log back into your shell account, or run `. .bashrc` in the +To activate the new exports, either close and restart Bash, logout and +log back into your shell account, or run `. .bashrc` in the currently-running shell. If you see the following error when running the `jekyll new` command, @@ -239,7 +239,7 @@ http://localhost:4000/blog ## Configuration problems -The order of precedence for conflicting [configuration settings](../configuration/) +The order of precedence for conflicting [configuration settings](/docs/configuration/) is as follows: 1. Command-line flags @@ -257,7 +257,7 @@ specified elsewhere. ------------------------------------ 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' - 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`. @@ -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 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.
    diff --git a/docs/_docs/upgrading/2-to-3.md b/docs/_docs/upgrading/2-to-3.md index bafda35ffae..7bfbce5c765 100644 --- a/docs/_docs/upgrading/2-to-3.md +++ b/docs/_docs/upgrading/2-to-3.md @@ -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 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` -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 %}`. ### Syntax highlighter changed diff --git a/docs/_docs/usage.md b/docs/_docs/usage.md index 5f4d863fb6b..97d66c3d852 100644 --- a/docs/_docs/usage.md +++ b/docs/_docs/usage.md @@ -1,115 +1,20 @@ --- -title: Basic Usage +title: Command Line Usage permalink: /docs/usage/ --- -The Jekyll gem makes a `jekyll` executable available to you in your Terminal -window. You can use this command in a number of ways: +The Jekyll gem makes a `jekyll` executable available to you in your terminal. -```sh -jekyll build -# => The current folder will be generated into ./_site +You can use this command in a number of ways: -jekyll build --destination -# => The current folder will be generated into +* `jekyll new` - Creates a new Jekyll site scaffold +* `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 --destination -# => The folder will be generated into +Typically you'll use `jekyll serve` while developing locally and `jekyll build` when you need to generate the site for production. -jekyll build --watch -# => 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`. - -
    -
    Changes to _config.yml are not included during automatic regeneration.
    -

    - The _config.yml master configuration file contains global configurations - and variable definitions that are read once at execution time. Changes made to _config.yml - during automatic regeneration are not loaded until the next execution. -

    -

    - Note Data Files are included and reloaded during automatic regeneration. -

    -
    - -
    -
    Destination folders are cleaned on site builds
    -

    - The contents of <destination> 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 <destination> may be specified within the <keep_files> - configuration directive. -

    -

    - Do not use an important location for <destination>; - instead, use it as a staging area and copy files from there to your web server. -

    -
    - -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. - -
    -
    Call for help
    -

    - The help command is always here to remind you of all available options and usage, and also works with the build, serve and new subcommands, e.g jekyll help new or jekyll help build. -

    -
    - -If you're interested in browsing these docs on-the-go, install the -`jekyll-docs` gem and run `jekyll docs` in your terminal. +To change Jekyll's default build behavior have a look through the [configuration options](/docs/configuration/). diff --git a/docs/_docs/variables.md b/docs/_docs/variables.md index d39def6e7ff..df05cba3f24 100644 --- a/docs/_docs/variables.md +++ b/docs/_docs/variables.md @@ -3,11 +3,10 @@ title: Variables permalink: /docs/variables/ --- -Jekyll traverses your site looking for files to process. Any files with [YAML -front matter](../frontmatter/) are subject to processing. For each of these -files, Jekyll makes a variety of data available via the [Liquid templating -system](https://github.com/Shopify/liquid/wiki). The -following is a reference of the available data. +Jekyll traverses your site looking for files to process. Any files with +[front matter](/docs/front-matter/) are subject to processing. For each of these +files, Jekyll makes a variety of data available via the [Liquid](/docs/liquid/). +The following is a reference of the available data. ## Global Variables @@ -33,8 +32,8 @@ following is a reference of the available data.

    page

    - Page specific information + the YAML front - matter. Custom variables set via the YAML Front Matter will be + Page specific information + the front + matter. Custom variables set via the front matter will be available here. See below for details.

    @@ -43,8 +42,8 @@ following is a reference of the available data.

    layout

    - Layout specific information + the YAML front - matter. Custom variables set via the YAML Front Matter in + Layout specific information + the front + matter. Custom variables set via front matter in layouts will be available here.

    @@ -294,7 +293,7 @@ following is a reference of the available data. directory. For example, a post at /work/code/_posts/2008-12-24-closures.md would have this field set to ['work', 'code']. These can also be specified - in the YAML Front Matter. + in the front matter.

    @@ -303,7 +302,7 @@ following is a reference of the available data.

    The list of tags to which this post belongs. These can be specified in - the YAML Front Matter. + the front matter.

    @@ -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 page or post’s source on GitHub. This can be overridden in the - YAML Front Matter. + front matter.

    diff --git a/docs/_includes/docs_contents.html b/docs/_includes/docs_contents.html index 2ac64bb497d..7a51cca7a2c 100644 --- a/docs/_includes/docs_contents.html +++ b/docs/_includes/docs_contents.html @@ -1,8 +1,8 @@
    diff --git a/docs/_includes/docs_contents_mobile.html b/docs/_includes/docs_contents_mobile.html index b3e0110cdfe..65d5afebf59 100644 --- a/docs/_includes/docs_contents_mobile.html +++ b/docs/_includes/docs_contents_mobile.html @@ -1,7 +1,7 @@