Compare commits

...

21 Commits

Author SHA1 Message Date
Parker Moore
e0d49e2c01 Release 💎 3.4.5 2017-06-30 22:14:44 -04:00
Ben Balter
001ad63a60 Always normalize the result of the relative_url filter (3.4.x backport) (#6186)
* always normalize the result of the relative_url filter

* add test
2017-06-30 22:13:09 -04:00
Parker Moore
c8ad29e459 Release 💎 3.4.4 2017-06-17 21:43:12 -04:00
Parker Moore
981f4175fe Bump to v3.4.4 2017-06-17 21:43:06 -04:00
Parker Moore
d7e70c4751 Backport #6137 for v3.4.x: Default baseurl to nil. 2017-06-17 21:43:06 -04:00
Parker Moore
628d62b4c6 Backport baseurl-set-to-nil from #6137 to 3.4-stable [merge conflicts] (#6146) 2017-06-17 21:41:14 -04:00
Pat Hawks
610d461346 Release 💎 3.4.3 2017-03-21 08:38:37 -05:00
Pat Hawks
93a6ee6b7d Merge pull request #5968 from jekyll/pull/3.4-escape_colon
Backport #5957 to 3.4.x
2017-03-21 08:13:17 -05:00
Parker Moore
bc1f5bb6e9 Fix missing trailing comma to alleviate fmt errors
Offenses:

test/test_static_file.rb:151:9: C: [Corrected] Style/TrailingCommaInLiteral: Put a comma after the last item of a multiline hash.
        "collection"    => nil
        ^^^^^^^^^^^^^^^^^^^^^^
2017-03-21 08:09:12 -05:00
Pat Hawks
dc377aeaed Rename test for clarity 2017-03-20 21:07:15 -05:00
Pat Hawks
35eb9dfd09 Allow colons in uri_escape filter
Fixes #5954
2017-03-20 21:07:14 -05:00
Parker Moore
e159fb4b80 Release 💎 3.4.2 2017-03-09 15:36:56 -05:00
Parker Moore
48f604fabd Release 💎 3.4.2 2017-03-09 15:36:10 -05:00
Parker Moore
fce731ea45 Merge pull request #5940 from jekyll/3.4-stable-backport-5871
Backport #5871 for v3.4.x: Convert StaticFile liquid representation to a Drop & add front matter defaults support to StaticFiles
2017-03-09 15:33:25 -05:00
jekyllbot
b8cecdfd0e Backport static-file-drop from #5871 to 3.4-stable 2017-03-08 10:42:12 -05:00
Parker Moore
313ad449cd Release 💎 3.4.1 2017-03-02 12:48:31 -05:00
Parker Moore
f4a1d9ce6a rake/release: allow releases from *-stable branches. 2017-03-02 12:47:46 -05:00
Parker Moore
1f931b3e30 Merge pull request #5924 from jekyll/3.4-stable-backport-5920
Backport #5920 for v3.4.x: Allow abbreviated post dates
2017-03-02 12:41:52 -05:00
Parker Moore
06a14739db This might allow regexp, actually. Build *all* backport branches too. 2017-03-02 12:41:19 -05:00
Parker Moore
622f37ecc8 Also build 3.4-stable branch. 2017-03-02 12:40:44 -05:00
jekyllbot
0cdd14eb1e Backport allow-brief-post-dates from #5920 to 3.4-stable 2017-03-02 12:33:35 -05:00
17 changed files with 109 additions and 20 deletions

View File

@@ -28,6 +28,7 @@ branches:
only:
- master
- themes
- 3.4-stable*
notifications:
slack:

View File

@@ -1,3 +1,24 @@
## 3.4.5 / 2017-06-30
* Backport #6185 for v3.4.x: Always normalize the result of the `relative_url` filter (#6186)
## 3.4.4 / 2016-06-17
* Backport #6137 for v3.4.x: Default `baseurl` to `nil` instead of empty string (#6146)
## 3.4.3 / 2017-03-21
* Backport #5957 for v3.4.x: Allow colons in `uri_escape` filter (#5968)
## 3.4.2 / 2017-03-09
* Backport #5871 for v3.4.x: Convert StaticFile liquid representation to
a Drop & add front matter defaults support to StaticFiles (#5940)
## 3.4.1 / 2017-03-02
* Backport #5920 for v3.4.x: Allow abbreviated post dates (#5924)
## 3.4.0 / 2016-01-27
### Minor Enhancements

View File

@@ -4,6 +4,25 @@ permalink: "/docs/history/"
note: This file is autogenerated. Edit /History.markdown instead.
---
## 3.4.3 / 2017-03-21
{: #v3-4-3}
- Backport [#5957]({{ site.repository }}/issues/5957) for v3.4.x: Allow colons in `uri_escape` filter ([#5968]({{ site.repository }}/issues/5968))
## 3.4.2 / 2017-03-09
{: #v3-4-2}
- Backport [#5871]({{ site.repository }}/issues/5871) for v3.4.x: Convert StaticFile liquid representation to
a Drop & add front matter defaults support to StaticFiles ([#5940]({{ site.repository }}/issues/5940))
## 3.4.1 / 2017-03-02
{: #v3-4-1}
- Backport [#5920]({{ site.repository }}/issues/5920) for v3.4.x: Allow abbreviated post dates ([#5924]({{ site.repository }}/issues/5924))
## 3.4.0 / 2016-01-27
{: #v3-4-0}

View File

@@ -1 +1 @@
3.4.0
3.4.3

View File

@@ -103,7 +103,7 @@ module Jekyll
private
def start_up_webrick(opts, destination)
server = WEBrick::HTTPServer.new(webrick_opts(opts)).tap { |o| o.unmount("") }
server.mount(opts["baseurl"], Servlet, destination, file_handler_opts)
server.mount(opts["baseurl"].to_s, Servlet, destination, file_handler_opts)
Jekyll.logger.info "Server address:", server_address(server, opts)
launch_browser server, opts if opts["open_url"]
boot_or_detach server, opts

View File

@@ -45,7 +45,7 @@ module Jekyll
"detach" => false, # default to not detaching the server
"port" => "4000",
"host" => "127.0.0.1",
"baseurl" => "",
"baseurl" => nil, # this mounts at /, i.e. no subdirectory
"show_dir_listing" => false,
# Output Configuration

View File

@@ -9,7 +9,7 @@ module Jekyll
YAML_FRONT_MATTER_REGEXP = %r!\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)!m
DATELESS_FILENAME_MATCHER = %r!^(?:.+/)*(.*)(\.[^.]+)$!
DATE_FILENAME_MATCHER = %r!^(?:.+/)*(\d{4}-\d{2}-\d{2})-(.*)(\.[^.]+)$!
DATE_FILENAME_MATCHER = %r!^(?:.+/)*(\d{2,4}-\d{1,2}-\d{1,2})-(.*)(\.[^.]+)$!
# Create a new Document.
#

View File

@@ -0,0 +1,11 @@
module Jekyll
module Drops
class StaticFileDrop < Drop
extend Forwardable
def_delegators :@obj, :name, :extname, :modified_time, :basename
def_delegator :@obj, :relative_path, :path
def_delegator :@obj, :data, :fallback_data
def_delegator :@obj, :type, :collection
end
end
end

View File

@@ -152,7 +152,7 @@ module Jekyll
#
# Returns the escaped String.
def uri_escape(input)
Addressable::URI.encode(input)
Addressable::URI.normalize_component(input)
end
# Replace any whitespace in the input string with a single space

View File

@@ -23,9 +23,9 @@ module Jekyll
def relative_url(input)
return if input.nil?
site = @context.registers[:site]
return ensure_leading_slash(input.to_s) if site.config["baseurl"].nil?
parts = [site.config["baseurl"], input]
Addressable::URI.parse(
ensure_leading_slash(site.config["baseurl"]) + ensure_leading_slash(input.to_s)
parts.compact.map { |part| ensure_leading_slash(part.to_s) }.join
).normalize.to_s
end

View File

@@ -28,6 +28,10 @@ module Jekyll
@collection = collection
@relative_path = File.join(*[@dir, @name].compact)
@extname = File.extname(@name)
data.default_proc = proc do |_, key|
site.frontmatter_defaults.find(relative_path, type, key)
end
end
# rubocop: enable ParameterLists
@@ -96,13 +100,15 @@ module Jekyll
end
def to_liquid
{
"basename" => File.basename(name, extname),
"name" => name,
"extname" => extname,
"modified_time" => modified_time,
"path" => File.join("", relative_path),
}
@to_liquid ||= Drops::StaticFileDrop.new(self)
end
def data
@data ||= {}
end
def basename
File.basename(name, extname)
end
def placeholders

View File

@@ -1,3 +1,3 @@
module Jekyll
VERSION = "3.4.0".freeze
VERSION = "3.4.5".freeze
end

View File

@@ -6,13 +6,14 @@
desc "Release #{name} v#{version}"
task :release => :build do
unless `git branch` =~ %r!^\* master$!
current_branch = `git branch`.to_s.strip.match(%r!^\* (.+)$!)[1]
unless current_branch == "master" || current_branch.end_with?("-stable")
puts "You must be on the master branch to release!"
exit!
end
sh "git commit --allow-empty -m 'Release :gem: #{version}'"
sh "git tag v#{version}"
sh "git push origin master"
sh "git push origin #{current_branch}"
sh "git push origin v#{version}"
sh "gem push pkg/#{name}-#{version}.gem"
end

View File

@@ -0,0 +1,5 @@
---
foo: bar
---
I have an abbreviated date. Instead of "2017-02-05", I am instead "2017-2-5".
Zeros have always seemed superfluous.

View File

@@ -317,6 +317,11 @@ class TestFilters < JekyllUnitTest
assert_equal "my%20things", @filter.uri_escape("my things")
end
should "allow colons in URI" do
assert_equal "foo:bar", @filter.uri_escape("foo:bar")
assert_equal "foo%20bar:baz", @filter.uri_escape("foo bar:baz")
end
context "absolute_url filter" do
should "produce an absolute URL from a page URL" do
page_url = "/about/my_favorite_page/"
@@ -440,6 +445,15 @@ class TestFilters < JekyllUnitTest
})
assert_equal "/base", filter.relative_url(page_url)
end
should "not return the url by reference" do
filter = make_filter_mock({ baseurl: nil })
page = Page.new(filter.site, test_dir("fixtures"), "", "front_matter.erb")
assert_equal "/front_matter.erb", page.url
url = filter.relative_url(page.url)
url << "foo"
assert_equal "/front_matter.erb", page.url
end
end
context "jsonify filter" do

View File

@@ -7,11 +7,14 @@ class TestGeneratedSite < JekyllUnitTest
@site = fixture_site
@site.process
@index = File.read(dest_dir("index.html"))
@index = File.read(
dest_dir("index.html"),
Utils.merged_file_read_opts(@site, {})
)
end
should "ensure post count is as expected" do
assert_equal 51, @site.posts.size
assert_equal 52, @site.posts.size
end
should "insert site.posts into the index" do
@@ -48,6 +51,13 @@ class TestGeneratedSite < JekyllUnitTest
assert_exist dest_dir("dynamic_file.php")
end
should "include a post with a abbreviated dates" do
refute_nil @site.posts.index { |post|
post.relative_path == "_posts/2017-2-5-i-dont-like-zeroes.md"
}
assert_exist dest_dir("2017", "02", "05", "i-dont-like-zeroes.html")
end
should "print a nice list of static files" do
time_regexp = "\\d+:\\d+"
#

View File

@@ -148,8 +148,9 @@ class TestStaticFile < JekyllUnitTest
"extname" => ".txt",
"modified_time" => @static_file.modified_time,
"path" => "/static_file.txt",
"collection" => nil,
}
assert_equal expected, @static_file.to_liquid
assert_equal expected, @static_file.to_liquid.to_h
end
end
end