From 7f18ac8f9943a88f29a9f8e61bc6dc7cd3fa2e20 Mon Sep 17 00:00:00 2001 From: Thiago Arrais Date: Tue, 25 Oct 2016 17:38:22 -0300 Subject: [PATCH 01/65] Group using arbitraty Liquid expressions --- docs/_docs/templates.md | 16 +++++ lib/jekyll/filters.rb | 31 +--------- lib/jekyll/filters/grouping_filters.rb | 56 ++++++++++++++++++ test/test_filters.rb | 82 ++++++++++++++++++++++++++ 4 files changed, 157 insertions(+), 28 deletions(-) create mode 100644 lib/jekyll/filters/grouping_filters.rb diff --git a/docs/_docs/templates.md b/docs/_docs/templates.md index 54f914f7..0d37f8e1 100644 --- a/docs/_docs/templates.md +++ b/docs/_docs/templates.md @@ -147,6 +147,22 @@ common tasks easier.

+ + +

Group By Expression

+

Group an array's items using a Liquid expression.

+ + +

+ {% raw %}{{ site.members | group_by_exp:"item", +"item.graduation_year | truncate: 3, \"\"" }}{% endraw %} +

+

+ [{"name"=>"201...", "items"=>[...]}, +{"name"=>"200...", "items"=>[...]}] +

+ +

XML Escape

diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index 29f2a2b5..f1467fa5 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -8,6 +8,8 @@ require_all "jekyll/filters" module Jekyll module Filters include URLFilters + include GroupingFilters + # Convert a Markdown string into HTML output. # # input - The Markdown String to convert. @@ -205,29 +207,6 @@ module Jekyll as_liquid(input).to_json end - # Group an array of items by a property - # - # input - the inputted Enumerable - # property - the property - # - # Returns an array of Hashes, each looking something like this: - # {"name" => "larry" - # "items" => [...] } # all the items where `property` == "larry" - def group_by(input, property) - if groupable?(input) - input.group_by { |item| item_property(item, property).to_s } - .each_with_object([]) do |item, array| - array << { - "name" => item.first, - "items" => item.last, - "size" => item.last.size - } - end - else - input - end - end - # Filter an array of objects # # input - the object array @@ -381,11 +360,6 @@ module Jekyll end.localtime end - private - def groupable?(element) - element.respond_to?(:group_by) - end - private def item_property(item, property) if item.respond_to?(:to_liquid) @@ -436,6 +410,7 @@ module Jekyll condition end + end end diff --git a/lib/jekyll/filters/grouping_filters.rb b/lib/jekyll/filters/grouping_filters.rb new file mode 100644 index 00000000..372b1e7b --- /dev/null +++ b/lib/jekyll/filters/grouping_filters.rb @@ -0,0 +1,56 @@ +module Jekyll + module Filters + module GroupingFilters + # Group an array of items by a property + # + # input - the inputted Enumerable + # property - the property + # + # Returns an array of Hashes, each looking something like this: + # {"name" => "larry" + # "items" => [...] } # all the items where `property` == "larry" + def group_by(input, property) + if groupable?(input) + groups = input.group_by { |item| item_property(item, property).to_s } + make_grouped_array(groups) + else + input + end + end + + def group_by_exp(input, variable, expression) + return input unless groupable?(input) + + parsed_expr = parse_expression(expression) + @context.stack do + groups = input.group_by do |item| + @context[variable] = item + parsed_expr.render(@context) + end + make_grouped_array(groups) + end + end + + private + def parse_expression(str) + Liquid::Variable.new(str, {}) + end + + private + def groupable?(element) + element.respond_to?(:group_by) + end + + private + def make_grouped_array(groups) + groups.each_with_object([]) do |item, array| + array << { + "name" => item.first, + "items" => item.last, + "size" => item.last.size + } + end + end + end + end +end diff --git a/test/test_filters.rb b/test/test_filters.rb index 9a0f87d4..9a2909ef 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -747,6 +747,88 @@ class TestFilters < JekyllUnitTest end end + context "group_by_exp filter" do + should "successfully group array of Jekyll::Page's" do + @filter.site.process + groups = @filter.group_by_exp(@filter.site.pages, "page", "page.layout | upcase") + groups.each do |g| + assert( + ["DEFAULT", "NIL", ""].include?(g["name"]), + "#{g["name"]} isn't a valid grouping." + ) + case g["name"] + when "DEFAULT" + assert( + g["items"].is_a?(Array), + "The list of grouped items for 'default' is not an Array." + ) + assert_equal 5, g["items"].size + when "nil" + assert( + g["items"].is_a?(Array), + "The list of grouped items for 'nil' is not an Array." + ) + assert_equal 2, g["items"].size + when "" + assert( + g["items"].is_a?(Array), + "The list of grouped items for '' is not an Array." + ) + assert_equal 15, g["items"].size + end + end + end + + should "include the size of each grouping" do + groups = @filter.group_by_exp(@filter.site.pages, "page", "page.layout") + groups.each do |g| + p g + assert_equal( + g["items"].size, + g["size"], + "The size property for '#{g["name"]}' doesn't match the size of the Array." + ) + end + end + + should "allow more complex filters" do + items = [ + { "version"=>"1.0", "result"=>"slow" }, + { "version"=>"1.1.5", "result"=>"medium" }, + { "version"=>"2.7.3", "result"=>"fast" } + ] + + result = @filter.group_by_exp(items, "item", "item.version | split: '.' | first") + assert_equal 2, result.size + end + + should "be equivalent of group_by" do + actual = @filter.group_by_exp(@filter.site.pages, "page", "page.layout") + expected = @filter.group_by(@filter.site.pages, "layout") + + assert_equal expected, actual + end + + should "return any input that is not an array" do + assert_equal "some string", @filter.group_by_exp("some string", "la", "le") + end + + should "group by full element (as opposed to a field of the element)" do + items = %w(a b c d) + + result = @filter.group_by_exp(items, "item", "item") + assert_equal 4, result.length + assert_equal ["a"], result.first["items"] + end + + should "accept hashes" do + hash = { 1 => "a", 2 => "b", 3 => "c", 4 => "d" } + + result = @filter.group_by_exp(hash, "item", "item") + assert_equal 4, result.length + end + end + context "sort filter" do should "raise Exception when input is nil" do err = assert_raises ArgumentError do From 7ac9653f4efe61f12b27adb0a7261547c17e266c Mon Sep 17 00:00:00 2001 From: Thiago Arrais Date: Fri, 4 Nov 2016 18:32:52 -0300 Subject: [PATCH 02/65] RDoc for group_by_exp --- lib/jekyll/filters/grouping_filters.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/jekyll/filters/grouping_filters.rb b/lib/jekyll/filters/grouping_filters.rb index 372b1e7b..804c6559 100644 --- a/lib/jekyll/filters/grouping_filters.rb +++ b/lib/jekyll/filters/grouping_filters.rb @@ -18,6 +18,13 @@ module Jekyll end end + # Group an array of items by an expression + # + # input - the object array + # variable - the variable to assign each item to in the expression + # expression -a Liquid comparison expression passed in as a string + # + # Returns the filtered array of objects def group_by_exp(input, variable, expression) return input unless groupable?(input) From 4ed41558d13fa282853b8eea5250c69936dda4da Mon Sep 17 00:00:00 2001 From: Thiago Arrais Date: Wed, 30 Nov 2016 17:54:59 -0300 Subject: [PATCH 03/65] Whoops! --- test/test_filters.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_filters.rb b/test/test_filters.rb index 9a2909ef..782ac52a 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -782,7 +782,6 @@ class TestFilters < JekyllUnitTest should "include the size of each grouping" do groups = @filter.group_by_exp(@filter.site.pages, "page", "page.layout") groups.each do |g| - p g assert_equal( g["items"].size, g["size"], From 91f0b91d6a4421af22f79fa96400038940b60606 Mon Sep 17 00:00:00 2001 From: Thiago Arrais Date: Wed, 30 Nov 2016 18:16:25 -0300 Subject: [PATCH 04/65] Rename for more idiomatic Ruby --- lib/jekyll/filters/grouping_filters.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/filters/grouping_filters.rb b/lib/jekyll/filters/grouping_filters.rb index 804c6559..a16901d9 100644 --- a/lib/jekyll/filters/grouping_filters.rb +++ b/lib/jekyll/filters/grouping_filters.rb @@ -12,7 +12,7 @@ module Jekyll def group_by(input, property) if groupable?(input) groups = input.group_by { |item| item_property(item, property).to_s } - make_grouped_array(groups) + grouped_array(groups) else input end @@ -34,7 +34,7 @@ module Jekyll @context[variable] = item parsed_expr.render(@context) end - make_grouped_array(groups) + grouped_array(groups) end end @@ -49,7 +49,7 @@ module Jekyll end private - def make_grouped_array(groups) + def grouped_array(groups) groups.each_with_object([]) do |item, array| array << { "name" => item.first, From c4142c4c77fe227d9f3a73a349b70c42205aa41a Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Wed, 30 Nov 2016 13:52:32 +0530 Subject: [PATCH 05/65] add a utility submodule to define 'TZ' on Windows --- lib/jekyll.rb | 2 +- lib/jekyll/utils.rb | 1 + lib/jekyll/utils/win_tz.rb | 73 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 lib/jekyll/utils/win_tz.rb diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 6cfbd70f..75f6b250 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -119,7 +119,7 @@ module Jekyll # Returns nothing # rubocop:disable Style/AccessorMethodName def set_timezone(timezone) - ENV["TZ"] = timezone + ENV["TZ"] = Utils::Platforms.windows? ? Utils::WinTZ.calculate(timezone) : timezone end # rubocop:enable Style/AccessorMethodName diff --git a/lib/jekyll/utils.rb b/lib/jekyll/utils.rb index f870ea85..23bacdab 100644 --- a/lib/jekyll/utils.rb +++ b/lib/jekyll/utils.rb @@ -4,6 +4,7 @@ module Jekyll extend self autoload :Platforms, "jekyll/utils/platforms" autoload :Ansi, "jekyll/utils/ansi" + autoload :WinTZ, "jekyll/utils/win_tz" # Constants for use in #slugify SLUGIFY_MODES = %w(raw default pretty ascii).freeze diff --git a/lib/jekyll/utils/win_tz.rb b/lib/jekyll/utils/win_tz.rb new file mode 100644 index 00000000..0c2b5bd2 --- /dev/null +++ b/lib/jekyll/utils/win_tz.rb @@ -0,0 +1,73 @@ +module Jekyll + module Utils + module WinTZ + extend self + + # Public: Calculate the Timezone for Windows when the config file has a defined + # 'timezone' key. + # + # timezone - the IANA Time Zone specified in "_config.yml" + # + # Returns a string that ultimately re-defines ENV["TZ"] in Windows + def calculate(timezone) + External.require_with_graceful_fail("tzinfo") + tz = TZInfo::Timezone.get(timezone) + difference = Time.now.to_i - tz.now.to_i + # + # POSIX style definition reverses the offset sign. + # e.g. Eastern Standard Time (EST) that is 5Hrs. to the 'west' of Prime Meridian + # is denoted as: + # EST+5 (or) EST+05:00 + # Reference: http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html + sign = difference < 0 ? "-" : "+" + offset = sign == "-" ? "+" : "-" unless difference.zero? + # + # convert the difference (in seconds) to hours, as a rational number, and perform + # a modulo operation on it. + modulo = modulo_of(rational_hour(difference)) + # + # Format the hour as a two-digit number. + # Establish the minutes based on modulo expression. + hh = format("%02d", absolute_hour(difference).ceil) + mm = modulo.zero? ? "00" : "30" + + Jekyll.logger.debug "Timezone:", "#{timezone} #{offset}#{hh}:#{mm}" + # + # Note: The 3-letter-word below doesn't have a particular significance. + "WTZ#{sign}#{hh}:#{mm}" + end + + private + + # Private: Convert given seconds to an hour as a rational number. + # + # seconds - supplied as an integer, it is converted to a rational number. + # 3600 - no. of seconds in an hour. + # + # Returns a rational number. + def rational_hour(seconds) + seconds.to_r/3600 + end + + # Private: Convert given seconds to an hour as an absolute number. + # + # seconds - supplied as an integer, it is converted to its absolute. + # 3600 - no. of seconds in an hour. + # + # Returns an integer. + def absolute_hour(seconds) + seconds.abs/3600 + end + + # Private: Perform a modulo operation on a given fraction. + # + # fraction - supplied as a rational number, its numerator is divided + # by its denominator and the remainder returned. + # + # Returns an integer. + def modulo_of(fraction) + fraction.numerator % fraction.denominator + end + end + end +end From ee5266602e8c9b5540450b343b78ab0d5ed851e4 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Wed, 30 Nov 2016 13:54:07 +0530 Subject: [PATCH 06/65] add 'tzinfo-data' gem to Jekyll Gemfile --- Gemfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gemfile b/Gemfile index 92797b42..378f6b82 100644 --- a/Gemfile +++ b/Gemfile @@ -79,6 +79,9 @@ group :jekyll_optional_dependencies do gem "classifier-reborn", "~> 2.0" gem "liquid-c", "~> 3.0" end + + # Windows does not include zoneinfo files, so bundle the tzinfo-data gem + gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] end # From 31eeb1a56106b3a6f415b8134ed75894bbf46e93 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Wed, 30 Nov 2016 13:55:52 +0530 Subject: [PATCH 07/65] add 'tzinfo-data' gem to generated Gemfile --- lib/jekyll/commands/new.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/jekyll/commands/new.rb b/lib/jekyll/commands/new.rb index 8319bd7e..561ae861 100644 --- a/lib/jekyll/commands/new.rb +++ b/lib/jekyll/commands/new.rb @@ -84,6 +84,10 @@ gem "minima", "~> 2.0" group :jekyll_plugins do gem "jekyll-feed", "~> 0.6" end + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] + RUBY end From 1b4ab418ba4bfb3492244cde63cb691a1f87ad66 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Wed, 30 Nov 2016 13:57:22 +0530 Subject: [PATCH 08/65] revert and adjust site_configuration.feature --- features/site_configuration.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/site_configuration.feature b/features/site_configuration.feature index 016ce28f..d09a95c4 100644 --- a/features/site_configuration.feature +++ b/features/site_configuration.feature @@ -161,8 +161,8 @@ Feature: Site configuration And I have a post layout that contains "Post Layout: {{ content }} built at {{ page.date | date_to_xmlschema }}" And I have an "index.html" page with layout "page" that contains "site index page" And I have a configuration file with: - | key | value | - | timezone | UTC+04:00 | + | key | value | + | timezone | America/New_York | And I have a _posts directory And I have the following posts: | title | date | layout | content | @@ -181,8 +181,8 @@ Feature: Site configuration And I have a post layout that contains "Post Layout: {{ content }} built at {{ page.date | date_to_xmlschema }}" And I have an "index.html" page with layout "page" that contains "site index page" And I have a configuration file with: - | key | value | - | timezone | UTC+10:00 | + | key | value | + | timezone | Pacific/Honolulu | And I have a _posts directory And I have the following posts: | title | date | layout | content | From f8456e02c1068cd3ae7e553cbe4776124e8e1cb8 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Wed, 30 Nov 2016 23:41:01 +0530 Subject: [PATCH 09/65] narrow it down to only Windows --- lib/jekyll.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 75f6b250..25bbaa0a 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -119,7 +119,11 @@ module Jekyll # Returns nothing # rubocop:disable Style/AccessorMethodName def set_timezone(timezone) - ENV["TZ"] = Utils::Platforms.windows? ? Utils::WinTZ.calculate(timezone) : timezone + ENV["TZ"] = if Utils::Platforms.really_windows? + Utils::WinTZ.calculate(timezone) + else + timezone + end end # rubocop:enable Style/AccessorMethodName From d70b4d0682337395c55ecd31f8c7af99520a4c29 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Thu, 1 Dec 2016 08:27:20 +0530 Subject: [PATCH 10/65] update documentation for Windows --- docs/_docs/windows.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/_docs/windows.md b/docs/_docs/windows.md index 05f3bbff..ab536382 100644 --- a/docs/_docs/windows.md +++ b/docs/_docs/windows.md @@ -34,6 +34,19 @@ the site generation process. It can be done with the following command: $ chcp 65001 ``` +## Timezone 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](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] +``` + ## Auto-regeneration As of v1.3.0, Jekyll uses the `listen` gem to watch for changes when the From c6fe7ec57f19afe31813fdd34e22656fe4bf7522 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Tue, 6 Dec 2016 21:32:00 +0530 Subject: [PATCH 11/65] add a set of steps in site_configuration.feature this set of steps allow the test to pass when DST in not currently active. They may fail when DST becomes active. --- features/site_configuration.feature | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/features/site_configuration.feature b/features/site_configuration.feature index d09a95c4..2d00f9b7 100644 --- a/features/site_configuration.feature +++ b/features/site_configuration.feature @@ -172,8 +172,10 @@ Feature: Site configuration Then I should get a zero exit status And the _site directory should exist And I should see "Page Layout: 2" in "_site/index.html" - And I should see "Post Layout:

