mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
21 Commits
master
...
3.4-stable
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0d49e2c01 | ||
|
|
001ad63a60 | ||
|
|
c8ad29e459 | ||
|
|
981f4175fe | ||
|
|
d7e70c4751 | ||
|
|
628d62b4c6 | ||
|
|
610d461346 | ||
|
|
93a6ee6b7d | ||
|
|
bc1f5bb6e9 | ||
|
|
dc377aeaed | ||
|
|
35eb9dfd09 | ||
|
|
e159fb4b80 | ||
|
|
48f604fabd | ||
|
|
fce731ea45 | ||
|
|
b8cecdfd0e | ||
|
|
313ad449cd | ||
|
|
f4a1d9ce6a | ||
|
|
1f931b3e30 | ||
|
|
06a14739db | ||
|
|
622f37ecc8 | ||
|
|
0cdd14eb1e |
@@ -28,6 +28,7 @@ branches:
|
||||
only:
|
||||
- master
|
||||
- themes
|
||||
- 3.4-stable*
|
||||
|
||||
notifications:
|
||||
slack:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
3.4.0
|
||||
3.4.3
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
#
|
||||
|
||||
11
lib/jekyll/drops/static_file_drop.rb
Normal file
11
lib/jekyll/drops/static_file_drop.rb
Normal 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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Jekyll
|
||||
VERSION = "3.4.0".freeze
|
||||
VERSION = "3.4.5".freeze
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
5
test/source/_posts/2017-2-5-i-dont-like-zeroes.md
Normal file
5
test/source/_posts/2017-2-5-i-dont-like-zeroes.md
Normal 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.
|
||||
@@ -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
|
||||
|
||||
@@ -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+"
|
||||
#
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user