Compare commits

...

9 Commits

Author SHA1 Message Date
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
12 changed files with 71 additions and 14 deletions

View File

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

View File

@@ -1,3 +1,12 @@
## 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,19 @@ permalink: "/docs/history/"
note: This file is autogenerated. Edit /History.markdown instead.
---
## 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.2

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

@@ -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.2".freeze
end

View File

@@ -6,7 +6,8 @@
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

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

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