content for entry1.

\n built at 2013-04-09T23:22:00-04:00" in "_site/2013/04/09/entry1.html" - And I should see "Post Layout:

content for entry2.

\n built at 2013-04-10T03:14:00-04:00" in "_site/2013/04/10/entry2.html" + And I should see "Post Layout:

content for entry1.

\n built at 2013-04-09T23:22:00-04:00" in "_site/2013/04/09/entry1.html" unless Windows + And I should see "Post Layout:

content for entry1.

\n built at 2013-04-09T22:22:00-05:00" in "_site/2013/04/09/entry1.html" if on Windows + And I should see "Post Layout:

content for entry2.

\n built at 2013-04-10T03:14:00-04:00" in "_site/2013/04/10/entry2.html" unless Windows + And I should see "Post Layout:

content for entry2.

\n built at 2013-04-10T02:14:00-05:00" in "_site/2013/04/10/entry2.html" if on Windows Scenario: Generate proper dates with explicitly set timezone (different than posts' time) Given I have a _layouts directory From f3300c177258e656d642a6d36c4b868c9706f70c Mon Sep 17 00:00:00 2001 From: Dean Attali Date: Wed, 7 Dec 2016 19:45:19 -0500 Subject: [PATCH 12/65] use backticks for Gemfile for consistency since in the next sentence _config.yml file has backtick --- lib/theme_template/README.md.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/theme_template/README.md.erb b/lib/theme_template/README.md.erb index 5b917516..9eca48c7 100644 --- a/lib/theme_template/README.md.erb +++ b/lib/theme_template/README.md.erb @@ -6,7 +6,7 @@ TODO: Delete this and the text above, and describe your gem ## Installation -Add this line to your Jekyll site's Gemfile: +Add this line to your Jekyll site's `Gemfile`: ```ruby gem <%= theme_name.inspect %> From 4c6bbe7d0e25f6de68c8df68a09b224e90d97023 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Wed, 7 Dec 2016 23:25:42 -0800 Subject: [PATCH 13/65] Update history to reflect merge of #5641 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index e4a4ce5e..26a10e98 100644 --- a/History.markdown +++ b/History.markdown @@ -29,6 +29,7 @@ ### Documentation * Fixed typo (#5632) + * use backticks for Gemfile for consistency since in the next sentence … (#5641) ## 3.3.1 / 2016-11-14 From 50bfdf181f39bcaeb8d8d3e409e778f5f2d13df3 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 8 Dec 2016 23:08:43 +1100 Subject: [PATCH 14/65] Update Core team list in README --- README.markdown | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index cef53c5c..60f11c47 100644 --- a/README.markdown +++ b/README.markdown @@ -43,8 +43,7 @@ conduct. Please adhere to this code of conduct in any interactions you have in the Jekyll community. It is strictly enforced on all official Jekyll repositories, websites, and resources. If you encounter someone violating -these terms, please let a maintainer ([@parkr](https://github.com/parkr), [@envygeeks](https://github.com/envygeeks), or [@mattr-](https://github.com/mattr-)) know -and we will address it as soon as possible. +these terms, please let a maintainer ([@parkr](https://github.com/parkr), [@envygeeks](https://github.com/envygeeks), [@mattr-](https://github.com/mattr-), or [@alfredxing](https://github.com/alfredxing)) know and we will address it as soon as possible. ## Diving In From 81f6f1e40450bab83dc3ba8db8723e1846aa07fa Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Thu, 8 Dec 2016 04:14:43 -0800 Subject: [PATCH 15/65] Update history to reflect merge of #5643 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 26a10e98..af1b2351 100644 --- a/History.markdown +++ b/History.markdown @@ -30,6 +30,7 @@ * Fixed typo (#5632) * use backticks for Gemfile for consistency since in the next sentence … (#5641) + * Update Core team list in the README file (#5643) ## 3.3.1 / 2016-11-14 From 43af0aa21b7c19313c769ae61d47bb37f1bee9ba Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Thu, 8 Dec 2016 20:09:01 -0800 Subject: [PATCH 16/65] Update history to reflect merge of #5612 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index af1b2351..5ec87211 100644 --- a/History.markdown +++ b/History.markdown @@ -20,6 +20,7 @@ * Escaped regular expressions when using post_url. (#5605) * fix date parsing in file names to be stricter (#5609) + * Add a module to re-define `ENV["TZ"]` in Windows (#5612) ### Development Fixes From d4c8d7fd2be52a75a805ed920f38c38cb3611e3d Mon Sep 17 00:00:00 2001 From: Thiago Arrais Date: Fri, 9 Dec 2016 09:56:40 -0300 Subject: [PATCH 17/65] Ignore symlinked file in windows --- test/test_filters.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/test_filters.rb b/test/test_filters.rb index 782ac52a..686e3a47 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -762,7 +762,9 @@ class TestFilters < JekyllUnitTest g["items"].is_a?(Array), "The list of grouped items for 'default' is not an Array." ) - assert_equal 5, g["items"].size + # adjust array.size to ignore symlinked page in Windows + qty = Utils::Platforms.really_windows? ? 4 : 5 + assert_equal qty, g["items"].size when "nil" assert( g["items"].is_a?(Array), @@ -774,7 +776,9 @@ class TestFilters < JekyllUnitTest g["items"].is_a?(Array), "The list of grouped items for '' is not an Array." ) - assert_equal 15, g["items"].size + # adjust array.size to ignore symlinked page in Windows + qty = Utils::Platforms.really_windows? ? 14 : 15 + assert_equal qty, g["items"].size end end end From b02f306f0a6329007ac5899b48f77ea3a2eba7cb Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Fri, 9 Dec 2016 16:01:22 -0800 Subject: [PATCH 18/65] Update history to reflect merge of #5513 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 5ec87211..b61f4f3a 100644 --- a/History.markdown +++ b/History.markdown @@ -15,6 +15,7 @@ ### Minor Enhancements * Add connector param to array_to_sentence_string filter (#5597) + * Adds group_by_exp filter (#5513) ### Bug Fixes From 69c4a8a1aabbf630c29c41f122e6aa69dc825b2f Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Sat, 10 Dec 2016 11:30:25 -0600 Subject: [PATCH 19/65] Use `assert_nil` instead of `assert_equal nil` Fixes #5648 --- test/test_document.rb | 2 +- test/test_page.rb | 8 ++++++-- test/test_static_file.rb | 2 +- test/test_theme.rb | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/test/test_document.rb b/test/test_document.rb index 5b9156f3..7c9df18c 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -206,7 +206,7 @@ class TestDocument < JekyllUnitTest should "not know the specified front matter defaults" do assert_equal "Example slide", @document.data["title"] assert_equal "slide", @document.data["layout"] - assert_equal nil, @document.data["nested"] + assert_nil @document.data["nested"] end end diff --git a/test/test_page.rb b/test/test_page.rb index 3072aebb..259de185 100644 --- a/test/test_page.rb +++ b/test/test_page.rb @@ -96,7 +96,11 @@ class TestPage < JekyllUnitTest attrs.each do |attr, val| attr_str = attr.to_s result = page[attr_str] - assert_equal val, result, "For :" + if val.nil? + assert_nil result, "For :" + else + assert_equal val, result, "For :" + end end end @@ -220,7 +224,7 @@ class TestPage < JekyllUnitTest should "return nil permalink if no permalink exists" do @page = setup_page("") - assert_equal nil, @page.permalink + assert_nil @page.permalink end should "not be writable outside of destination" do diff --git a/test/test_static_file.rb b/test/test_static_file.rb index bad40431..2be800a6 100644 --- a/test/test_static_file.rb +++ b/test/test_static_file.rb @@ -57,7 +57,7 @@ class TestStaticFile < JekyllUnitTest should "have a destination relative directory without a collection" do static_file = setup_static_file("root", "dir/subdir", "file.html") - assert_equal nil, static_file.type + assert_nil static_file.type assert_equal "dir/subdir/file.html", static_file.url assert_equal "dir/subdir", static_file.destination_rel_dir end diff --git a/test/test_theme.rb b/test/test_theme.rb index 918d01f6..ab1eff43 100644 --- a/test/test_theme.rb +++ b/test/test_theme.rb @@ -47,11 +47,11 @@ class TestTheme < JekyllUnitTest end should "not allow paths outside of the theme root" do - assert_equal nil, @theme.send(:path_for, "../../source") + assert_nil @theme.send(:path_for, "../../source") end should "return nil for paths that don't exist" do - assert_equal nil, @theme.send(:path_for, "foo") + assert_nil @theme.send(:path_for, "foo") end should "return the resolved path when a symlink & resolved path exists" do From c09221205a415a5bd324b9158173e57d21fdf346 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sat, 10 Dec 2016 12:17:00 -0800 Subject: [PATCH 20/65] Update history to reflect merge of #5652 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index b61f4f3a..78769303 100644 --- a/History.markdown +++ b/History.markdown @@ -27,6 +27,7 @@ * clean unit-test names in `test/test_tags.rb` (#5608) * Add cucumber feature to test for bonafide theme gems (#5384) + * Use `assert_nil` instead of `assert_equal nil` (#5652) ### Documentation From b99013cc3d945aeefdff5643a166c8d17e698185 Mon Sep 17 00:00:00 2001 From: kimbaudi Date: Sat, 10 Dec 2016 23:03:59 -0800 Subject: [PATCH 21/65] Improve Permalinks documentation. Add special note: built-in permalink styles are not recognized in the YAML Front Matter. --- docs/_docs/permalinks.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/_docs/permalinks.md b/docs/_docs/permalinks.md index 254c5d6d..31eeb30b 100644 --- a/docs/_docs/permalinks.md +++ b/docs/_docs/permalinks.md @@ -14,6 +14,16 @@ Permalinks are constructed by creating a template URL where dynamic elements are represented by colon-prefixed keywords. For example, the default `date` permalink is defined according to the format `/:categories/:year/:month/:day/:title.html`. +
+
Specifying permalinks through the YAML Front Matter
+

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

