From e0b8539670b9cbc24175d9816241567e9eea74ae Mon Sep 17 00:00:00 2001 From: Shinnosuke Kondo Date: Mon, 13 Jul 2015 17:47:42 -0500 Subject: [PATCH 01/65] Added a new case for test_clearner where a directory is not in keep_files, but its path contains a string in keep_files. --- test/test_cleaner.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/test/test_cleaner.rb b/test/test_cleaner.rb index 819dbf5c..c96394d7 100644 --- a/test/test_cleaner.rb +++ b/test/test_cleaner.rb @@ -37,6 +37,40 @@ class TestCleaner < JekyllUnitTest end end + context "not-nested directory in keep_files and similary named directory not in keep_files" do + setup do + clear_dest + + FileUtils.mkdir_p(dest_dir('.git/child_dir')) + FileUtils.mkdir_p(dest_dir('username.github.io')) + FileUtils.touch(File.join(dest_dir('.git'), 'index.html')) + FileUtils.touch(File.join(dest_dir('username.github.io'), 'index.html')) + + @site = fixture_site + @site.keep_files = ['.git'] + + @cleaner = Cleaner.new(@site) + @cleaner.cleanup! + end + + teardown do + FileUtils.rm_rf(dest_dir('.git')) + FileUtils.rm_rf(dest_dir('.username.github.io')) + end + + should "keep the file in the directory in keep_files" do + assert File.exist?(File.join(dest_dir('.git'), 'index.html')) + end + + should "delete the file in the directory not in keep_files" do + assert !File.exist?(File.join(dest_dir('username.github.io'), 'index.html')) + end + + should "delete the directory not in keep_files" do + assert !File.exist?(dest_dir('username.github.io')) + end + end + context "directory containing no files and non-empty directories" do setup do clear_dest From 3b60237cb152aa19526902d30bd02feb39a71f24 Mon Sep 17 00:00:00 2001 From: Shinnosuke Kondo Date: Mon, 13 Jul 2015 18:34:40 -0500 Subject: [PATCH 02/65] Fix keep_files to be used as paths relative to the destination. They were used as keywords to match files containing them in the paths. --- lib/jekyll/cleaner.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb index 70bd2f79..2a00a737 100644 --- a/lib/jekyll/cleaner.rb +++ b/lib/jekyll/cleaner.rb @@ -94,11 +94,12 @@ module Jekyll # Private: Creates a regular expression from the config's keep_files array # # Examples - # ['.git','.svn'] creates the following regex: /\/(\.git|\/.svn)/ + # ['.git','.svn'] with site.dest "/myblog/_site" creates + # the following regex: /\/myblog\/_site\/(\.git|\/.svn)/ # # Returns the regular expression def keep_file_regex - Regexp.union(site.keep_files) + /#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})/ end end end From 1eb626b1dfdcb90cbc6f48c0b67b665ed71fccbe Mon Sep 17 00:00:00 2001 From: Shinnosuke Kondo Date: Mon, 13 Jul 2015 19:08:11 -0500 Subject: [PATCH 03/65] Fix keep_files not to match a file with repeated path. --- lib/jekyll/cleaner.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb index 2a00a737..509cebb1 100644 --- a/lib/jekyll/cleaner.rb +++ b/lib/jekyll/cleaner.rb @@ -95,11 +95,11 @@ module Jekyll # # Examples # ['.git','.svn'] with site.dest "/myblog/_site" creates - # the following regex: /\/myblog\/_site\/(\.git|\/.svn)/ + # the following regex: /\A\/myblog\/_site\/(\.git|\/.svn)/ # # Returns the regular expression def keep_file_regex - /#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})/ + /\A#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})/ end end end From 3373eb65257789b62b5eafcb4512c37c7151a6ed Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 7 Feb 2016 17:28:03 -0800 Subject: [PATCH 04/65] EntryFilter#special?: ignore filenames which begin with '~' --- lib/jekyll/entry_filter.rb | 2 +- test/test_entry_filter.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/entry_filter.rb b/lib/jekyll/entry_filter.rb index 6d42c067..48509f9d 100644 --- a/lib/jekyll/entry_filter.rb +++ b/lib/jekyll/entry_filter.rb @@ -1,6 +1,6 @@ module Jekyll class EntryFilter - SPECIAL_LEADING_CHARACTERS = ['.', '_', '#'].freeze + SPECIAL_LEADING_CHARACTERS = ['.', '_', '#', '~'].freeze attr_reader :site diff --git a/test/test_entry_filter.rb b/test/test_entry_filter.rb index c0ce59b3..546f0252 100644 --- a/test/test_entry_filter.rb +++ b/test/test_entry_filter.rb @@ -8,7 +8,7 @@ class TestEntryFilter < JekyllUnitTest should "filter entries" do ent1 = %w[foo.markdown bar.markdown baz.markdown #baz.markdown# - .baz.markdow foo.markdown~ .htaccess _posts _pages] + .baz.markdow foo.markdown~ .htaccess _posts _pages ~$benbalter.docx] entries = EntryFilter.new(@site).filter(ent1) assert_equal %w[foo.markdown bar.markdown baz.markdown .htaccess], entries From 246e65914ffef6affb7b699de6fcd496168c332e Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 7 Feb 2016 17:52:15 -0800 Subject: [PATCH 05/65] Jekyll.sanitized_path: sanitizing a questionable path should handle tildes --- lib/jekyll.rb | 3 ++- test/test_path_sanitization.rb | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 8b92a045..6896bb0b 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -153,8 +153,9 @@ module Jekyll def sanitized_path(base_directory, questionable_path) return base_directory if base_directory.eql?(questionable_path) + questionable_path.insert(0, '/') if questionable_path.start_with?('~') clean_path = File.expand_path(questionable_path, "/") - clean_path = clean_path.sub(/\A\w\:\//, '/') + clean_path.sub!(/\A\w\:\//, '/') if clean_path.start_with?(base_directory.sub(/\A\w\:\//, '/')) clean_path diff --git a/test/test_path_sanitization.rb b/test/test_path_sanitization.rb index b04a2bad..148103ea 100644 --- a/test/test_path_sanitization.rb +++ b/test/test_path_sanitization.rb @@ -15,4 +15,13 @@ class TestPathSanitization < JekyllUnitTest assert_equal "/tmp/foobar/jail/..c:/..c:/..c:/etc/passwd", Jekyll.sanitized_path("/tmp/foobar/jail", "..c:/..c:/..c:/etc/passwd") end end + + should "escape tilde" do + assert_equal source_dir("~hi.txt"), Jekyll.sanitized_path(source_dir, "~hi.txt") + assert_equal source_dir("files", "~hi.txt"), Jekyll.sanitized_path(source_dir, "files/../files/~hi.txt") + end + + should "remove path traversals" do + assert_equal source_dir("files", "hi.txt"), Jekyll.sanitized_path(source_dir, "f./../../../../../../files/hi.txt") + end end From 0e89a37eaf7a426181b489fe0325081f4b7cda66 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 7 Feb 2016 17:53:09 -0800 Subject: [PATCH 06/65] Revert "Jekyll.sanitized_path: sanitizing a questionable path should handle tildes" This reverts commit 246e65914ffef6affb7b699de6fcd496168c332e. --- lib/jekyll.rb | 3 +-- test/test_path_sanitization.rb | 9 --------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/jekyll.rb b/lib/jekyll.rb index 6896bb0b..8b92a045 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -153,9 +153,8 @@ module Jekyll def sanitized_path(base_directory, questionable_path) return base_directory if base_directory.eql?(questionable_path) - questionable_path.insert(0, '/') if questionable_path.start_with?('~') clean_path = File.expand_path(questionable_path, "/") - clean_path.sub!(/\A\w\:\//, '/') + clean_path = clean_path.sub(/\A\w\:\//, '/') if clean_path.start_with?(base_directory.sub(/\A\w\:\//, '/')) clean_path diff --git a/test/test_path_sanitization.rb b/test/test_path_sanitization.rb index 148103ea..b04a2bad 100644 --- a/test/test_path_sanitization.rb +++ b/test/test_path_sanitization.rb @@ -15,13 +15,4 @@ class TestPathSanitization < JekyllUnitTest assert_equal "/tmp/foobar/jail/..c:/..c:/..c:/etc/passwd", Jekyll.sanitized_path("/tmp/foobar/jail", "..c:/..c:/..c:/etc/passwd") end end - - should "escape tilde" do - assert_equal source_dir("~hi.txt"), Jekyll.sanitized_path(source_dir, "~hi.txt") - assert_equal source_dir("files", "~hi.txt"), Jekyll.sanitized_path(source_dir, "files/../files/~hi.txt") - end - - should "remove path traversals" do - assert_equal source_dir("files", "hi.txt"), Jekyll.sanitized_path(source_dir, "f./../../../../../../files/hi.txt") - end end From d387fd0baab65675dbd973189db14359d36e4d54 Mon Sep 17 00:00:00 2001 From: Henry Goodman Date: Wed, 17 Feb 2016 00:29:57 -0800 Subject: [PATCH 07/65] Add show_dir_listing option for serve command --- lib/jekyll/commands/serve.rb | 4 ++++ lib/jekyll/configuration.rb | 1 + test/test_commands_serve.rb | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/lib/jekyll/commands/serve.rb b/lib/jekyll/commands/serve.rb index 29408fe2..69ea8ba7 100644 --- a/lib/jekyll/commands/serve.rb +++ b/lib/jekyll/commands/serve.rb @@ -10,6 +10,8 @@ module Jekyll "ssl_key" => ["--ssl-key [KEY]", "X.509 (SSL) Private Key."], "port" => ["-P", "--port [PORT]", "Port to listen on"], "baseurl" => ["-b", "--baseurl [URL]", "Base URL"], + "show_dir_listing" => ["--show-dir-listing", + "Show a directory listing instead of loading your index file."], "skip_initial_build" => ["skip_initial_build", "--skip-initial-build", "Skips the initial site build which occurs before the server is started."] } @@ -91,6 +93,8 @@ module Jekyll ) } + opts[:DirectoryIndex] = [] if opts[:JekyllOptions]['show_dir_listing'] + enable_ssl(opts) enable_logging(opts) opts diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index 0f8618a1..cf499aa2 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -44,6 +44,7 @@ module Jekyll 'port' => '4000', 'host' => '127.0.0.1', 'baseurl' => '', + 'show_dir_listing' => false, # Output Configuration 'permalink' => 'date', diff --git a/test/test_commands_serve.rb b/test/test_commands_serve.rb index 87472c3d..9fd3c1db 100644 --- a/test/test_commands_serve.rb +++ b/test/test_commands_serve.rb @@ -68,6 +68,11 @@ class TestCommandsServe < JekyllUnitTest ] end + should "use empty directory index list when show_dir_listing is true" do + opts = { "show_dir_listing" => true } + assert custom_opts(opts)[:DirectoryIndex].empty? + end + context "verbose" do should "debug when verbose" do assert_equal custom_opts({ "verbose" => true })[:Logger].level, 5 From 551f8b751fbe1da8c920ecfd81cf747ce3c1ed74 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 18 Feb 2016 16:56:39 -0800 Subject: [PATCH 08/65] `jekyll new` should create a Gemfile which is educational --- lib/jekyll/commands/new.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/jekyll/commands/new.rb b/lib/jekyll/commands/new.rb index 433d33b7..0af8553b 100644 --- a/lib/jekyll/commands/new.rb +++ b/lib/jekyll/commands/new.rb @@ -35,6 +35,10 @@ module Jekyll File.open(File.expand_path(initialized_post_name, new_blog_path), "w") do |f| f.write(scaffold_post_content) end + + File.open(File.expand_path("Gemfile", new_blog_path), "w") do |f| + f.write(gemfile_contents) + end end Jekyll.logger.info "New jekyll site installed in #{new_blog_path}." @@ -59,6 +63,27 @@ module Jekyll end private + + def gemfile_contents + <<-RUBY +source 'https://rubygems.org' + +# Hello! This is where you manage which Jekyll version is used to run. +# When you wwant to use a different version, change it below, save the +# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: +# +# bundle exec jekyll serve +# +# This will help ensure the proper Jekyll version is running. +# Happy Jekylling! +gem 'jekyll', '#{Jekyll::VERSION}' + +# If you have any plugins, put them here! +# group :jekyll_plugins do +# gem 'jekyll-github-metadata', '~> 1.0' +# end +RUBY + end def preserve_source_location?(path, options) !options["force"] && !Dir["#{path}/**/*"].empty? From b80a0cb5cea2424922ee3ce5184f9af5c46ec196 Mon Sep 17 00:00:00 2001 From: Jeff Kolesky Date: Wed, 2 Mar 2016 14:54:47 -0800 Subject: [PATCH 09/65] Adds collection_tag This tag mirrors the post_tag functionality but for collections instead of just posts. --- lib/jekyll/tags/collection_url.rb | 47 ++++++++++++++++++++ test/test_tags.rb | 71 +++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 lib/jekyll/tags/collection_url.rb diff --git a/lib/jekyll/tags/collection_url.rb b/lib/jekyll/tags/collection_url.rb new file mode 100644 index 00000000..bdd9d398 --- /dev/null +++ b/lib/jekyll/tags/collection_url.rb @@ -0,0 +1,47 @@ +module Jekyll + module Tags + class CollectionUrl < Liquid::Tag + TagName = 'collection_url' + MATCHER = /^([\w-]+)\s+\/?(.*)$/ + + def initialize(tag_name, markup, tokens) + super + orig_markup = markup.strip + all, @collection, @item_name = *orig_markup.match(MATCHER) + unless all + raise ArgumentError.new <<-eos +Could not parse the collection or item "#{markup}" in tag '#{TagName}'. + +Valid syntax: #{TagName} +eos + end + + @path_regex = /^\/#{@item_name}$/ + end + + def render(context) + site = context.registers[:site] + + if site.collections[@collection] + site.collections[@collection].docs.each do |p| + return p.url if p.cleaned_relative_path.match(@path_regex) + end + + raise ArgumentError.new <<-eos +Could not find item "#{@item_name}" in collection "#{@collection}" in tag '#{TagName}'. + +Make sure the item exists and the name is correct. +eos + else + raise ArgumentError.new <<-eos +Could not find collection "#{@collection}" in tag '#{TagName}' + +Make sure the collection exists and the name is correct. +eos + end + end + end + end +end + +Liquid::Template.register_tag(Jekyll::Tags::CollectionUrl::TagName, Jekyll::Tags::CollectionUrl) diff --git a/test/test_tags.rb b/test/test_tags.rb index f263e9d8..83ae9f87 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -14,6 +14,10 @@ class TestTags < JekyllUnitTest if override['read_posts'] site.posts.docs.concat(PostReader.new(site).read_posts('')) end + if override['read_collections'] + # puts "reading collections" + CollectionReader.new(site).read + end info = { :filters => [Jekyll::Filters], :registers => { :site => site } } @converter = site.converters.find { |c| c.class == converter_class } @@ -476,6 +480,73 @@ CONTENT end end + context "simple page with collection linking" do + setup do + content = < source_dir, 'destination' => dest_dir, 'collections' => { 'methods' => {}}, 'read_collections' => true}) + end + + should "not cause an error" do + refute_match /markdown\-html\-error/, @result + end + + should "have the url to the \"yaml_with_dots\" item" do + assert_match %r{/methods/yaml_with_dots}, @result + end + end + + context "simple page with nested collection linking" do + setup do + content = < source_dir, 'destination' => dest_dir, 'collections' => { 'methods' => {}}, 'read_collections' => true}) + end + + should "not cause an error" do + refute_match /markdown\-html\-error/, @result + end + + should "have the url to the \"sanitized_path\" item" do + assert_match %r{1\s/methods/sanitized_path}, @result + assert_match %r{2\s/methods/sanitized_path}, @result + end + + should "have the url to the \"site/generate\" item" do + assert_match %r{3\s/methods/site/generate}, @result + assert_match %r{4\s/methods/site/generate}, @result + end + end + + context "simple page with invalid collection linking" do + should "cause an error" do + content = < source_dir, 'destination' => dest_dir, 'collections' => { 'methods' => {}}, 'read_collections' => true}) + end + end + end + context "include tag with parameters" do context "with symlink'd include" do From 46bdaa49dc8546a54af795f678691dd9c671a70f Mon Sep 17 00:00:00 2001 From: surrim Date: Sat, 5 Mar 2016 23:31:16 +0100 Subject: [PATCH 10/65] using FileUtils.copy_entry instead of FileUtils.cp to allow symlinks --- lib/jekyll/static_file.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index 0ed0fbfe..4e1f957c 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -80,7 +80,7 @@ module Jekyll FileUtils.mkdir_p(File.dirname(dest_path)) FileUtils.rm(dest_path) if File.exist?(dest_path) - FileUtils.cp(path, dest_path) + FileUtils.copy_entry(path, dest_path) File.utime(@@mtimes[path], @@mtimes[path], dest_path) true From 52eb60e1719b1c386eaca72d9cec8c444072efe8 Mon Sep 17 00:00:00 2001 From: surrim Date: Fri, 11 Mar 2016 18:45:40 +0100 Subject: [PATCH 11/65] use copy_entry only in safe mode --- lib/jekyll/static_file.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index 4e1f957c..d888aff0 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -80,7 +80,11 @@ module Jekyll FileUtils.mkdir_p(File.dirname(dest_path)) FileUtils.rm(dest_path) if File.exist?(dest_path) - FileUtils.copy_entry(path, dest_path) + if @site.safe || Jekyll.env.start_with?("prod") + FileUtils.cp(path, dest_path) + else + FileUtils.copy_entry(path, dest_path) + end File.utime(@@mtimes[path], @@mtimes[path], dest_path) true From 64d5e3dfd3215540b37878eb1c7f485ce4a65f5f Mon Sep 17 00:00:00 2001 From: surrim Date: Fri, 11 Mar 2016 19:23:37 +0100 Subject: [PATCH 12/65] removed "env=prod"-condition --- lib/jekyll/static_file.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index d888aff0..33155aea 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -80,7 +80,7 @@ module Jekyll FileUtils.mkdir_p(File.dirname(dest_path)) FileUtils.rm(dest_path) if File.exist?(dest_path) - if @site.safe || Jekyll.env.start_with?("prod") + if @site.safe FileUtils.cp(path, dest_path) else FileUtils.copy_entry(path, dest_path) From 15e7c30cc71155373d442b709bed623986fad13f Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 10 Mar 2016 11:26:57 -0800 Subject: [PATCH 13/65] Fixes typo on collections There was a line referring to the `render` key in `_config.yml` but the actual name of the key is `output`. Thank you, @parkr! --- site/_docs/collections.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/site/_docs/collections.md b/site/_docs/collections.md index ede3ffef..87c7c8e9 100644 --- a/site/_docs/collections.md +++ b/site/_docs/collections.md @@ -303,11 +303,8 @@ file, each document has the following attributes:

- The URL of the rendered collection. The file is only written to the - destination when the name of the collection to which it belongs is - included in the render key in the site's configuration - file. -

+ The URL of the rendered collection. The file is only written to the destination when the collection to which it belongs has output: true in the site's configuration. +

From e33574b391198027d3a7b20eb4192a8bd8bdc8e4 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Fri, 11 Mar 2016 17:43:23 -0600 Subject: [PATCH 14/65] Update history to reflect merge of #4647 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 35a01ad5..011d0ccd 100644 --- a/History.markdown +++ b/History.markdown @@ -40,6 +40,7 @@ * Document that subdirectories of `_posts` are no longer categories (#4639) * Update continuous-integration docs with sudo: false information (#4628) * Blog post on refreshed contributing file and new affinity teams (#4645) + * Fixes typo on collections (#4647) ## 3.1.2 / 2016-02-19 From 417b5a3b2e04e35f03a7737c9fe13fb4caf4ad31 Mon Sep 17 00:00:00 2001 From: Suriyaa Kudo Date: Sat, 12 Mar 2016 12:42:04 +0100 Subject: [PATCH 15/65] Improved content in "License" section in README.markdown --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 5caaa1eb..d3128bcf 100644 --- a/README.markdown +++ b/README.markdown @@ -55,4 +55,4 @@ and we will address it as soon as possible. ## License -See [LICENSE](https://github.com/jekyll/jekyll/blob/master/LICENSE). +See the [LICENSE](https://github.com/jekyll/jekyll/blob/master/LICENSE) file. From ebe46f1ddc20183d44532234490752b61eca60b2 Mon Sep 17 00:00:00 2001 From: Suriyaa Kudo Date: Sat, 12 Mar 2016 12:46:59 +0100 Subject: [PATCH 16/65] Set protocol of Stack Overflow to HTTPS --- site/help/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/help/index.md b/site/help/index.md index 11213471..46ddcd4d 100644 --- a/site/help/index.md +++ b/site/help/index.md @@ -27,7 +27,7 @@ Add **jekyll** to almost any query, and you'll find just what you need. Jekyll Talk is our official Discourse forum. Here, users and contributors can ask questions and discuss all aspects of Jekyll. -### [Jekyll on StackOverflow](http://stackoverflow.com/questions/tagged/jekyll) +### [Jekyll on StackOverflow](https://stackoverflow.com/questions/tagged/jekyll) StackOverflow is a staple of any developer's diet. Check out the Jekyll tag on StackOverflow for an answer to your question. Not there? Ask a new From 3014444b0eccbdb54a9c7c8f7b3b1881a12e75d5 Mon Sep 17 00:00:00 2001 From: Suriyaa Kudo Date: Sat, 12 Mar 2016 12:51:58 +0100 Subject: [PATCH 17/65] Set protocol of jekyllrb.com to HTTPS --- .github/CONTRIBUTING.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.markdown b/.github/CONTRIBUTING.markdown index 170b8819..8181037a 100644 --- a/.github/CONTRIBUTING.markdown +++ b/.github/CONTRIBUTING.markdown @@ -15,7 +15,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots * [Install Jekyll on your computer](https://jekyllrb.com/docs/installation/) and kick the tires. Does it work? Does it do what you'd expect? If not, [open an issue](https://github.com/jekyll/jekyll/issues/new) and let us know. * Comment on some of the project's [open issues](https://github.com/jekyll/jekyll/issues). Have you experienced the same problem? Know a work around? Do you have a suggestion for how the feature could be better? -* Read through [the documentation](http://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion for something that could be improved. +* Read through [the documentation](https://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion for something that could be improved. * Browse through [the Jekyll discussion forum](https://talk.jekyllrb.com/), and lend a hand answering questions. There's a good chance you've already experienced what another user is experiencing. * Find [an open issue](https://github.com/jekyll/jekyll/issues) (especially [those labeled `help-wanted`](https://github.com/jekyll/jekyll/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted)), and submit a proposed fix. If it's your first pull request, we promise we won't bite, and are glad to answer any questions. * Help evaluate [open pull requests](https://github.com/jekyll/jekyll/pulls), by testing the changes locally and reviewing what's proposed. @@ -68,7 +68,7 @@ One gotcha, all pull requests should be directed at the `master` branch (the def ### Adding plugins -If you want to add your plugin to the [list of plugins](http://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](site/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type. +If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](site/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type. ## Code Contributions From 329878c45f95748b4c0d8e19b86dc3e9e545b39d Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 15 Mar 2016 16:05:38 -0700 Subject: [PATCH 18/65] Update site version of contributing [ci skip] --- site/_docs/contributing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/_docs/contributing.md b/site/_docs/contributing.md index 9ac49666..67dc954b 100644 --- a/site/_docs/contributing.md +++ b/site/_docs/contributing.md @@ -20,7 +20,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots * [Install Jekyll on your computer](https://jekyllrb.com/docs/installation/) and kick the tires. Does it work? Does it do what you'd expect? If not, [open an issue](https://github.com/jekyll/jekyll/issues/new) and let us know. * Comment on some of the project's [open issues](https://github.com/jekyll/jekyll/issues). Have you experienced the same problem? Know a work around? Do you have a suggestion for how the feature could be better? -* Read through [the documentation](http://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion for something that could be improved. +* Read through [the documentation](https://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion for something that could be improved. * Browse through [the Jekyll discussion forum](https://talk.jekyllrb.com/), and lend a hand answering questions. There's a good chance you've already experienced what another user is experiencing. * Find [an open issue](https://github.com/jekyll/jekyll/issues) (especially [those labeled `help-wanted`](https://github.com/jekyll/jekyll/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted)), and submit a proposed fix. If it's your first pull request, we promise we won't bite, and are glad to answer any questions. * Help evaluate [open pull requests](https://github.com/jekyll/jekyll/pulls), by testing the changes locally and reviewing what's proposed. @@ -73,7 +73,7 @@ One gotcha, all pull requests should be directed at the `master` branch (the def ### Adding plugins -If you want to add your plugin to the [list of plugins](http://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](site/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type. +If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](site/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type. ## Code Contributions From 97efa0f0ced706bbb3c5f1f14159832058cbbe46 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 15 Mar 2016 16:06:25 -0700 Subject: [PATCH 19/65] Clean up Tags::PostUrl a bit --- lib/jekyll/errors.rb | 4 ++++ lib/jekyll/tags/post_url.rb | 26 ++++++++++++++++++-------- lib/jekyll/utils.rb | 3 ++- test/test_tags.rb | 28 ++++++++++++++++++++++++++-- test/test_utils.rb | 8 ++++---- 5 files changed, 54 insertions(+), 15 deletions(-) diff --git a/lib/jekyll/errors.rb b/lib/jekyll/errors.rb index 36b2643d..322eb6af 100644 --- a/lib/jekyll/errors.rb +++ b/lib/jekyll/errors.rb @@ -6,5 +6,9 @@ module Jekyll InvalidPermalinkError = Class.new(FatalException) InvalidYAMLFrontMatterError = Class.new(FatalException) MissingDependencyException = Class.new(FatalException) + + InvalidDateError = Class.new(FatalException) + InvalidPostNameError = Class.new(FatalException) + PostURLError = Class.new(FatalException) end end diff --git a/lib/jekyll/tags/post_url.rb b/lib/jekyll/tags/post_url.rb index 6c4c9f8e..94db166e 100644 --- a/lib/jekyll/tags/post_url.rb +++ b/lib/jekyll/tags/post_url.rb @@ -7,22 +7,30 @@ module Jekyll def initialize(name) @name = name + all, @path, @date, @slug = *name.sub(/^\//, "").match(MATCHER) - raise ArgumentError.new("'#{name}' does not contain valid date and/or title.") unless all + unless all + raise Jekyll::Errors::InvalidPostNameError, + "'#{name}' does not contain valid date and/or title." + end @name_regex = /^#{path}#{date}-#{slug}\.[^.]+/ end + def post_date + @post_date ||= Utils.parse_date(name, + "\"#{name}\" does not contain valid date and/or title.") + end + def ==(other) other.basename.match(@name_regex) end def deprecated_equality(other) - date = Utils.parse_date(name, "'#{name}' does not contain valid date and/or title.") slug == post_slug(other) && - date.year == other.date.year && - date.month == other.date.month && - date.day == other.date.day + post_date.year == other.date.year && + post_date.month == other.date.month && + post_date.day == other.date.day end private @@ -47,11 +55,13 @@ module Jekyll @orig_post = post.strip begin @post = PostComparer.new(@orig_post) - rescue - raise ArgumentError.new <<-eos + rescue => e + raise Jekyll::Errors::PostURLError, <<-eos Could not parse name of post "#{@orig_post}" in tag 'post_url'. Make sure the post exists and the name is correct. + +#{e.class}: #{e.message} eos end end @@ -75,7 +85,7 @@ eos return p.url end - raise ArgumentError.new <<-eos + raise Jekyll::Errors::PostURLError, <<-eos Could not find post "#{@orig_post}" in tag 'post_url'. Make sure the post exists and the name is correct. diff --git a/lib/jekyll/utils.rb b/lib/jekyll/utils.rb index 5d0dda2e..179981ec 100644 --- a/lib/jekyll/utils.rb +++ b/lib/jekyll/utils.rb @@ -1,3 +1,4 @@ + module Jekyll module Utils extend self @@ -126,7 +127,7 @@ module Jekyll def parse_date(input, msg = "Input could not be parsed.") Time.parse(input).localtime rescue ArgumentError - raise Errors::FatalException.new("Invalid date '#{input}': " + msg) + raise Errors::InvalidDateError, "Invalid date '#{input}': #{msg}" end # Determines whether a given file has diff --git a/test/test_tags.rb b/test/test_tags.rb index f263e9d8..dd1db97b 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -470,8 +470,32 @@ title: Invalid post name linking {% post_url abc2008-11-21-complex %} CONTENT - assert_raises ArgumentError do - create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) + assert_raises Jekyll::Errors::PostURLError do + create_post(content, { + 'permalink' => 'pretty', + 'source' => source_dir, + 'destination' => dest_dir, + 'read_posts' => true + }) + end + end + + should "cause an error with a bad date" do + content = < 'pretty', + 'source' => source_dir, + 'destination' => dest_dir, + 'read_posts' => true + }) end end end diff --git a/test/test_utils.rb b/test/test_utils.rb index eab0ca1e..f102b7a6 100644 --- a/test/test_utils.rb +++ b/test/test_utils.rb @@ -95,20 +95,20 @@ class TestUtils < JekyllUnitTest end should "throw an error if the input contains no date data" do - assert_raises Jekyll::Errors::FatalException do + assert_raises Jekyll::Errors::InvalidDateError do Utils.parse_date("Blah") end end should "throw an error if the input is out of range" do - assert_raises Jekyll::Errors::FatalException do + assert_raises Jekyll::Errors::InvalidDateError do Utils.parse_date("9999-99-99") end end should "throw an error with the default message if no message is passed in" do date = "Blah this is invalid" - assert_raises Jekyll::Errors::FatalException, "Invalid date '#{date}': Input could not be parsed." do + assert_raises Jekyll::Errors::InvalidDateError, "Invalid date '#{date}': Input could not be parsed." do Utils.parse_date(date) end end @@ -116,7 +116,7 @@ class TestUtils < JekyllUnitTest should "throw an error with the provided message if a message is passed in" do date = "Blah this is invalid" message = "Aaaah, the world has exploded!" - assert_raises Jekyll::Errors::FatalException, "Invalid date '#{date}': #{message}" do + assert_raises Jekyll::Errors::InvalidDateError, "Invalid date '#{date}': #{message}" do Utils.parse_date(date, message) end end From 4883a24363b7e16327d78d13a3eeeafd6590204c Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Tue, 15 Mar 2016 16:08:32 -0700 Subject: [PATCH 20/65] PostComparer#post_date use the provided date instead of re-parsing the whole name. --- lib/jekyll/tags/post_url.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/tags/post_url.rb b/lib/jekyll/tags/post_url.rb index 94db166e..b05d056b 100644 --- a/lib/jekyll/tags/post_url.rb +++ b/lib/jekyll/tags/post_url.rb @@ -18,8 +18,8 @@ module Jekyll end def post_date - @post_date ||= Utils.parse_date(name, - "\"#{name}\" does not contain valid date and/or title.") + @post_date ||= Utils.parse_date(date, + "\"#{date}\" does not contain valid date and/or title.") end def ==(other) From b9859489b0e1d078f6e62948cd7dea85fb1f6574 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Wed, 16 Mar 2016 13:15:27 -0700 Subject: [PATCH 21/65] Update history to reflect merge of #4670 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 011d0ccd..d231fd7d 100644 --- a/History.markdown +++ b/History.markdown @@ -10,6 +10,7 @@ * Site Template: Changed main `
` to `
` and added accessibility info (#4636) * Add array support to `where` filter (#4555) * 'jekyll clean': also remove .sass-cache (#4652) + * Clean up Tags::PostUrl a bit, including better errors and date parsing (#4670) ### Bug Fixes From ac9a72482dfa49ba62da14063423490104054c5f Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 16 Mar 2016 15:28:06 -0700 Subject: [PATCH 22/65] Lock jemoji to v0.5.1 while we figure out the issue with HTML::Pipeline. Reference issue: https://github.com/jekyll/jemoji/pull/37 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 5aad2c4d..b27211cb 100644 --- a/Gemfile +++ b/Gemfile @@ -81,7 +81,7 @@ group :site do gem "html-proofer", "~> 2.0" end - gem "jemoji" + gem "jemoji", "0.5.1" gem "jekyll-sitemap" gem "jekyll-seo-tag", "~> 1.1" gem "jekyll-avatar" From f79f9d60a97dcc3a700045d7438266bda77cea51 Mon Sep 17 00:00:00 2001 From: Jeff Kolesky Date: Thu, 17 Mar 2016 14:01:04 -0700 Subject: [PATCH 23/65] Changes `collection_url` tag to `link` tag --- lib/jekyll/tags/collection_url.rb | 47 ------------------------------- lib/jekyll/tags/link.rb | 29 +++++++++++++++++++ test/test_tags.rb | 33 +++++++++------------- 3 files changed, 43 insertions(+), 66 deletions(-) delete mode 100644 lib/jekyll/tags/collection_url.rb create mode 100644 lib/jekyll/tags/link.rb diff --git a/lib/jekyll/tags/collection_url.rb b/lib/jekyll/tags/collection_url.rb deleted file mode 100644 index bdd9d398..00000000 --- a/lib/jekyll/tags/collection_url.rb +++ /dev/null @@ -1,47 +0,0 @@ -module Jekyll - module Tags - class CollectionUrl < Liquid::Tag - TagName = 'collection_url' - MATCHER = /^([\w-]+)\s+\/?(.*)$/ - - def initialize(tag_name, markup, tokens) - super - orig_markup = markup.strip - all, @collection, @item_name = *orig_markup.match(MATCHER) - unless all - raise ArgumentError.new <<-eos -Could not parse the collection or item "#{markup}" in tag '#{TagName}'. - -Valid syntax: #{TagName} -eos - end - - @path_regex = /^\/#{@item_name}$/ - end - - def render(context) - site = context.registers[:site] - - if site.collections[@collection] - site.collections[@collection].docs.each do |p| - return p.url if p.cleaned_relative_path.match(@path_regex) - end - - raise ArgumentError.new <<-eos -Could not find item "#{@item_name}" in collection "#{@collection}" in tag '#{TagName}'. - -Make sure the item exists and the name is correct. -eos - else - raise ArgumentError.new <<-eos -Could not find collection "#{@collection}" in tag '#{TagName}' - -Make sure the collection exists and the name is correct. -eos - end - end - end - end -end - -Liquid::Template.register_tag(Jekyll::Tags::CollectionUrl::TagName, Jekyll::Tags::CollectionUrl) diff --git a/lib/jekyll/tags/link.rb b/lib/jekyll/tags/link.rb new file mode 100644 index 00000000..9ab76167 --- /dev/null +++ b/lib/jekyll/tags/link.rb @@ -0,0 +1,29 @@ +module Jekyll + module Tags + class Link < Liquid::Tag + TagName = 'link' + + def initialize(tag_name, relative_path, tokens) + super + + @relative_path = relative_path.strip + end + + def render(context) + site = context.registers[:site] + + site.docs_to_write.each do |document| + return document.url if document.relative_path == @relative_path + end + + raise ArgumentError.new <<-eos +Could not find document "#{@relative_path}" in tag '#{TagName}'. + +Make sure the document exists and the path is correct. +eos + end + end + end +end + +Liquid::Template.register_tag(Jekyll::Tags::Link::TagName, Jekyll::Tags::Link) diff --git a/test/test_tags.rb b/test/test_tags.rb index 83ae9f87..6d9f7963 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -15,7 +15,6 @@ class TestTags < JekyllUnitTest site.posts.docs.concat(PostReader.new(site).read_posts('')) end if override['read_collections'] - # puts "reading collections" CollectionReader.new(site).read end @@ -480,16 +479,16 @@ CONTENT end end - context "simple page with collection linking" do + context "simple page with linking" do setup do content = < source_dir, 'destination' => dest_dir, 'collections' => { 'methods' => {}}, 'read_collections' => true}) + create_post(content, {'source' => source_dir, 'destination' => dest_dir, 'collections' => { 'methods' => { 'output' => true }}, 'read_collections' => true}) end should "not cause an error" do @@ -501,19 +500,17 @@ CONTENT end end - context "simple page with nested collection linking" do + context "simple page with nested linking" do setup do content = < source_dir, 'destination' => dest_dir, 'collections' => { 'methods' => {}}, 'read_collections' => true}) + create_post(content, {'source' => source_dir, 'destination' => dest_dir, 'collections' => { 'methods' => { 'output' => true }}, 'read_collections' => true}) end should "not cause an error" do @@ -522,27 +519,25 @@ CONTENT should "have the url to the \"sanitized_path\" item" do assert_match %r{1\s/methods/sanitized_path}, @result - assert_match %r{2\s/methods/sanitized_path}, @result end should "have the url to the \"site/generate\" item" do - assert_match %r{3\s/methods/site/generate}, @result - assert_match %r{4\s/methods/site/generate}, @result + assert_match %r{2\s/methods/site/generate}, @result end end - context "simple page with invalid collection linking" do + context "simple page with invalid linking" do should "cause an error" do content = < source_dir, 'destination' => dest_dir, 'collections' => { 'methods' => {}}, 'read_collections' => true}) + create_post(content, {'source' => source_dir, 'destination' => dest_dir, 'collections' => { 'methods' => { 'output' => true }}, 'read_collections' => true}) end end end From 4b32bd2b1345d3071a150f5fcddf5b042f81580a Mon Sep 17 00:00:00 2001 From: Jeff Kolesky Date: Thu, 17 Mar 2016 14:26:13 -0700 Subject: [PATCH 24/65] Updates code styling per PR --- lib/jekyll/tags/link.rb | 7 ++----- test/test_tags.rb | 8 ++------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/jekyll/tags/link.rb b/lib/jekyll/tags/link.rb index 9ab76167..f81e43b4 100644 --- a/lib/jekyll/tags/link.rb +++ b/lib/jekyll/tags/link.rb @@ -16,11 +16,8 @@ module Jekyll return document.url if document.relative_path == @relative_path end - raise ArgumentError.new <<-eos -Could not find document "#{@relative_path}" in tag '#{TagName}'. - -Make sure the document exists and the path is correct. -eos + raise ArgumentError, "Could not find document '#{@relative_path}' in tag '#{TagName}'.\n\n" \ + "Make sure the document exists and the path is correct." end end end diff --git a/test/test_tags.rb b/test/test_tags.rb index 6d9f7963..84594188 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -11,12 +11,8 @@ class TestTags < JekyllUnitTest def create_post(content, override = {}, converter_class = Jekyll::Converters::Markdown) site = fixture_site({"highlighter" => "rouge"}.merge(override)) - if override['read_posts'] - site.posts.docs.concat(PostReader.new(site).read_posts('')) - end - if override['read_collections'] - CollectionReader.new(site).read - end + site.posts.docs.concat(PostReader.new(site).read_posts('')) if override['read_posts'] + CollectionReader.new(site).read if override['read_collections'] info = { :filters => [Jekyll::Filters], :registers => { :site => site } } @converter = site.converters.find { |c| c.class == converter_class } From 0c73a6ded99170008ded32fd3c0896c91c6caec7 Mon Sep 17 00:00:00 2001 From: Aaron Sky Date: Thu, 17 Mar 2016 15:32:06 -0700 Subject: [PATCH 25/65] Update Templates Docs to include Array Filters PR #2895 merged this in, but there isn't any documentation anywhere for this as far as I can find. All the Stack Overflow answers I could find said it was impossible to push and pop elements from a Liquid array, although that's probably because they were using Shopify's Liquid. Fixes https://github.com/jekyll/jekyll/pull/4384 --- site/_docs/templates.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/site/_docs/templates.md b/site/_docs/templates.md index 0ebd35f8..ecb1c110 100644 --- a/site/_docs/templates.md +++ b/site/_docs/templates.md @@ -271,6 +271,26 @@ common tasks easier.

+ + +

Array Filters

+

Push, pop, shift, and unshift elements from an Array.

+ + +

+ {% raw %}{{ page.tags | push: 'Spokane' }}{% endraw %} + {% raw %}{{ page.tags | pop }}{% endraw %} + {% raw %}{{ page.tags | shift }}{% endraw %} + {% raw %}{{ page.tags | unshift }}{% endraw %} +

+

+ ['Seattle', 'Tacoma', 'Spokane'] + ['Seattle', 'Tacoma'] + ['Seattle'] + ['Tacoma'] +

+ +
From af47b3c1a770c47b5afc3389662a90632db05cee Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 17 Mar 2016 15:50:50 -0700 Subject: [PATCH 26/65] Fix documentation for push/pop/shift/unshift /cc https://github.com/jekyll/jekyll/pull/4384 --- site/_docs/templates.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/site/_docs/templates.md b/site/_docs/templates.md index ecb1c110..60892505 100644 --- a/site/_docs/templates.md +++ b/site/_docs/templates.md @@ -275,20 +275,33 @@ common tasks easier.

Array Filters

Push, pop, shift, and unshift elements from an Array.

+

These are NON-DESTRUCTIVE, i.e. they do not mutate the array, but rather make a copy and mutate that.

{% raw %}{{ page.tags | push: 'Spokane' }}{% endraw %} - {% raw %}{{ page.tags | pop }}{% endraw %} - {% raw %}{{ page.tags | shift }}{% endraw %} - {% raw %}{{ page.tags | unshift }}{% endraw %}

['Seattle', 'Tacoma', 'Spokane'] - ['Seattle', 'Tacoma'] +

+

+ {% raw %}{{ page.tags | pop }}{% endraw %} +

+

['Seattle'] +

+

+ {% raw %}{{ page.tags | shift }}{% endraw %} +

+

['Tacoma']

+

+ {% raw %}{{ page.tags | unshift: "Olympia" }}{% endraw %} +

+

+ ['Olympia', 'Seattle', 'Tacoma'] +

From 68892ab69315f502564f82042cef3647ab8479da Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Sat, 19 Mar 2016 12:45:25 +0100 Subject: [PATCH 27/65] `future` option also works for collections Following the discussion on #4676 --- site/_docs/configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/_docs/configuration.md b/site/_docs/configuration.md index 72929f0a..1dec3ea1 100644 --- a/site/_docs/configuration.md +++ b/site/_docs/configuration.md @@ -3,7 +3,7 @@ layout: docs title: Configuration permalink: /docs/configuration/ --- - +f Jekyll allows you to concoct your sites in any way you can dream up, and it’s thanks to the powerful and flexible configuration options that this is possible. These options can either be specified in a `_config.yml` file placed in your @@ -214,7 +214,7 @@ class="flag">flags (specified on the command-line) that control them.

Future

-

Publish posts with a future date.

+

Publish posts or any collection with a future date.

future: BOOL

From a81bc9773fd5520296464ae1fbc09cc258e0da2b Mon Sep 17 00:00:00 2001 From: DirtyF Date: Sat, 19 Mar 2016 12:56:44 +0100 Subject: [PATCH 28/65] typo --- site/_docs/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/configuration.md b/site/_docs/configuration.md index 1dec3ea1..0c06c362 100644 --- a/site/_docs/configuration.md +++ b/site/_docs/configuration.md @@ -3,7 +3,7 @@ layout: docs title: Configuration permalink: /docs/configuration/ --- -f + Jekyll allows you to concoct your sites in any way you can dream up, and it’s thanks to the powerful and flexible configuration options that this is possible. These options can either be specified in a `_config.yml` file placed in your From c28a17d71fc58403ec594f8b9356d8fcc92aa52a Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 19 Mar 2016 10:08:17 -0700 Subject: [PATCH 29/65] benchmark: add benchmarks for String#=~ vs String#include? --- benchmark/regexp-vs-include.rb | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 benchmark/regexp-vs-include.rb diff --git a/benchmark/regexp-vs-include.rb b/benchmark/regexp-vs-include.rb new file mode 100644 index 00000000..b2a4eff4 --- /dev/null +++ b/benchmark/regexp-vs-include.rb @@ -0,0 +1,51 @@ +#!/usr/bin/env ruby +require 'benchmark/ips' + +# For this pull request, which changes Page#dir +# https://github.com/jekyll/jekyll/pull/4403 + +CONTENT_CONTAINING = <<-HTML.freeze + + + + + + Jemoji + + + + +

:+1:

+ + + +HTML +CONTENT_NOT_CONTAINING = <<-HTML.freeze + + + + + + Jemoji + + + + +

:+1:

+ + + +HTML + +Benchmark.ips do |x| + x.report("no body include?") { CONTENT_NOT_CONTAINING.include?(' Date: Sat, 19 Mar 2016 18:22:35 +0100 Subject: [PATCH 30/65] replace with @parkr suggestion --- site/_docs/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/configuration.md b/site/_docs/configuration.md index 0c06c362..9956cb77 100644 --- a/site/_docs/configuration.md +++ b/site/_docs/configuration.md @@ -214,7 +214,7 @@ class="flag">flags (specified on the command-line) that control them.

Future

-

Publish posts or any collection with a future date.

+

Publish posts or collection documents with a future date.

future: BOOL

From c795acd09fa3db4b5e2b304bd19d98d7ac904f0d Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sat, 19 Mar 2016 10:26:06 -0700 Subject: [PATCH 31/65] Update history to reflect merge of #4682 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index d231fd7d..a7dfa673 100644 --- a/History.markdown +++ b/History.markdown @@ -42,6 +42,7 @@ * Update continuous-integration docs with sudo: false information (#4628) * Blog post on refreshed contributing file and new affinity teams (#4645) * Fixes typo on collections (#4647) + * Documentation: future option also works for collections (#4682) ## 3.1.2 / 2016-02-19 From bd0cdcd4cb074f44b23f63823fdc5d72b9275765 Mon Sep 17 00:00:00 2001 From: AndrewCz Date: Sun, 20 Mar 2016 05:08:05 -0400 Subject: [PATCH 32/65] Add installing devel libraries to fedora I followed the troubleshooting and came up with `sudo gem install jekyll` unable to generate the binary file because the development libraries were not installed on my system. Per [fedoraproject.org -- Gems](https://developer.fedoraproject.org/tech/languages/ruby/gems-installation.html) this is necessary to install this. The instructions mirror what is listed on that page, but using `yum` instead of `dnf` - which is understandable because RH and CentOS still use `yum`. --- site/_docs/troubleshooting.md | 1 + 1 file changed, 1 insertion(+) diff --git a/site/_docs/troubleshooting.md b/site/_docs/troubleshooting.md index 5d7b1ad9..bdc7804f 100644 --- a/site/_docs/troubleshooting.md +++ b/site/_docs/troubleshooting.md @@ -28,6 +28,7 @@ On Red Hat, CentOS, and Fedora systems you can do this by running: {% highlight bash %} sudo yum install ruby-devel +sudo yum group install "C Development Tools and Libraries" {% endhighlight %} On [NearlyFreeSpeech](https://www.nearlyfreespeech.net/) you need to run the From a54cedbb723a38d787b0a2b29a4e0485e83b92c6 Mon Sep 17 00:00:00 2001 From: AndrewCz Date: Sun, 20 Mar 2016 05:53:13 -0400 Subject: [PATCH 33/65] Additional repo needed for Fedora 23 Workspace After running: sudo dnf install ruby ruby-devel rubygems nodejs sudo dnf group install "C Development and Tools" I was unable to install Jekyll via `gem` due to an error: The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. Taken from the [fedoraproject.org](https://developer.fedoraproject.org/tech/languages/ruby/gems-installation.html) Gem page: >If you installed all the above, but the extensions would still not compile, you are probably running a Fedora image that misses `redhat-rpm-config` >package. In that case gcc compiler would complain about one of the following: gcc: error: conftest.c: No such file or directory gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory >To solve this, simply run sudo dnf install `redhat-rpm-config`. After doing so it downloaded, compiled and installed without a problem. --- site/_docs/troubleshooting.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/site/_docs/troubleshooting.md b/site/_docs/troubleshooting.md index bdc7804f..899f129e 100644 --- a/site/_docs/troubleshooting.md +++ b/site/_docs/troubleshooting.md @@ -28,9 +28,15 @@ On Red Hat, CentOS, and Fedora systems you can do this by running: {% highlight bash %} sudo yum install ruby-devel -sudo yum group install "C Development Tools and Libraries" {% endhighlight %} +If you installed the above - specifically on Fedora 23 - but the extensions would still not compile, you are probably running a Fedora image that misses the `redhat-rpm-config` package. To solve this, simply run: + +{% highlight bash %} +sudo dnf install redhat-rpm-config +{% endhighlight %} + + On [NearlyFreeSpeech](https://www.nearlyfreespeech.net/) you need to run the following commands before installing Jekyll: From 526ded00e95a6c8047ec68935ab422ae2c174688 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 20 Mar 2016 15:32:46 -0700 Subject: [PATCH 34/65] Update history to reflect merge of #4685 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index a7dfa673..9986eadb 100644 --- a/History.markdown +++ b/History.markdown @@ -43,6 +43,7 @@ * Blog post on refreshed contributing file and new affinity teams (#4645) * Fixes typo on collections (#4647) * Documentation: future option also works for collections (#4682) + * Additional package needed for Fedora 23 Workspace (#4685) ## 3.1.2 / 2016-02-19 From 2736be44c50cd05c7a5c1489d558f0871db2eb89 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Sun, 20 Mar 2016 15:34:36 -0700 Subject: [PATCH 35/65] Update history to reflect merge of #4491 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 9986eadb..07ea14a8 100644 --- a/History.markdown +++ b/History.markdown @@ -20,6 +20,7 @@ * Filters#time: clone an input Time so as to be non-destructive (#4590) * Doctor: fix issue where `--config` wasn't a recognized flag (#4598) * Ensures related_posts are only set for a post (#4620) + * EntryFilter#special?: ignore filenames which begin with '~' (#4491) ### Development Fixes From bbb76a39a22a8774382f5e11fa5e6732c21795ca Mon Sep 17 00:00:00 2001 From: Yanis Vieilly Date: Sun, 20 Mar 2016 23:38:45 +0100 Subject: [PATCH 36/65] Update windows.md Fix typo on Chocolatey name --- site/_docs/windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/windows.md b/site/_docs/windows.md index ddb08926..c573747d 100644 --- a/site/_docs/windows.md +++ b/site/_docs/windows.md @@ -15,7 +15,7 @@ Julian Thilo has written up instructions to get people. The instructions were written for Ruby 2.0.0, but should work for later versions [prior to 2.2][hitimes-issue]. -Alternatively David Burela has written instructions on [how to install Jekyll via Chocolately with 3 command prompt entries](https://davidburela.wordpress.com/2015/11/28/easily-install-jekyll-on-windows-with-3-command-prompt-entries-and-chocolatey/). +Alternatively David Burela has written instructions on [how to install Jekyll via Chocolatey with 3 command prompt entries](https://davidburela.wordpress.com/2015/11/28/easily-install-jekyll-on-windows-with-3-command-prompt-entries-and-chocolatey/). ## Encoding From 62669d9229dfce6c17c047a3f85f4742a89eaeb8 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Mon, 21 Mar 2016 09:03:53 -0700 Subject: [PATCH 37/65] Update history to reflect merge of #4686 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 07ea14a8..fe55c046 100644 --- a/History.markdown +++ b/History.markdown @@ -45,6 +45,7 @@ * Fixes typo on collections (#4647) * Documentation: future option also works for collections (#4682) * Additional package needed for Fedora 23 Workspace (#4685) + * Fix typo on Chocolatey name in Windows documentation (#4686) ## 3.1.2 / 2016-02-19 From b06af5a44f47ec6cf5f203e8eb318868eac0ae86 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Mon, 21 Mar 2016 11:07:46 -0700 Subject: [PATCH 38/65] Use encode for xml_escape filter --- lib/jekyll/filters.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index 183c9c58..02523d9c 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -117,7 +117,7 @@ module Jekyll # # Returns the escaped String. def xml_escape(input) - CGI.escapeHTML(input.to_s) + input.to_s.encode(:xml => :attr).gsub(/\A"|"\Z/, "") end # CGI escape a string for use in a URL. Replaces any special characters @@ -308,7 +308,7 @@ module Jekyll # # Returns a String representation of the object. def inspect(input) - CGI.escapeHTML(input.inspect) + xml_escape(input.inspect) end private From aeecbd741f5a6ed6e36f37ef7b4a1b30012ea9bf Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Mon, 21 Mar 2016 15:45:29 -0700 Subject: [PATCH 39/65] Add test to inspect strings --- test/test_filters.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test_filters.rb b/test/test_filters.rb index de59bc02..4ded0cd6 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -394,6 +394,10 @@ class TestFilters < JekyllUnitTest should "return a HTML-escaped string representation of an object" do assert_equal "{"<a>"=>1}", @filter.inspect({ "" => 1 }) end + + should "quote strings" do + assert_equal ""string"", @filter.inspect("string") + end end context "slugify filter" do From 27d617a3195b06901404c538eb76fa1128da9417 Mon Sep 17 00:00:00 2001 From: chrisfinazzo Date: Tue, 22 Mar 2016 17:48:57 -0400 Subject: [PATCH 40/65] Use the correct URL, Fixes #4698 --- site/_docs/resources.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/_docs/resources.md b/site/_docs/resources.md index 261100f0..0e403986 100644 --- a/site/_docs/resources.md +++ b/site/_docs/resources.md @@ -35,4 +35,4 @@ Jekyll’s growing use is producing a wide variety of tutorials, frameworks, ext - [Generating a Tag Cloud in Jekyll](http://www.justkez.com/generating-a-tag-cloud-in-jekyll/) – A guide to implementing a tag cloud and per-tag content pages using Jekyll. - A way to [extend Jekyll](https://github.com/rfelix/jekyll_ext) without forking and modifying the Jekyll gem codebase and some [portable Jekyll extensions](https://wiki.github.com/rfelix/jekyll_ext/extensions) that can be reused and shared. - [Using your Rails layouts in Jekyll](http://numbers.brighterplanet.com/2010/08/09/sharing-rails-views-with-jekyll) -- [Adding Ajax pagination to Jekyll](https://eduardoboucas.com/blog/2014/11/10/adding-ajax-pagination-to-jekyll.html) +- [Adding Ajax pagination to Jekyll](https://eduardoboucas.com/blog/2014/11/05/adding-ajax-pagination-to-jekyll.html) From f542d817b068d54c1f25200ac0768ec9b1a03c9e Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 22 Mar 2016 14:55:55 -0700 Subject: [PATCH 41/65] Update history to reflect merge of #4699 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index fe55c046..8d406116 100644 --- a/History.markdown +++ b/History.markdown @@ -46,6 +46,7 @@ * Documentation: future option also works for collections (#4682) * Additional package needed for Fedora 23 Workspace (#4685) * Fix typo on Chocolatey name in Windows documentation (#4686) + * Use the correct URL, Fixes #4698 (#4699) ## 3.1.2 / 2016-02-19 From e1fe16107177275ed24d7e53b83a9f859511cbf7 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Tue, 22 Mar 2016 15:09:57 -0700 Subject: [PATCH 42/65] Update history to reflect merge of #4694 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 8d406116..efba0719 100644 --- a/History.markdown +++ b/History.markdown @@ -11,6 +11,7 @@ * Add array support to `where` filter (#4555) * 'jekyll clean': also remove .sass-cache (#4652) * Clean up Tags::PostUrl a bit, including better errors and date parsing (#4670) + * Use String#encode for xml_escape filter instead of CGI.escapeHTML (#4694) ### Bug Fixes From 8786163f35333b4f03c28670d433b4962ac269de Mon Sep 17 00:00:00 2001 From: Krzysztof Jurewicz Date: Wed, 23 Mar 2016 10:00:13 +0100 Subject: [PATCH 43/65] Add jekyll-paspagon plugin --- site/_docs/plugins.md | 1 + 1 file changed, 1 insertion(+) diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index 932fd204..8a14fc15 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -885,6 +885,7 @@ LESS.js files during generation. - [Jekyll Language Plugin](https://github.com/vwochnik/jekyll-language-plugin): Jekyll 3.0-compatible multi-language plugin for posts, pages and includes. - [Jekyll Deploy](https://github.com/vwochnik/jekyll-deploy): Adds a `deploy` sub-command to Jekyll. - [Official Contentful Jekyll Plugin](https://github.com/contentful/jekyll-contentful-data-import): Adds a `contentful` sub-command to Jekyll to import data from Contentful. +- [jekyll-paspagon](https://github.com/KrzysiekJ/jekyll-paspagon): Sell your posts in various formats for cryptocurrencies. #### Editors From b5e459430bb510f283bdb3935b3a220b81819442 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Wed, 23 Mar 2016 08:46:02 -0700 Subject: [PATCH 44/65] Update history to reflect merge of #4700 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index efba0719..bd5ee7a2 100644 --- a/History.markdown +++ b/History.markdown @@ -48,6 +48,7 @@ * Additional package needed for Fedora 23 Workspace (#4685) * Fix typo on Chocolatey name in Windows documentation (#4686) * Use the correct URL, Fixes #4698 (#4699) + * Add jekyll-paspagon plugin (#4700) ## 3.1.2 / 2016-02-19 From 84b7d9b3ac6e1218dc910d32dd423bf922bfaff4 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 23 Mar 2016 13:14:08 -0700 Subject: [PATCH 45/65] Add Hook for :site :after_init --- lib/jekyll/hooks.rb | 1 + lib/jekyll/site.rb | 18 +++--------------- site/_docs/plugins.md | 12 ++++++++++++ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/jekyll/hooks.rb b/lib/jekyll/hooks.rb index 869bcc1f..6d8fcd8d 100644 --- a/lib/jekyll/hooks.rb +++ b/lib/jekyll/hooks.rb @@ -12,6 +12,7 @@ module Jekyll # initial empty hooks @registry = { :site => { + :after_init => [], :after_reset => [], :post_read => [], :pre_render => [], diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 72d42ad9..7f76e981 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -17,6 +17,8 @@ module Jekyll # # config - A Hash containing site configuration details. def initialize(config) + + Jekyll::Hooks.trigger :site, :after_init, self @config = config.clone %w(safe lsi highlighter baseurl exclude include future unpublished @@ -24,17 +26,6 @@ module Jekyll self.send("#{opt}=", config[opt]) end - # Source and destination may not be changed after the site has been created. - @source = File.expand_path(config['source']).freeze - @dest = File.expand_path(config['destination']).freeze - - @reader = Jekyll::Reader.new(self) - - # Initialize incremental regenerator - @regenerator = Regenerator.new(self) - - @liquid_renderer = LiquidRenderer.new(self) - self.plugin_manager = Jekyll::PluginManager.new(self) self.plugins = plugin_manager.plugins_path @@ -43,10 +34,7 @@ module Jekyll self.permalink_style = config['permalink'].to_sym - Jekyll.sites << self - - reset - setup + @config end # Public: Read, process, and write this Site to output. diff --git a/site/_docs/plugins.md b/site/_docs/plugins.md index 8a14fc15..8f173cb0 100644 --- a/site/_docs/plugins.md +++ b/site/_docs/plugins.md @@ -516,6 +516,18 @@ The complete list of available hooks is below: + + +

:site

+ + +

:after_init

+ + +

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

+ +

:site

From 9b60df88831073f6a8a760684bf65bf1d87d0fb4 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 23 Mar 2016 13:14:30 -0700 Subject: [PATCH 46/65] Add Site#config= which can be used to set the config --- lib/jekyll/site.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 7f76e981..c4fe9f0c 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -17,8 +17,31 @@ module Jekyll # # config - A Hash containing site configuration details. def initialize(config) + # Source and destination may not be changed after the site has been created. + @source = File.expand_path(config['source']).freeze + @dest = File.expand_path(config['destination']).freeze + + self.config = config + + @reader = Reader.new(self) + @regenerator = Regenerator.new(self) + @liquid_renderer = LiquidRenderer.new(self) + + Jekyll.sites << self Jekyll::Hooks.trigger :site, :after_init, self + + reset + setup + end + + # Public: Set the site's configuration. This handles side-effects caused by + # changing values in the configuration. + # + # config - a Jekyll::Configuration, containing the new configuration. + # + # Returns the new configuration. + def config=(config) @config = config.clone %w(safe lsi highlighter baseurl exclude include future unpublished From 007b7d45dca3e0860317c0c01670181d78912f31 Mon Sep 17 00:00:00 2001 From: Tom Fejfar Date: Wed, 23 Mar 2016 14:03:50 -0700 Subject: [PATCH 47/65] Ensure Rouge closes its div/figure properly after highlighting ends. Fixes #4474 --- test/test_tags.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/test_tags.rb b/test/test_tags.rb index dd1db97b..b6402150 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -317,6 +317,27 @@ EOS end end + context "post content has highlight tag with linenumbers" do + setup do + create_post <<-EOS +--- +title: This is a test +--- + +This is not yet highlighted +{% highlight php linenos %} +test +{% endhighlight %} + +This should not be highlighted, right? +EOS + end + + should "should stop highlighting at boundary" do + assert_match "

This is not yet highlighted

\n\n
1
test\n
\n\n

This should not be highlighted, right?

", @result + end + end + context "post content has highlight tag with preceding spaces & Windows-style newlines" do setup do fill_post "\r\n\r\n\r\n [,1] [,2]" From 0c172f6463b8b7ca574b352b37cf287eaebbc773 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Wed, 23 Mar 2016 17:01:16 -0700 Subject: [PATCH 48/65] Update history to reflect merge of #4533 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index bd5ee7a2..ad1a7345 100644 --- a/History.markdown +++ b/History.markdown @@ -12,6 +12,7 @@ * 'jekyll clean': also remove .sass-cache (#4652) * Clean up Tags::PostUrl a bit, including better errors and date parsing (#4670) * Use String#encode for xml_escape filter instead of CGI.escapeHTML (#4694) + * Add show_dir_listing option for serve command and fix index file names (#4533) ### Bug Fixes From 09f9f193d8e5fb714a6852c9276be1c6e55efbe8 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 23 Mar 2016 17:15:35 -0700 Subject: [PATCH 49/65] Add comment about github-pages --- lib/jekyll/commands/new.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/commands/new.rb b/lib/jekyll/commands/new.rb index 0af8553b..b4ecf808 100644 --- a/lib/jekyll/commands/new.rb +++ b/lib/jekyll/commands/new.rb @@ -69,14 +69,18 @@ module Jekyll source 'https://rubygems.org' # Hello! This is where you manage which Jekyll version is used to run. -# When you wwant to use a different version, change it below, save the +# When you want to use a different version, change it below, save the # file and run `bundle install`. Run Jekyll with `bundle exec`, like so: # # bundle exec jekyll serve # # This will help ensure the proper Jekyll version is running. # Happy Jekylling! -gem 'jekyll', '#{Jekyll::VERSION}' +gem "jekyll", "#{Jekyll::VERSION}" + +# If you want to use GitHub Pages, remove the "gem "jekyll"" above and +# uncomment the line below. To upgrade, run `bundle update github-pages`. +# gem "github-pages", group: :jekyll_plugins # If you have any plugins, put them here! # group :jekyll_plugins do From da35e134f12243ff8a96c714c3e4e12adf437ca5 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 23 Mar 2016 17:24:33 -0700 Subject: [PATCH 50/65] Add test for creation of Gemfile by 'jekyll new' --- test/test_new_command.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test_new_command.rb b/test/test_new_command.rb index f0d2a389..7ba84781 100644 --- a/test/test_new_command.rb +++ b/test/test_new_command.rb @@ -29,6 +29,15 @@ class TestNewCommand < JekyllUnitTest assert_exist @full_path end + should "create a Gemfile" do + gemfile = File.join(@full_path, "Gemfile") + refute_exist @full_path + capture_stdout { Jekyll::Commands::New.process(@args) } + assert_exist gemfile + assert_match /gem "jekyll", "#{Jekyll::VERSION}"/, File.read(gemfile) + assert_match /gem "github-pages"/, File.read(gemfile) + end + should 'display a success message' do Jekyll::Commands::New.process(@args) output = Jekyll.logger.messages.last @@ -40,6 +49,7 @@ class TestNewCommand < JekyllUnitTest static_template_files = dir_contents(site_template).reject do |f| File.extname(f) == '.erb' end + static_template_files << "/Gemfile" capture_stdout { Jekyll::Commands::New.process(@args) } From 22d9312eafed6e14e844ecf6ad7e3f70d59bbb37 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 23 Mar 2016 17:25:19 -0700 Subject: [PATCH 51/65] Use double quotes in the gemfile --- lib/jekyll/commands/new.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/commands/new.rb b/lib/jekyll/commands/new.rb index b4ecf808..689895be 100644 --- a/lib/jekyll/commands/new.rb +++ b/lib/jekyll/commands/new.rb @@ -66,7 +66,7 @@ module Jekyll def gemfile_contents <<-RUBY -source 'https://rubygems.org' +source "https://rubygems.org" # Hello! This is where you manage which Jekyll version is used to run. # When you want to use a different version, change it below, save the @@ -84,7 +84,7 @@ gem "jekyll", "#{Jekyll::VERSION}" # If you have any plugins, put them here! # group :jekyll_plugins do -# gem 'jekyll-github-metadata', '~> 1.0' +# gem "jekyll-github-metadata", "~> 1.0" # end RUBY end From 7695ba6eb4c68d8162d4dceeea6588809937e93a Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 23 Mar 2016 17:44:11 -0700 Subject: [PATCH 52/65] Add explanation of site variables in the example _config.yml --- lib/site_template/_config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/site_template/_config.yml b/lib/site_template/_config.yml index 1c5e5bc9..e23ad0fe 100644 --- a/lib/site_template/_config.yml +++ b/lib/site_template/_config.yml @@ -1,11 +1,17 @@ # Welcome to Jekyll! # # This config file is meant for settings that affect your whole blog, values -# which you are expected to set up once and rarely need to edit after that. +# which you are expected to set up once and rarely edit after that. If you find +# yourself editing these this file very often, consider using Jekyll's data files +# feature for the data you need to update frequently. # For technical reasons, this file is *NOT* reloaded automatically when you use # 'jekyll serve'. If you change this file, please restart the server process. # Site settings +# These are used to personalize your new site. If you look in the HTML files, +# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on. +# You can create any custom variable you would like, and they will be accessible +# in the templates via {{ site.myvariable }}. title: Your awesome title email: your-email@domain.com description: > # this means to ignore newlines until "baseurl:" From c6564d352b3452382c68bb0de6b0dc0be32d30da Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Wed, 23 Mar 2016 17:49:47 -0700 Subject: [PATCH 53/65] Update history to reflect merge of #4542 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index ad1a7345..849ef11f 100644 --- a/History.markdown +++ b/History.markdown @@ -13,6 +13,7 @@ * Clean up Tags::PostUrl a bit, including better errors and date parsing (#4670) * Use String#encode for xml_escape filter instead of CGI.escapeHTML (#4694) * Add show_dir_listing option for serve command and fix index file names (#4533) + * Site Template: write a Gemfile which is educational to the new site (#4542) ### Bug Fixes From c27c669796adfc836fbaeda7c632b12b70731bf2 Mon Sep 17 00:00:00 2001 From: Shinn Kondo Date: Wed, 23 Mar 2016 20:37:13 -0500 Subject: [PATCH 54/65] Fix test teardown for cleaner. --- test/test_cleaner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_cleaner.rb b/test/test_cleaner.rb index 7b2fb641..2118c4f4 100644 --- a/test/test_cleaner.rb +++ b/test/test_cleaner.rb @@ -55,7 +55,7 @@ class TestCleaner < JekyllUnitTest teardown do FileUtils.rm_rf(dest_dir('.git')) - FileUtils.rm_rf(dest_dir('.username.github.io')) + FileUtils.rm_rf(dest_dir('username.github.io')) end should "keep the file in the directory in keep_files" do From 5f97f928de6cd14e8deb689d41323a1fc05c7180 Mon Sep 17 00:00:00 2001 From: Yordis Prieto Date: Thu, 24 Mar 2016 09:52:16 -0400 Subject: [PATCH 55/65] Updating assets documentation Just because developer are lazy and tools like this is for move forward faster, normally we don't read (it's a fact) and because of that I missed this super important sentence. At least this should help. --- site/_docs/assets.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/_docs/assets.md b/site/_docs/assets.md index db8847c1..8e850548 100644 --- a/site/_docs/assets.md +++ b/site/_docs/assets.md @@ -6,8 +6,8 @@ permalink: /docs/assets/ Jekyll provides built-in support for Sass and can work with CoffeeScript via a Ruby gem. In order to use them, you must first create a file with the -proper extension name (one of `.sass`, `.scss`, or `.coffee`) and start the -file with two lines of triple dashes, like this: +proper extension name (one of `.sass`, `.scss`, or `.coffee`) and ***start the +file with two lines of triple dashes***, like this: {% highlight sass %} --- From 54fcc977250c899d50d899134c7f44d8223748cf Mon Sep 17 00:00:00 2001 From: Jeff Kolesky Date: Thu, 24 Mar 2016 08:54:31 -0700 Subject: [PATCH 56/65] Checks for link file extension in tests --- test/test_tags.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_tags.rb b/test/test_tags.rb index 84594188..548df475 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -492,7 +492,7 @@ CONTENT end should "have the url to the \"yaml_with_dots\" item" do - assert_match %r{/methods/yaml_with_dots}, @result + assert_match %r{/methods/yaml_with_dots\.html}, @result end end @@ -514,11 +514,11 @@ CONTENT end should "have the url to the \"sanitized_path\" item" do - assert_match %r{1\s/methods/sanitized_path}, @result + assert_match %r{1\s/methods/sanitized_path\.html}, @result end should "have the url to the \"site/generate\" item" do - assert_match %r{2\s/methods/site/generate}, @result + assert_match %r{2\s/methods/site/generate\.html}, @result end end From 0f2df6c7b3579be1ea47c4beea80ca201573275f Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Thu, 24 Mar 2016 12:40:16 -0700 Subject: [PATCH 57/65] Update history to reflect merge of #4706 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 849ef11f..9321d937 100644 --- a/History.markdown +++ b/History.markdown @@ -51,6 +51,7 @@ * Fix typo on Chocolatey name in Windows documentation (#4686) * Use the correct URL, Fixes #4698 (#4699) * Add jekyll-paspagon plugin (#4700) + * Bold-italicize note in assets documentation about needing yaml front matter (#4706) ## 3.1.2 / 2016-02-19 From 9fc4a85806dbcc91c4904548ad5c65cd54b97e6f Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Thu, 24 Mar 2016 12:40:50 -0700 Subject: [PATCH 58/65] Update history to reflect merge of #4704 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 9321d937..e5ff3145 100644 --- a/History.markdown +++ b/History.markdown @@ -14,6 +14,7 @@ * Use String#encode for xml_escape filter instead of CGI.escapeHTML (#4694) * Add show_dir_listing option for serve command and fix index file names (#4533) * Site Template: write a Gemfile which is educational to the new site (#4542) + * Site template: add explanation of site variables in the example `_config.yml` (#4704) ### Bug Fixes From f0e9b378f6396d3a70340c5a15fc13c33b3237bd Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Thu, 24 Mar 2016 12:50:06 -0700 Subject: [PATCH 59/65] Update history to reflect merge of #4624 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index e5ff3145..2b70c734 100644 --- a/History.markdown +++ b/History.markdown @@ -15,6 +15,7 @@ * Add show_dir_listing option for serve command and fix index file names (#4533) * Site Template: write a Gemfile which is educational to the new site (#4542) * Site template: add explanation of site variables in the example `_config.yml` (#4704) + * Adds `link` Liquid tag to make generation of URL's easier (#4624) ### Bug Fixes From 9234fa7510949d6622e6d2ad6723be728f90a411 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Thu, 24 Mar 2016 13:54:04 -0700 Subject: [PATCH 60/65] Update history to reflect merge of #3849 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 2b70c734..f4ec2251 100644 --- a/History.markdown +++ b/History.markdown @@ -26,6 +26,7 @@ * Doctor: fix issue where `--config` wasn't a recognized flag (#4598) * Ensures related_posts are only set for a post (#4620) * EntryFilter#special?: ignore filenames which begin with '~' (#4491) + * Cleaner: `keep_files` should only apply to the beginning of paths, not substrings with index > 0 (#3849) ### Development Fixes From 9be387ef6fbb6ce03517c225849fa1811aa208fa Mon Sep 17 00:00:00 2001 From: surrim Date: Fri, 25 Mar 2016 19:42:53 +0100 Subject: [PATCH 61/65] readded "env=prod"-condition --- lib/jekyll/static_file.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index 33155aea..3e7d0d25 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -80,7 +80,7 @@ module Jekyll FileUtils.mkdir_p(File.dirname(dest_path)) FileUtils.rm(dest_path) if File.exist?(dest_path) - if @site.safe + if @site.safe || Jekyll.env == "production" FileUtils.cp(path, dest_path) else FileUtils.copy_entry(path, dest_path) From f16c5d0e65c8801e1d60e10908d564caac0c1211 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Fri, 25 Mar 2016 12:19:17 -0700 Subject: [PATCH 62/65] Update history to reflect merge of #4640 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index f4ec2251..8dcfe96c 100644 --- a/History.markdown +++ b/History.markdown @@ -16,6 +16,7 @@ * Site Template: write a Gemfile which is educational to the new site (#4542) * Site template: add explanation of site variables in the example `_config.yml` (#4704) * Adds `link` Liquid tag to make generation of URL's easier (#4624) + * Allow static files to be symlinked in unsafe mode or non-prod environments (#4640) ### Bug Fixes From 7cdc8394aa63ed65285e4a15493d1b3a410b71b4 Mon Sep 17 00:00:00 2001 From: chrisfinazzo Date: Fri, 25 Mar 2016 15:30:53 -0400 Subject: [PATCH 63/65] Highlight the test code --- .github/CONTRIBUTING.markdown | 8 ++++---- site/_docs/contributing.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/CONTRIBUTING.markdown b/.github/CONTRIBUTING.markdown index 8181037a..e0f278fe 100644 --- a/.github/CONTRIBUTING.markdown +++ b/.github/CONTRIBUTING.markdown @@ -100,19 +100,19 @@ If your contribution changes any Jekyll behavior, make sure to update the docume To run the test suite and build the gem you'll need to install Jekyll's dependencies by running the following command: - $ script/bootstrap +
$ script/bootstrap
Before you make any changes, run the tests and make sure that they pass (to confirm your environment is configured properly): - $ script/cibuild +
$ script/cibuild
If you are only updating a file in `test/`, you can use the command: - $ script/test test/blah_test.rb +
$ script/test test/blah_test.rb
If you are only updating a `.feature` file, you can use the command: - $ script/cucumber features/blah.feature +
$ script/cucumber features/blah.feature
Both `script/test` and `script/cucumber` can be run without arguments to run its entire respective suite. diff --git a/site/_docs/contributing.md b/site/_docs/contributing.md index 67dc954b..c128ced9 100644 --- a/site/_docs/contributing.md +++ b/site/_docs/contributing.md @@ -105,19 +105,19 @@ If your contribution changes any Jekyll behavior, make sure to update the docume To run the test suite and build the gem you'll need to install Jekyll's dependencies by running the following command: - $ script/bootstrap +
$ script/bootstrap
Before you make any changes, run the tests and make sure that they pass (to confirm your environment is configured properly): - $ script/cibuild +
$ script/cibuild
If you are only updating a file in `test/`, you can use the command: - $ script/test test/blah_test.rb +
$ script/test test/blah_test.rb
If you are only updating a `.feature` file, you can use the command: - $ script/cucumber features/blah.feature +
$ script/cucumber features/blah.feature
Both `script/test` and `script/cucumber` can be run without arguments to run its entire respective suite. From 9474c370dc01e864f755d0498a6015a17ddfb905 Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Fri, 25 Mar 2016 15:11:42 -0700 Subject: [PATCH 64/65] Update history to reflect merge of #4712 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 8dcfe96c..1c96a387 100644 --- a/History.markdown +++ b/History.markdown @@ -56,6 +56,7 @@ * Use the correct URL, Fixes #4698 (#4699) * Add jekyll-paspagon plugin (#4700) * Bold-italicize note in assets documentation about needing yaml front matter (#4706) + * Highlight the `script/` calls in the Contributing documentation (#4712) ## 3.1.2 / 2016-02-19 From f2aa15555b860ee09ccf4b3a1a7291bef720cc2b Mon Sep 17 00:00:00 2001 From: jekyllbot Date: Fri, 25 Mar 2016 16:27:39 -0700 Subject: [PATCH 65/65] Update history to reflect merge of #4703 [ci skip] --- History.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/History.markdown b/History.markdown index 1c96a387..d43c99e5 100644 --- a/History.markdown +++ b/History.markdown @@ -17,6 +17,7 @@ * Site template: add explanation of site variables in the example `_config.yml` (#4704) * Adds `link` Liquid tag to make generation of URL's easier (#4624) * Allow static files to be symlinked in unsafe mode or non-prod environments (#4640) + * Add `:after_init` hook & add `Site#config=` to make resetting config easy (#4703) ### Bug Fixes