+
+ ## Template variables
From f5f387711a87555ea5c7b4988e4510975512a324 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Sun, 11 Dec 2016 15:35:46 +0530 Subject: [PATCH 22/65] update documentation on updating FontAwesome Iconset --- docs/_docs/contributing.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/_docs/contributing.md b/docs/_docs/contributing.md index c5a37722..662c60c0 100644 --- a/docs/_docs/contributing.md +++ b/docs/_docs/contributing.md @@ -71,6 +71,26 @@ You can find the documentation for jekyllrb.com in the [docs](https://github.com One gotcha, all pull requests should be directed at the `master` branch (the default branch). +### Updating FontAwesome package for jekyllrb.com + +We recently moved to using a stripped-down version of FontAwesome iconset on the site, consisting of only those icons that we actually use here. + +If you ever need to update our documentation with an icon that is not already available in our custom iconset, you'll have to regenerate the iconset using Icomoon's Generator: + +1. Go to +2. Click `Import Icons` on the top-horizontal-bar and upload `icomoon-selection.json` +3. Click `Add Icons from Library..` further down on the page, and add 'Font Awesome' +4. Select the required icon(s) from the Library (make sure its the 'FontAwesome' library instead of 'IcoMoon-Free' library). +5. Click `Generate Font` on the bottom-horizontal-bar +6. Inspect the included icons and proceed by clicking `Download`. +7. Extract the font files and adapt the CSS to the paths we use in Jekyll: + - Copy the entire `fonts` directory over and overwrite existing ones at `/docs/`. + - Copy the contents of `selection.json` and overwrite existing content inside `/docs/icomoon-selection.json`. + - Copy the entire `@font-face {}` declaration and only the **new-icon(s)' css declarations** further below, to update the + `/docs/_sass/_font-awesome.scss` sass partial. + - Fix paths in the `@font-face {}` declaraion by adding `../` before `fonts/FontAwesome.???` like so: + `('../fonts/Fontawesome.woff?9h6hxj')` + ### Adding plugins If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](https://github.com/jekyll/jekyll/blob/master/docs/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type. From 4f0a7439aa7c1c16d3201b2e6bfda4a8bedb5779 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 11 Dec 2016 03:49:39 -0800 Subject: [PATCH 23/65] Update history to reflect merge of #5653 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 78769303..0a5df268 100644 --- a/History.markdown +++ b/History.markdown @@ -34,6 +34,7 @@ * Fixed typo (#5632) * use backticks for Gemfile for consistency since in the next sentence … (#5641) * Update Core team list in the README file (#5643) + * Improve Permalinks documentation. (#5653) ## 3.3.1 / 2016-11-14 From 8a89f033ad0b67a71f5df5940e634c3acf02ff3a Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Sun, 11 Dec 2016 19:52:22 +0530 Subject: [PATCH 24/65] fix errors. --- docs/_docs/contributing.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/_docs/contributing.md b/docs/_docs/contributing.md index 662c60c0..0099c08a 100644 --- a/docs/_docs/contributing.md +++ b/docs/_docs/contributing.md @@ -71,25 +71,25 @@ You can find the documentation for jekyllrb.com in the [docs](https://github.com One gotcha, all pull requests should be directed at the `master` branch (the default branch). -### Updating FontAwesome package for jekyllrb.com +### Updating FontAwesome iconset for jekyllrb.com We recently moved to using a stripped-down version of FontAwesome iconset on the site, consisting of only those icons that we actually use here. If you ever need to update our documentation with an icon that is not already available in our custom iconset, you'll have to regenerate the iconset using Icomoon's Generator: -1. Go to -2. Click `Import Icons` on the top-horizontal-bar and upload `icomoon-selection.json` -3. Click `Add Icons from Library..` further down on the page, and add 'Font Awesome' +1. Go to . +2. Click `Import Icons` on the top-horizontal-bar and upload the existing `/docs/icomoon-selection.json`. +3. Click `Add Icons from Library..` further down on the page, and add 'Font Awesome'. 4. Select the required icon(s) from the Library (make sure its the 'FontAwesome' library instead of 'IcoMoon-Free' library). -5. Click `Generate Font` on the bottom-horizontal-bar +5. Click `Generate Font` on the bottom-horizontal-bar. 6. Inspect the included icons and proceed by clicking `Download`. 7. Extract the font files and adapt the CSS to the paths we use in Jekyll: - Copy the entire `fonts` directory over and overwrite existing ones at `/docs/`. - Copy the contents of `selection.json` and overwrite existing content inside `/docs/icomoon-selection.json`. - Copy the entire `@font-face {}` declaration and only the **new-icon(s)' css declarations** further below, to update the `/docs/_sass/_font-awesome.scss` sass partial. - - Fix paths in the `@font-face {}` declaraion by adding `../` before `fonts/FontAwesome.???` like so: - `('../fonts/Fontawesome.woff?9h6hxj')` + - Fix paths in the `@font-face {}` declaration by adding `../` before `fonts/FontAwesome.*` like so: + `('../fonts/Fontawesome.woff?9h6hxj')`. ### Adding plugins From 86d45a59893b8bb1a3a50abbad2518b4771030f2 Mon Sep 17 00:00:00 2001 From: Fabrice Laporte Date: Tue, 13 Dec 2016 11:14:16 +0100 Subject: [PATCH 25/65] Update variables.md Fix typo 'page' => 'layout' --- docs/_docs/variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/variables.md b/docs/_docs/variables.md index 059e092b..1d4e2091 100644 --- a/docs/_docs/variables.md +++ b/docs/_docs/variables.md @@ -339,7 +339,7 @@ following is a reference of the available data. If you specify front matter in a layout, access that via layout. For example, if you specify class: full_page - in a page’s front matter, that value will be available as + in a layout’s front matter, that value will be available as layout.class in the layout and its parents.

From 2856fd3ac70bd4f566a40966c77c06f2a0389b96 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 13 Dec 2016 05:42:17 -0800 Subject: [PATCH 26/65] Update history to reflect merge of #5657 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 0a5df268..5ce63297 100644 --- a/History.markdown +++ b/History.markdown @@ -35,6 +35,7 @@ * use backticks for Gemfile for consistency since in the next sentence … (#5641) * Update Core team list in the README file (#5643) * Improve Permalinks documentation. (#5653) + * Fix typo in Variables doc page (#5657) ## 3.3.1 / 2016-11-14 From 96fee68da430bc3d69cccbf6c088e319155a71a4 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievsky Date: Wed, 14 Dec 2016 02:11:49 +0300 Subject: [PATCH 27/65] Fix a couple of typos in the docs --- docs/_docs/static_files.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_docs/static_files.md b/docs/_docs/static_files.md index 19d45089..55a72747 100644 --- a/docs/_docs/static_files.md +++ b/docs/_docs/static_files.md @@ -26,7 +26,7 @@ following metadata:

file.path

- The relative path to the file, e.g /assets/img/image.jpg + The relative path to the file, e.g. /assets/img/image.jpg

@@ -34,7 +34,7 @@ following metadata:

file.modified_time

- The `Time` the file was last modified, e.g 2016-04-01 16:35:26 +0200 + The `Time` the file was last modified, e.g. 2016-04-01 16:35:26 +0200

From 25f58fe8f843a4d6d3fd59583f57edbe2d8ac51b Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 13 Dec 2016 23:47:28 -0800 Subject: [PATCH 28/65] Update history to reflect merge of #5658 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 5ce63297..65e79f96 100644 --- a/History.markdown +++ b/History.markdown @@ -36,6 +36,7 @@ * Update Core team list in the README file (#5643) * Improve Permalinks documentation. (#5653) * Fix typo in Variables doc page (#5657) + * Fix a couple of typos in the docs (#5658) ## 3.3.1 / 2016-11-14 From 109dceee3dfe35ebba51e4706d9c19d926943f1e Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Sun, 18 Dec 2016 07:45:08 +0530 Subject: [PATCH 29/65] move changes to /.github/ and regenerate site --- .github/CONTRIBUTING.markdown | 20 ++++++++++++++++++++ docs/_docs/contributing.md | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.markdown b/.github/CONTRIBUTING.markdown index 9e9e479c..6a239fc7 100644 --- a/.github/CONTRIBUTING.markdown +++ b/.github/CONTRIBUTING.markdown @@ -66,6 +66,26 @@ You can find the documentation for jekyllrb.com in the [docs](https://github.com One gotcha, all pull requests should be directed at the `master` branch (the default branch). +### Updating FontAwesome iconset for jekyllrb.com + +We use a custom version of FontAwesome which contains just the icons we use. + +If you ever need to update our documentation with an icon that is not already available in our custom iconset, you'll have to regenerate the iconset using Icomoon's Generator: + +1. Go to . +2. Click `Import Icons` on the top-horizontal-bar and upload the existing `/docs/icomoon-selection.json`. +3. Click `Add Icons from Library..` further down on the page, and add 'Font Awesome'. +4. Select the required icon(s) from the Library (make sure its the 'FontAwesome' library instead of 'IcoMoon-Free' library). +5. Click `Generate Font` on the bottom-horizontal-bar. +6. Inspect the included icons and proceed by clicking `Download`. +7. Extract the font files and adapt the CSS to the paths we use in Jekyll: + - Copy the entire `fonts` directory over and overwrite existing ones at `/docs/`. + - Copy the contents of `selection.json` and overwrite existing content inside `/docs/icomoon-selection.json`. + - Copy the entire `@font-face {}` declaration and only the **new-icon(s)' css declarations** further below, to update the + `/docs/_sass/_font-awesome.scss` sass partial. + - Fix paths in the `@font-face {}` declaration by adding `../` before `fonts/FontAwesome.*` like so: + `('../fonts/Fontawesome.woff?9h6hxj')`. + ### Adding plugins If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](https://github.com/jekyll/jekyll/blob/master/docs/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type. diff --git a/docs/_docs/contributing.md b/docs/_docs/contributing.md index 0099c08a..9ccac293 100644 --- a/docs/_docs/contributing.md +++ b/docs/_docs/contributing.md @@ -73,7 +73,7 @@ One gotcha, all pull requests should be directed at the `master` branch (the def ### Updating FontAwesome iconset for jekyllrb.com -We recently moved to using a stripped-down version of FontAwesome iconset on the site, consisting of only those icons that we actually use here. +We use a custom version of FontAwesome which contains just the icons we use. If you ever need to update our documentation with an icon that is not already available in our custom iconset, you'll have to regenerate the iconset using Icomoon's Generator: From 38a50e49dec1c0ff58061e853870c792724a867b Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sat, 17 Dec 2016 21:59:26 -0800 Subject: [PATCH 30/65] Update history to reflect merge of #5655 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 65e79f96..dd181cba 100644 --- a/History.markdown +++ b/History.markdown @@ -11,6 +11,7 @@ * Use only the used Font Awesome icons. (#5530) * Switch to `https` when possible. (#5611) * Update `_font-awesome.scss` to move .woff file before .ttf (#5614) + * Update documentation on updating FontAwesome Iconset (#5655) ### Minor Enhancements From de56b977b6672d041215d681a6d47cb6c131c3d6 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 18 Dec 2016 07:22:11 +0100 Subject: [PATCH 31/65] ran rubocop -a #5665 --- lib/jekyll/collection.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index f04fdb3f..a2f912ac 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -32,8 +32,8 @@ module Jekyll # Override of method_missing to check in @data for the key. def method_missing(method, *args, &blck) if docs.respond_to?(method.to_sym) - Jekyll.logger.warn "Deprecation:", "#{label}.#{method} should be changed to" \ - "#{label}.docs.#{method}." + Jekyll.logger.warn "Deprecation:", + "#{label}.#{method} should be changed to #{label}.docs.#{method}." Jekyll.logger.warn "", "Called by #{caller.first}." docs.public_send(method.to_sym, *args, &blck) else @@ -197,6 +197,7 @@ module Jekyll end private + def read_document(full_path) doc = Jekyll::Document.new(full_path, :site => site, :collection => self) doc.read @@ -208,6 +209,7 @@ module Jekyll end private + def read_static_file(file_path, full_path) relative_dir = Jekyll.sanitized_path( relative_directory, @@ -215,7 +217,7 @@ module Jekyll ).chomp("/.") files << StaticFile.new(site, site.source, relative_dir, - File.basename(full_path), self) + File.basename(full_path), self) end end end From d134afcd4aa150746f472fb309e69487bc774039 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 18 Dec 2016 07:22:36 +0100 Subject: [PATCH 32/65] ran rubocop -a --- lib/jekyll/excerpt.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/jekyll/excerpt.rb b/lib/jekyll/excerpt.rb index 34a2e65c..61344e79 100644 --- a/lib/jekyll/excerpt.rb +++ b/lib/jekyll/excerpt.rb @@ -30,8 +30,7 @@ module Jekyll @data end - def trigger_hooks(*) - end + def trigger_hooks(*); end # 'Path' of the excerpt. # From 48f7a155c3e91d62e2b899334b34ab19916734bc Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sun, 18 Dec 2016 08:55:05 +0100 Subject: [PATCH 33/65] reindent attributes --- lib/jekyll/collection.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index a2f912ac..9e906ab0 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -216,8 +216,13 @@ module Jekyll File.dirname(file_path) ).chomp("/.") - files << StaticFile.new(site, site.source, relative_dir, - File.basename(full_path), self) + files << StaticFile.new( + site, + site.source, + relative_dir, + File.basename(full_path), + self + ) end end end From 53db36c43a1ea8caffd77928a6abe30f8d2bfa9e Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 18 Dec 2016 02:02:42 -0800 Subject: [PATCH 34/65] Update history to reflect merge of #5666 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index dd181cba..368c0753 100644 --- a/History.markdown +++ b/History.markdown @@ -29,6 +29,7 @@ * clean unit-test names in `test/test_tags.rb` (#5608) * Add cucumber feature to test for bonafide theme gems (#5384) * Use `assert_nil` instead of `assert_equal nil` (#5652) + * Rubocop -a on lib/jekyll (#5666) ### Documentation From 2fc800ebd26dcbab97fddef0462b051b9945eebb Mon Sep 17 00:00:00 2001 From: Kevin Wojniak Date: Sun, 18 Dec 2016 17:32:19 -0800 Subject: [PATCH 35/65] Use each instead of map to actually return nothing --- lib/jekyll/reader.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/reader.rb b/lib/jekyll/reader.rb index 7bde499d..e1d3b8f5 100644 --- a/lib/jekyll/reader.rb +++ b/lib/jekyll/reader.rb @@ -71,7 +71,7 @@ module Jekyll # # Returns nothing. def retrieve_dirs(_base, dir, dot_dirs) - dot_dirs.map do |file| + dot_dirs.each do |file| dir_path = site.in_source_dir(dir, file) rel_path = File.join(dir, file) unless @site.dest.sub(%r!/$!, "") == dir_path From 79adb496764e29c31f5ead49f96e50f2629f3309 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 19 Dec 2016 12:40:10 -0800 Subject: [PATCH 36/65] Update history to reflect merge of #5668 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 368c0753..125dddd3 100644 --- a/History.markdown +++ b/History.markdown @@ -23,6 +23,7 @@ * Escaped regular expressions when using post_url. (#5605) * fix date parsing in file names to be stricter (#5609) * Add a module to re-define `ENV["TZ"]` in Windows (#5612) + * Use each instead of map to actually return nothing (#5668) ### Development Fixes From f09e1b15d8492a26a6597e363a261b60d2a70084 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 19 Dec 2016 23:42:30 +0100 Subject: [PATCH 37/65] bump to rake 12.0 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 378f6b82..b0fb8679 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" gemspec :name => "jekyll" -gem "rake", "~> 11.0" +gem "rake", "~> 12.0" # Dependency of jekyll-mentions. RubyGems in Ruby 2.1 doesn't shield us from this. gem "activesupport", "~> 4.2", :groups => [:test_legacy, :site] if RUBY_VERSION < '2.2.2' From 8a0d44eedce1175c4bae840ad2173fcb2f02b343 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Mon, 19 Dec 2016 23:50:16 +0100 Subject: [PATCH 38/65] please Rubocop :robot: - Reorder gems - use double quotes --- Gemfile | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Gemfile b/Gemfile index 378f6b82..2fa70c6e 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ gemspec :name => "jekyll" gem "rake", "~> 11.0" # Dependency of jekyll-mentions. RubyGems in Ruby 2.1 doesn't shield us from this. -gem "activesupport", "~> 4.2", :groups => [:test_legacy, :site] if RUBY_VERSION < '2.2.2' +gem "activesupport", "~> 4.2", :groups => [:test_legacy, :site] if RUBY_VERSION < "2.2.2" group :development do gem "launchy", "~> 2.3" @@ -18,15 +18,15 @@ end # group :test do - gem "rubocop", "~> 0.44.1" + gem "codeclimate-test-reporter", "~> 0.6.0" gem "cucumber", "~> 2.1" gem "jekyll_test_plugin" gem "jekyll_test_plugin_malicious" - gem "codeclimate-test-reporter", "~> 0.6.0" - gem "rspec-mocks" gem "nokogiri" gem "rspec" - gem "test-theme", path: File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__)) + gem "rspec-mocks" + gem "rubocop", "~> 0.44.1" + gem "test-theme", path => File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__)) gem "jruby-openssl" if RUBY_ENGINE == "jruby" end @@ -34,54 +34,54 @@ end # group :test_legacy do - if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2") - gem 'test-unit' + if RUBY_PLATFORM =~ %r!cygwin! || RUBY_VERSION.start_with?("2.2") + gem "test-unit" end - gem "redgreen" - gem "simplecov" - gem "minitest-reporters" - gem "minitest-profile" gem "minitest" + gem "minitest-profile" + gem "minitest-reporters" + gem "redgreen" gem "shoulda" + gem "simplecov" end # group :benchmark do if ENV["BENCHMARK"] - gem "ruby-prof" gem "benchmark-ips" - gem "stackprof" gem "rbtrace" + gem "ruby-prof" + gem "stackprof" end end # group :jekyll_optional_dependencies do - gem "toml", "~> 0.1.0" gem "coderay", "~> 1.1.0" - gem "jekyll-docs", :path => '../docs' if Dir.exist?('../docs') && ENV['JEKYLL_VERSION'] - gem "jekyll-gist" - gem "jekyll-feed" gem "jekyll-coffeescript" - gem "jekyll-redirect-from" + gem "jekyll-docs", :path => "../docs" if Dir.exist?("../docs") && ENV["JEKYLL_VERSION"] + gem "jekyll-feed" + gem "jekyll-gist" gem "jekyll-paginate" - gem "mime-types", "~> 3.0" + gem "jekyll-redirect-from" gem "kramdown", "~> 1.9" + gem "mime-types", "~> 3.0" gem "rdoc", "~> 4.2" + gem "toml", "~> 0.1.0" platform :ruby, :mswin, :mingw, :x64_mingw do - gem "rdiscount", "~> 2.0" - gem "pygments.rb", "~> 0.6.0" - gem "redcarpet", "~> 3.2", ">= 3.2.3" gem "classifier-reborn", "~> 2.0" gem "liquid-c", "~> 3.0" + gem "pygments.rb", "~> 0.6.0" + gem "rdiscount", "~> 2.0" + gem "redcarpet", "~> 3.2", ">= 3.2.3" end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem - gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] + gem "tzinfo-data", :platforms => [:mingw, :mswin, :x64_mingw, :jruby] end # @@ -91,9 +91,9 @@ group :site do gem "html-proofer", "~> 2.0" end - gem "jemoji", "0.5.1" - gem "jekyll-sitemap" - gem "jekyll-seo-tag" gem "jekyll-avatar" gem "jekyll-mentions" + gem "jekyll-seo-tag" + gem "jekyll-sitemap" + gem "jemoji", "0.5.1" end From 00f2fe3abc549cdd3f9675b3a5f18f5ea7293d84 Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Tue, 20 Dec 2016 09:27:44 +0100 Subject: [PATCH 39/65] fix typo --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 2fa70c6e..671cb4fd 100644 --- a/Gemfile +++ b/Gemfile @@ -26,7 +26,7 @@ group :test do gem "rspec" gem "rspec-mocks" gem "rubocop", "~> 0.44.1" - gem "test-theme", path => File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__)) + gem "test-theme", :path => File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__)) gem "jruby-openssl" if RUBY_ENGINE == "jruby" end From 6eca7e101a378f669753197bc0ccf26240216954 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 20 Dec 2016 00:38:18 -0800 Subject: [PATCH 40/65] Update history to reflect merge of #5670 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 125dddd3..47b0fef5 100644 --- a/History.markdown +++ b/History.markdown @@ -31,6 +31,7 @@ * Add cucumber feature to test for bonafide theme gems (#5384) * Use `assert_nil` instead of `assert_equal nil` (#5652) * Rubocop -a on lib/jekyll (#5666) + * Bump to rake 12.0 (#5670) ### Documentation From 52c2645abb871dbde190651e8e2396dacb3b60dc Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 20 Dec 2016 02:15:57 -0800 Subject: [PATCH 41/65] Update history to reflect merge of #5671 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 47b0fef5..3bd4af8e 100644 --- a/History.markdown +++ b/History.markdown @@ -32,6 +32,7 @@ * Use `assert_nil` instead of `assert_equal nil` (#5652) * Rubocop -a on lib/jekyll (#5666) * Bump to rake 12.0 (#5670) + * Rubocop Gemfile (#5671) ### Documentation From 704910b297a833cb2e03c433d800d4eaf7e29c7a Mon Sep 17 00:00:00 2001 From: Nursen Date: Fri, 23 Dec 2016 14:08:54 -0800 Subject: [PATCH 42/65] Update windows.md Added an update to installation instructions, as a cert authority change in Ruby causes problems with the prior recommended version of Ruby. --- docs/_docs/windows.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/_docs/windows.md b/docs/_docs/windows.md index ab536382..0426a4de 100644 --- a/docs/_docs/windows.md +++ b/docs/_docs/windows.md @@ -20,6 +20,9 @@ For a more conventional way of installing Jekyll you can follow this [complete g [windows-installjekyll3]: https://labs.sverrirs.com/jekyll/ +\[Update 12/23/2016\]: Updates in the infrastructure of Ruby may cause SLL errors when attemptying to use gem install on a version of ruby older than 2.6. (The ruby package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update ruby using the directions [here.][ssl-certificate-update] +[ssl-certificate-update]: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages + ## Encoding If you use UTF-8 encoding, make sure that no `BOM` header From 467f0a13714e68153161366d4c5fcd27c868fd85 Mon Sep 17 00:00:00 2001 From: Nursen Date: Sat, 24 Dec 2016 01:22:55 -0800 Subject: [PATCH 43/65] Update windows.md revising terminology to avoid ambiguity and moving in relation to alternative install instructions. --- docs/_docs/windows.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_docs/windows.md b/docs/_docs/windows.md index 0426a4de..7d6db10c 100644 --- a/docs/_docs/windows.md +++ b/docs/_docs/windows.md @@ -16,13 +16,13 @@ A quick way to install Jekyll is to follow the [installation instructions by Dav 2. Install Ruby via Chocolatey: `choco install ruby -y` 3. Reopen a command prompt and install Jekyll: `gem install jekyll` +Updates in the infrastructure of Ruby may cause SLL errors when attempting to use `gem install` on a version of the RubyGems package older than 2.6. (The RubyGems package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update the RubyGems package using the directions [here.][ssl-certificate-update] +[ssl-certificate-update]: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages + For a more conventional way of installing Jekyll you can follow this [complete guide to install Jekyll 3 on Windows by Sverrir Sigmundarson][windows-installjekyll3]. [windows-installjekyll3]: https://labs.sverrirs.com/jekyll/ -\[Update 12/23/2016\]: Updates in the infrastructure of Ruby may cause SLL errors when attemptying to use gem install on a version of ruby older than 2.6. (The ruby package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update ruby using the directions [here.][ssl-certificate-update] -[ssl-certificate-update]: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages - ## Encoding If you use UTF-8 encoding, make sure that no `BOM` header From 80d3c7a20495b59dc1cd598065ba337ce6b274d9 Mon Sep 17 00:00:00 2001 From: Nursen Date: Sat, 24 Dec 2016 01:25:03 -0800 Subject: [PATCH 44/65] Update windows.md fixing typo --- docs/_docs/windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/windows.md b/docs/_docs/windows.md index 7d6db10c..514730eb 100644 --- a/docs/_docs/windows.md +++ b/docs/_docs/windows.md @@ -16,7 +16,7 @@ A quick way to install Jekyll is to follow the [installation instructions by Dav 2. Install Ruby via Chocolatey: `choco install ruby -y` 3. Reopen a command prompt and install Jekyll: `gem install jekyll` -Updates in the infrastructure of Ruby may cause SLL errors when attempting to use `gem install` on a version of the RubyGems package older than 2.6. (The RubyGems package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update the RubyGems package using the directions [here.][ssl-certificate-update] +Updates in the infrastructure of Ruby may cause SSL errors when attempting to use `gem install` on a version of the RubyGems package older than 2.6. (The RubyGems package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update the RubyGems package using the directions [here.][ssl-certificate-update] [ssl-certificate-update]: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages For a more conventional way of installing Jekyll you can follow this [complete guide to install Jekyll 3 on Windows by Sverrir Sigmundarson][windows-installjekyll3]. From d442c4fe137a217f838ce3fde7aabce398b2c245 Mon Sep 17 00:00:00 2001 From: Nursen Date: Sat, 24 Dec 2016 02:16:20 -0800 Subject: [PATCH 45/65] Update windows.md --- docs/_docs/windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/windows.md b/docs/_docs/windows.md index 514730eb..8d7bb8bc 100644 --- a/docs/_docs/windows.md +++ b/docs/_docs/windows.md @@ -16,7 +16,7 @@ A quick way to install Jekyll is to follow the [installation instructions by Dav 2. Install Ruby via Chocolatey: `choco install ruby -y` 3. Reopen a command prompt and install Jekyll: `gem install jekyll` -Updates in the infrastructure of Ruby may cause SSL errors when attempting to use `gem install` on a version of the RubyGems package older than 2.6. (The RubyGems package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update the RubyGems package using the directions [here.][ssl-certificate-update] +Updates in the infrastructure of Ruby may cause SSL errors when attempting to use `gem install` with versions of the RubyGems package older than 2.6. (The RubyGems package installed via the Chocolatey tool is version 2.3) If you have installed an older version, you can update the RubyGems package using the directions [here.][ssl-certificate-update] [ssl-certificate-update]: http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages For a more conventional way of installing Jekyll you can follow this [complete guide to install Jekyll 3 on Windows by Sverrir Sigmundarson][windows-installjekyll3]. From 317eae55802e637663bc880b72961a2aff68cd3e Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Sun, 25 Dec 2016 20:31:32 -0800 Subject: [PATCH 46/65] Improve quickstart docs See https://github.com/jekyll/jekyll/pull/5630 for more details on the update. @jekyll/documentation @DirtyF --- docs/_docs/quickstart.md | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/docs/_docs/quickstart.md b/docs/_docs/quickstart.md index 969b5384..c2d0e79d 100644 --- a/docs/_docs/quickstart.md +++ b/docs/_docs/quickstart.md @@ -4,25 +4,37 @@ title: Quick-start guide permalink: /docs/quickstart/ --- -For the impatient, here's how to get a boilerplate Jekyll site up and running. +If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGems](https://rubygems.org/pages/download) installed (see Jekyll's [requirements](/docs/installation/#requirements/)), you can create a new Jekyll site by doing the following: ```sh +# Install Jekyll and Bundler gems through RubyGems ~ $ gem install jekyll bundler + +# Create a new Jekyll site at ./myblog ~ $ jekyll new myblog + +# Change into your new directory ~ $ cd myblog + +# Build the site on the preview server ~/myblog $ bundle exec jekyll serve -# => Now browse to http://localhost:4000 + +# Now browse to http://localhost:4000 ``` -The `jekyll new` command now automatically initiates `bundle install` and installs the dependencies required. To skip this, pass `--skip-bundle` option like so `jekyll new myblog --skip-bundle`. +`gem install jekyll bundler` installs the [jekyll](https://rubygems.org/gems/jekyll/) and [bundler](https://rubygems.org/gems/bundler) gems through [RubyGems](https://rubygems.org/). You need only to install the gems one time — not every time you create a new Jekyll project. Here are some additional details: -If you wish to install jekyll into an existing directory, you can do so by running `jekyll new .` from within the directory instead of creating a new one. If the existing directory isn't empty, you'll also have to pass the `--force` option like so `jekyll new . --force`. +* `bundler` is a gem that manages other Ruby gems. It makes sure your gems and gem versions are compatible, and that you have all necessary dependencies each gem requires. +* The `Gemfile` and `Gemfile.lock` files inform Bundler about the gem requirements in your theme. If your theme doesn't have these Gemfiles, you can omit `bundle exec` and just run `jekyll serve`. -That's nothing, though. The real magic happens when you start creating blog -posts, using the front matter to control templates and layouts, and taking -advantage of all the awesome configuration options Jekyll makes available. +* When you run `bundle exec jekyll serve`, Bundler uses the gems and versions as specified in `Gemfile.lock` to ensure your Jekyll site builds with no compatibility or dependency conflicts. -If you're running into problems, ensure you have all the [requirements -installed][Installation]. +`jekyll new ` installs a new Jekyll site at the path specified (relative to current directory). In this case, Jekyll will be installed in a directory called `myblog`. Here are some additional details: -[Installation]: /docs/installation/ +* To install the Jekyll site into the directory you're currently in, run `jekyll new .` If the existing directory isn't empty, you can pass the `--force` option with `jekyll new . --force`. +* `jekyll new` automatically initiates `bundle install` to install the dependencies required. (If you don't want Bundler to install the gems, use `jekyll new myblog --skip-bundle`.) +* By default, Jekyll installs a gem-based theme called [Minima](https://github.com/jekyll/minima). With gem-based themes, some of the theme directories and files are stored in the gem, hidden from view in your Jekyll project. To better understand themes, see [Themes](../themes). + +## Next steps + +Building the default theme is just the first step. The real magic happens when you start creating blog posts, using the front matter to control templates and layouts, and taking advantage of all the awesome configuration options Jekyll makes available. From 93cd0cdb503694670db5f9c7e25e54ca7a3b0722 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Sun, 25 Dec 2016 20:36:25 -0800 Subject: [PATCH 47/65] Improve permalinks docs See https://github.com/jekyll/jekyll/pull/5630 for more details on the update. @jekyll/documentation @DirtyF --- docs/_docs/permalinks.md | 190 +++++++++++++++++++++++++-------------- 1 file changed, 122 insertions(+), 68 deletions(-) diff --git a/docs/_docs/permalinks.md b/docs/_docs/permalinks.md index 31eeb30b..d41d6162 100644 --- a/docs/_docs/permalinks.md +++ b/docs/_docs/permalinks.md @@ -4,27 +4,62 @@ title: Permalinks permalink: /docs/permalinks/ --- -Jekyll supports a flexible way to build your site’s URLs. You can specify the -permalinks for your site through the [Configuration](../configuration/) or in -the [YAML Front Matter](../frontmatter/) for each post. You’re free to choose -one of the built-in styles to create your links or craft your own. The default -style is `date`. +Jekyll supports a flexible way to build the permalinks for your pages, posts, and collections. A permalink is the URL for the page, post, or collection (excluding the domain name or directory folder). -Permalinks are constructed by creating a template URL where dynamic elements -are represented by colon-prefixed keywords. For example, the default `date` -permalink is defined according to the format `/:categories/:year/:month/:day/:title.html`. +You construct permalinks by creating a template URL where dynamic elements are represented by colon-prefixed keywords. The default template permalink is `/:categories/:year/:month/:day/:title.html`. Each of the colon-prefixed keywords is a template variable. +You’re free to construct your own permalink style using the available template variables or choose one of the built-in permalink styles (such as `date`) that automatically use a template-variable pattern. + +## Where to configure permalinks + +You can configure your site's permalinks through the [Configuration]({% link _docs/configuration.md %}) file or in the [Front Matter]({% link _docs/frontmatter.md %}) for each post, page, or collection. + +Setting permalink styles in your configuration file applies the setting globally in your project. You configure permalinks in your `_config.yml` file like this: + +```yaml +permalink: /:categories/:year/:month/:day/:title.html +``` + +If you don't specify any permalink setting, Jekyll uses the above pattern as the default. + +The permalink can also be set using a built-in permalink style: + +```yaml +permalink: date +``` + +`date` is the same as `:categories/:year/:month/:day/:title.html`, the default. See [Built-in Permalink Styles](#builtinpermalinkstyles) below for more options. + +Setting the permalink in your post, page, or collection's front matter overrides any global settings. Here's an example: + +```yaml +--- +title: My page title +permalink: /mypageurl/ +--- +``` + +Even if your configuration file specifies the `date` style, the URL for this page would be `http://somedomain.com/mypageurl/`. + +{% comment %}this note needs clarification
-
Specifying permalinks through the YAML Front Matter
-

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

+
Specifying permalinks through the YAML Front Matter
+

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

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

year

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

month

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

i_month

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

day

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

i_day

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

short_year

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

Year from the Post’s filename

+

Year from the post's filename

-

Month from the Post’s filename

+

Month from the post's filename

-

Month from the Post’s filename without leading zeros.

+

Month from the post's filename without leading zeros.

-

Day from the Post’s filename

+

Day from the post's filename

-

Day from the Post’s filename without leading zeros.

+

Day from the post's filename without leading zeros.

-

Year from the Post’s filename without the century.

+

Year from the post's filename without the century.

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

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

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

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

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

-## Built-in permalink styles +Note that all template variables relating to time or categories are available to posts only. -While you can specify a custom permalink style using [template variables](#template-variables), -Jekyll also provides the following built-in styles for convenience. +## Built-in permalink styles {#builtinpermalinkstyles} + +Although you can specify a custom permalink pattern using [template variables](#template-variables), Jekyll also provides the following built-in styles for convenience.
@@ -203,26 +239,11 @@ Jekyll also provides the following built-in styles for convenience.
-## Pages and collections +Rather than typing `permalink: /:categories/:year/:month/:day/:title/`, you can just type `permalink: date`. -The `permalink` configuration setting specifies the permalink style used for -posts. Pages and collections each have their own default permalink style; the -default style for pages is `/:path/:basename` and the default for collections is -`/:collection/:path`. +## Permalink style examples with posts {#permalink-style-examples} -These styles are modified to match the suffix style specified in the post -permalink setting. For example, a permalink style of `pretty`, which contains a -trailing slash, will update page permalinks to also contain a trailing slash: -`/:path/:basename/`. A permalink style of `date`, which contains a trailing -file extension, will update page permalinks to also contain a file extension: -`/:path/:basename:output_ext`. The same is true for any custom permalink style. - -The permalink for an individual page or collection document can always be -overridden in the [YAML Front Matter](../frontmatter/) for the page or document. -Additionally, permalinks for a given collection can be customized [in the -collections configuration](../collections/). - -## Permalink style examples +Here are a few examples to clarify how permalink styles get applied with posts. Given a post named: `/2009-04-29-slap-chop.md` @@ -280,24 +301,58 @@ Given a post named: `/2009-04-29-slap-chop.md`
-## Extensionless permalinks +## Permalink settings for pages and collections {#pages-and-collections} -Jekyll supports permalinks that contain neither a trailing slash nor a file -extension, but this requires additional support from the web server to properly -serve. When using extensionless permalinks, output files written to disk will -still have the proper file extension (typically `.html`), so the web server -must be able to map requests without file extensions to these files. +The permalink setting in your configuration file specifies the permalink style used for posts, pages, and collections. However, because pages and collections don't have time or categories, these aspects of the permalink style are ignored with pages and collections. -Both [GitHub Pages](../github-pages/) and the Jekyll's built-in WEBrick server -handle these requests properly without any additional work. +For example: + +* A permalink style of `/:categories/:year/:month/:day/:title.html` for posts becomes `/:title.html` for pages and collections. +* A permalink style of `pretty` (or `/:categories/:year/:month/:day/:title/`), which omits the file extension and contains a trailing slash, will update page and collection permalinks to also omit the file extension and contain a trailing slash: `/:title/`. +* A permalink style of `date`, which contains a trailing file extension, will update page permalinks to also contain a trailing file extension: `/:title.html`. But no time or category information will be included. + +## Permalinks and default paths + +The path to the post or page in the built site differs for posts, pages, and collections: + +### Posts + +No matter how many subfolders you organize your posts into inside the `_posts` folder, all posts are pulled out of those subfolders and flattened into the `_site`'s root directory upon build. + +If you use a permalink style that omits the `.html` file extension, each post is rendered as an `index.html` file inside a folder with the post's name (for example, `categoryname/2016/12/01/mypostname/index.html`). + +### Pages + +Unlike posts, pages are *not* removed from their subfolder directories when you build your site. Pages remain in the same folder structure in which you organized your pages in the source directory, except that the structure is now mirrored in `_site`. (The only exception is if your page has a `permalink` declared its front matter — in that case, the structure honors the permalink setting instead of the source folder structure.) + +As with posts, if you use a permalink style that omits the `.html` file extension, each page is rendered as an `index.html` file inserted inside a folder with the page's name (for example, `mypage/index.html`). + +### Collections + +By default, collections follow a similar structure in the `_site` folder as pages, except that the path is prefaced by the collection name. For example: `collectionname/mypage.html`. For permalink settings that omit the file extension, the path would be `collection_name/mypage/index.html`. + +Collections have their own way of setting permalinks. Additionally, collections have unique template variables available available (such as `path` and `output_ext`). See the [Configuring permalinks for collections]( ../collections#permalinks ) in Collections for more information. + +## Flattening pages in \_site on build + +If you want to flatten your pages (pull them out of subfolders) in the `_site` directory when your site builds (similar to posts), add the permalink property of each page's front matter: + +``` +--- +title: My page +permalink: mypageurl.html +--- +``` + +## Extensionless permalinks with no trailing slashes {#extensionless-permalinks} + +Jekyll supports permalinks that contain neither a trailing slash nor a file extension, but this requires additional support from the web server to properly serve. When using extensionless permalinks, output files written to disk will still have the proper file extension (typically `.html`), so the web server must be able to map requests without file extensions to these files. + +Both [GitHub Pages](../github-pages/) and the Jekyll's built-in WEBrick server handle these requests properly without any additional work. ### Apache -The Apache web server has very extensive support for content negotiation and can -handle extensionless URLs by setting the [multiviews][] option in your -`httpd.conf` or `.htaccess` file: - -[multiviews]: https://httpd.apache.org/docs/current/content-negotiation.html#multiviews +The Apache web server has extensive support for content negotiation and can handle extensionless URLs by setting the [multiviews](https://httpd.apache.org/docs/current/content-negotiation.html#multiviews) option in your `httpd.conf` or `.htaccess` file: {% highlight apache %} Options +MultiViews @@ -305,13 +360,12 @@ Options +MultiViews ### Nginx -The [try_files][] directive allows you to specify a list of files to search for -to process a request. The following configuration will instruct nginx to search -for a file with an `.html` extension if an exact match for the requested URI is -not found. - -[try_files]: http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files +The [try_files](http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files) directive allows you to specify a list of files to search for to process a request. The following configuration will instruct nginx to search for a file with an `.html` extension if an exact match for the requested URI is not found. {% highlight nginx %} try_files $uri $uri.html $uri/ =404; {% endhighlight %} + +## Linking without regard to permalink styles + +You can create links in your topics to other posts, pages, or collection items in a way that is valid no matter what permalink configuration you choose. By using the `link` tag, if you change your permalinks, your links won't break. See [Linking to pages](../templates#link) for more details. From 190ea160e50b0e6427212795bc5d38ee7c53075e Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Mon, 26 Dec 2016 20:40:07 -0800 Subject: [PATCH 48/65] Made updates as requested by reviewers Made requested updates. --- docs/_docs/quickstart.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/_docs/quickstart.md b/docs/_docs/quickstart.md index c2d0e79d..3a57ef87 100644 --- a/docs/_docs/quickstart.md +++ b/docs/_docs/quickstart.md @@ -22,6 +22,8 @@ If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGem # Now browse to http://localhost:4000 ``` +## About bundler + `gem install jekyll bundler` installs the [jekyll](https://rubygems.org/gems/jekyll/) and [bundler](https://rubygems.org/gems/bundler) gems through [RubyGems](https://rubygems.org/). You need only to install the gems one time — not every time you create a new Jekyll project. Here are some additional details: * `bundler` is a gem that manages other Ruby gems. It makes sure your gems and gem versions are compatible, and that you have all necessary dependencies each gem requires. @@ -29,12 +31,14 @@ If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGem * When you run `bundle exec jekyll serve`, Bundler uses the gems and versions as specified in `Gemfile.lock` to ensure your Jekyll site builds with no compatibility or dependency conflicts. +## Jekyll new options + `jekyll new ` installs a new Jekyll site at the path specified (relative to current directory). In this case, Jekyll will be installed in a directory called `myblog`. Here are some additional details: * To install the Jekyll site into the directory you're currently in, run `jekyll new .` If the existing directory isn't empty, you can pass the `--force` option with `jekyll new . --force`. * `jekyll new` automatically initiates `bundle install` to install the dependencies required. (If you don't want Bundler to install the gems, use `jekyll new myblog --skip-bundle`.) -* By default, Jekyll installs a gem-based theme called [Minima](https://github.com/jekyll/minima). With gem-based themes, some of the theme directories and files are stored in the gem, hidden from view in your Jekyll project. To better understand themes, see [Themes](../themes). +* By default, the Jekyll site installed by `jekyll new` uses a gem-based theme called [Minima](https://github.com/jekyll/minima). With [gem-based themes](../themes), some of the directories and files are stored in the theme-gem, hidden from your immediate view. ## Next steps -Building the default theme is just the first step. The real magic happens when you start creating blog posts, using the front matter to control templates and layouts, and taking advantage of all the awesome configuration options Jekyll makes available. +Building a Jekyll site with the default theme is just the first step. The real magic happens when you start creating blog posts, using the front matter to control templates and layouts, and taking advantage of all the awesome configuration options Jekyll makes available. From adc619ca6c418fe90b0d242309db39224bd1a94a Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Wed, 28 Dec 2016 15:21:57 -0800 Subject: [PATCH 49/65] added info about jekyll new --help --- docs/_docs/quickstart.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/_docs/quickstart.md b/docs/_docs/quickstart.md index 3a57ef87..8c509fab 100644 --- a/docs/_docs/quickstart.md +++ b/docs/_docs/quickstart.md @@ -22,7 +22,7 @@ If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGem # Now browse to http://localhost:4000 ``` -## About bundler +## About Bundler `gem install jekyll bundler` installs the [jekyll](https://rubygems.org/gems/jekyll/) and [bundler](https://rubygems.org/gems/bundler) gems through [RubyGems](https://rubygems.org/). You need only to install the gems one time — not every time you create a new Jekyll project. Here are some additional details: @@ -31,13 +31,14 @@ If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGem * When you run `bundle exec jekyll serve`, Bundler uses the gems and versions as specified in `Gemfile.lock` to ensure your Jekyll site builds with no compatibility or dependency conflicts. -## Jekyll new options +## Options for creating a new site with Jekyll `jekyll new ` installs a new Jekyll site at the path specified (relative to current directory). In this case, Jekyll will be installed in a directory called `myblog`. Here are some additional details: * To install the Jekyll site into the directory you're currently in, run `jekyll new .` If the existing directory isn't empty, you can pass the `--force` option with `jekyll new . --force`. * `jekyll new` automatically initiates `bundle install` to install the dependencies required. (If you don't want Bundler to install the gems, use `jekyll new myblog --skip-bundle`.) * By default, the Jekyll site installed by `jekyll new` uses a gem-based theme called [Minima](https://github.com/jekyll/minima). With [gem-based themes](../themes), some of the directories and files are stored in the theme-gem, hidden from your immediate view. +* To learn about other parameters you can include with `jekyll new`, type ` jekyll new --help`. ## Next steps From 1bc82b9c8a28e2170e3ac256dde01b4cf265e016 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 28 Dec 2016 22:54:37 -0700 Subject: [PATCH 50/65] Fix script/stackprof & add some GC stats. When running 'script/stackprof object', I noticed that it would be helpful to see GC information. It appears we create a lot of junk -- a source of optimization if we decide to go down that path. An average Jekyll build doesn't run a GC, but auto-regeneration likely would eventually require a GC run and it would be interesting to see if we can reduce how much we throw away with each call to 'site.process'. --- script/stackprof | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/script/stackprof b/script/stackprof index 1c833142..f78f11aa 100755 --- a/script/stackprof +++ b/script/stackprof @@ -10,13 +10,17 @@ esac export BENCHMARK=true command -v stackprof > /dev/null || script/bootstrap -TEST_SCRIPT="Jekyll::Commands::Build.process({'source' => 'site'})" +TEST_SCRIPT="Jekyll::Commands::Build.process({'source' => 'docs'})" PROF_OUTPUT_FILE=tmp/stackprof-${STACKPROF_MODE}-$(date +%Y%m%d%H%M).dump +GC_BEFORE="puts 'GC Stats:'; puts JSON.pretty_generate(GC.stat); GC.disable" +GC_AFTER="puts 'GC Stats:'; GC.start(full_mark: true, immediate_sweep: false); puts JSON.pretty_generate(GC.stat);" + echo Stackprof Mode: $STACKPROF_MODE test -f "$PROF_OUTPUT_FILE" || { - bundle exec ruby -r./lib/jekyll -rstackprof \ - -e "StackProf.run(mode: :${STACKPROF_MODE}, interval: 100, out: '${PROF_OUTPUT_FILE}') { ${TEST_SCRIPT} }" + bundle exec ruby -r./lib/jekyll -rstackprof -rjson \ + -e "StackProf.run(mode: :${STACKPROF_MODE}, interval: 100, out: '${PROF_OUTPUT_FILE}') { ${GC_BEFORE}; ${TEST_SCRIPT}; ${GC_AFTER}; }" } -bundle exec stackprof $PROF_OUTPUT_FILE $@ +set -x +bundle exec stackprof $PROF_OUTPUT_FILE $@ --sort-total From b1b0d00c5a0dfd31c3991bde976b9d10341abfde Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Wed, 28 Dec 2016 23:42:37 -0800 Subject: [PATCH 51/65] made updates - made updates from Parkr's review - update to Extensionless permalinks section - update to note about not using built-in perm styles in front matter - update for readability in places --- docs/_docs/permalinks.md | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/docs/_docs/permalinks.md b/docs/_docs/permalinks.md index d41d6162..b8fd5ec6 100644 --- a/docs/_docs/permalinks.md +++ b/docs/_docs/permalinks.md @@ -4,12 +4,11 @@ title: Permalinks permalink: /docs/permalinks/ --- -Jekyll supports a flexible way to build the permalinks for your pages, posts, and collections. A permalink is the URL for the page, post, or collection (excluding the domain name or directory folder). +Permalinks refer to the URLs (excluding the domain name or directory folder) for your pages, posts, or collections. +Jekyll supports a flexible way to build permalinks, allowing you to leverage various template variables or choose built-in permalink styles (such as `date`) that automatically use a template-variable pattern. You construct permalinks by creating a template URL where dynamic elements are represented by colon-prefixed keywords. The default template permalink is `/:categories/:year/:month/:day/:title.html`. Each of the colon-prefixed keywords is a template variable. -You’re free to construct your own permalink style using the available template variables or choose one of the built-in permalink styles (such as `date`) that automatically use a template-variable pattern. - ## Where to configure permalinks You can configure your site's permalinks through the [Configuration]({% link _docs/configuration.md %}) file or in the [Front Matter]({% link _docs/frontmatter.md %}) for each post, page, or collection. @@ -41,21 +40,14 @@ permalink: /mypageurl/ Even if your configuration file specifies the `date` style, the URL for this page would be `http://somedomain.com/mypageurl/`. -{% comment %}this note needs clarification -
-
Specifying permalinks through the YAML Front Matter
-

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

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

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

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

/:year/:month/:title

-

See extensionless permalinks for details.

+

See Extensionless permalinks with no trailing slashes for details.

/2009/04/slap-chop

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

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

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

year

-
-

Year from the Post’s filename

-
-

month

-
-

Month from the Post’s filename

-
-

i_month

-
-

Month from the Post’s filename without leading zeros.

-
-

day

-
-

Day from the Post’s filename

-
-

i_day

-
-

Day from the Post’s filename without leading zeros.

-
-

short_year

-
-

Year from the Post’s filename without the century.

-
-

hour

-
-

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

-
-

minute

-
-

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

-
-

second

-
-

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

-
-

title

-
-

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

-
-

slug

-
-

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

-
-

categories

-
-

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

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

date

-
-

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

-
-

pretty

-
-

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

-
-

ordinal

-
-

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

-
-

none

-
-

/:categories/:title.html

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

None specified, or permalink: date

-
-

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

-
-

pretty

-
-

/2009/04/29/slap-chop/

-
-

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

-
-

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

-
-

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

-
-

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

-
-

/:year/:month/:title

-

See extensionless permalinks for details.

-
-

/2009/04/slap-chop

-
-
- -## Extensionless permalinks - -Jekyll supports permalinks that contain neither a trailing slash nor a file -extension, but this requires additional support from the web server to properly -serve. When using extensionless permalinks, output files written to disk will -still have the proper file extension (typically `.html`), so the web server -must be able to map requests without file extensions to these files. - -Both [GitHub Pages](../github-pages/) and the Jekyll's built-in WEBrick server -handle these requests properly without any additional work. - -### Apache - -The Apache web server has very extensive support for content negotiation and can -handle extensionless URLs by setting the [multiviews][] option in your -`httpd.conf` or `.htaccess` file: - -[multiviews]: https://httpd.apache.org/docs/current/content-negotiation.html#multiviews - -{% highlight apache %} -Options +MultiViews -{% endhighlight %} - -### Nginx - -The [try_files][] directive allows you to specify a list of files to search for -to process a request. The following configuration will instruct nginx to search -for a file with an `.html` extension if an exact match for the requested URI is -not found. - -[try_files]: http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files - -{% highlight nginx %} -try_files $uri $uri.html $uri/ =404; -{% endhighlight %} +Building a Jekyll site with the default theme is just the first step. The real magic happens when you start creating blog posts, using the front matter to control templates and layouts, and taking advantage of all the awesome configuration options Jekyll makes available. From 6a2c7f271821af449ee3de4eb16ea72c47f949b0 Mon Sep 17 00:00:00 2001 From: Rob Crocombe Date: Thu, 29 Dec 2016 10:20:15 +0000 Subject: [PATCH 53/65] Add Jekyll-Post to plugins.md --- docs/_docs/plugins.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_docs/plugins.md b/docs/_docs/plugins.md index cc1995ad..775dabbf 100644 --- a/docs/_docs/plugins.md +++ b/docs/_docs/plugins.md @@ -918,6 +918,7 @@ LESS.js files during generation. - [jekyll-data](https://github.com/ashmaroli/jekyll-data): Read data files within Jekyll Theme Gems. - [jekyll-pinboard](https://github.com/snaptortoise/jekyll-pinboard-plugin): Access your Pinboard bookmarks within your Jekyll theme. - [jekyll-migrate-permalink](https://github.com/mpchadwick/jekyll-migrate-permalink): Adds a `migrate-permalink` sub-command to help deal with side effects of changing your permalink. +- [Jekyll-Post](https://github.com/robcrocombe/jekyll-post): A CLI tool to easily draft, edit, and publish Jekyll posts. #### Editors From 57d6d5986feb912fd4c4241a29d9a86980a9d91f Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Thu, 29 Dec 2016 08:27:42 -0800 Subject: [PATCH 54/65] update quickstart.md I must have just updated the wrong doc or branch in the last commit. i hope this fixes it. --- docs/_docs/quickstart.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_docs/quickstart.md b/docs/_docs/quickstart.md index 8c509fab..d15a9eb1 100644 --- a/docs/_docs/quickstart.md +++ b/docs/_docs/quickstart.md @@ -27,7 +27,7 @@ If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGem `gem install jekyll bundler` installs the [jekyll](https://rubygems.org/gems/jekyll/) and [bundler](https://rubygems.org/gems/bundler) gems through [RubyGems](https://rubygems.org/). You need only to install the gems one time — not every time you create a new Jekyll project. Here are some additional details: * `bundler` is a gem that manages other Ruby gems. It makes sure your gems and gem versions are compatible, and that you have all necessary dependencies each gem requires. -* The `Gemfile` and `Gemfile.lock` files inform Bundler about the gem requirements in your theme. If your theme doesn't have these Gemfiles, you can omit `bundle exec` and just run `jekyll serve`. +* The `Gemfile` and `Gemfile.lock` files inform Bundler about the gem requirements in your site. If your site doesn't have these Gemfiles, you can omit `bundle exec` and just run `jekyll serve`. * When you run `bundle exec jekyll serve`, Bundler uses the gems and versions as specified in `Gemfile.lock` to ensure your Jekyll site builds with no compatibility or dependency conflicts. @@ -38,7 +38,7 @@ If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGem * To install the Jekyll site into the directory you're currently in, run `jekyll new .` If the existing directory isn't empty, you can pass the `--force` option with `jekyll new . --force`. * `jekyll new` automatically initiates `bundle install` to install the dependencies required. (If you don't want Bundler to install the gems, use `jekyll new myblog --skip-bundle`.) * By default, the Jekyll site installed by `jekyll new` uses a gem-based theme called [Minima](https://github.com/jekyll/minima). With [gem-based themes](../themes), some of the directories and files are stored in the theme-gem, hidden from your immediate view. -* To learn about other parameters you can include with `jekyll new`, type ` jekyll new --help`. +* To learn about other parameters you can include with `jekyll new`, type `jekyll new --help`. ## Next steps From 192e79ed1e84298ffc07c3ce4ca4ffa2e6bd0534 Mon Sep 17 00:00:00 2001 From: Tom Johnson Date: Thu, 29 Dec 2016 08:57:39 -0800 Subject: [PATCH 55/65] reset permalinks to same state it was in in patch-3 branch. i couldn't seem to remove it from the previous commit. --- docs/_docs/permalinks.md | 326 +++++++++++++++++++++++++++++++++++---- 1 file changed, 299 insertions(+), 27 deletions(-) diff --git a/docs/_docs/permalinks.md b/docs/_docs/permalinks.md index d15a9eb1..557a53f9 100644 --- a/docs/_docs/permalinks.md +++ b/docs/_docs/permalinks.md @@ -1,45 +1,317 @@ --- layout: docs -title: Quick-start guide -permalink: /docs/quickstart/ +title: Permalinks +permalink: /docs/permalinks/ --- -If you already have [Ruby](https://www.ruby-lang.org/en/downloads/) and [RubyGems](https://rubygems.org/pages/download) installed (see Jekyll's [requirements](/docs/installation/#requirements/)), you can create a new Jekyll site by doing the following: +Jekyll supports a flexible way to build your site’s URLs. You can specify the +permalinks for your site through the [Configuration](../configuration/) or in +the [YAML Front Matter](../frontmatter/) for each post. You’re free to choose +one of the built-in styles to create your links or craft your own. The default +style is `date`. -```sh -# Install Jekyll and Bundler gems through RubyGems -~ $ gem install jekyll bundler +Permalinks are constructed by creating a template URL where dynamic elements +are represented by colon-prefixed keywords. For example, the default `date` +permalink is defined according to the format `/:categories/:year/:month/:day/:title.html`. -# Create a new Jekyll site at ./myblog -~ $ jekyll new myblog +
+
Specifying permalinks through the YAML Front Matter
+

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

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

year

+
+

Year from the Post’s filename

+
+

month

+
+

Month from the Post’s filename

+
+

i_month

+
+

Month from the Post’s filename without leading zeros.

+
+

day

+
+

Day from the Post’s filename

+
+

i_day

+
+

Day from the Post’s filename without leading zeros.

+
+

short_year

+
+

Year from the Post’s filename without the century.

+
+

hour

+
+

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

+
+

minute

+
+

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

+
+

second

+
+

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

+
+

title

+
+

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

+
+

slug

+
+

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

+
+

categories

+
+

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

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

date

+
+

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

+
+

pretty

+
+

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

+
+

ordinal

+
+

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

+
+

none

+
+

/:categories/:title.html

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

None specified, or permalink: date

+
+

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

+
+

pretty

+
+

/2009/04/29/slap-chop/

+
+

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

+
+

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

+
+

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

+
+

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

+
+

/:year/:month/:title

+

See extensionless permalinks for details.

+
+

/2009/04/slap-chop

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