New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow abbreviated post dates #5920

Merged
merged 4 commits into from Mar 2, 2017

Conversation

Projects
None yet
6 participants
@parkr
Member

parkr commented Mar 2, 2017

In #5609, we made the date matching much stricter: it had to be in YYYY-MM-DD. In a brief test on GitHub Pages, we noticed this issue.

This PR loosens this to allow 2-digit years, and 1-digit months and days. That makes this a valid filename:

_posts/12-2-5-my-post.md

I'm iffy on allowing 2-digit years, but the previous regexp allowed it (just three instances of \d+).

Fixes #5879 as well, @andrewbanchich. Would you please test this out?

I'm hoping to get this out as a v3.4.1 and include this patch in v3.5 as well.

/cc @jekyll/stability

parkr added some commits Mar 2, 2017

Failing test: abbreviated post dates are no longer read.
This is a regression introduced by #5609.

@jekyllbot jekyllbot assigned parkr and oe Mar 2, 2017

@parkr parkr requested review from pathawks and oe Mar 2, 2017

@parkr parkr added bug fix labels Mar 2, 2017

@parkr parkr added this to the 3.4.1 milestone Mar 2, 2017

@parkr parkr removed their assignment Mar 2, 2017

@ashmaroli

This comment has been minimized.

Show comment
Hide comment
@ashmaroli

ashmaroli Mar 2, 2017

Member

is this going to be merged into master?
I think 3.4.1 should branch off the 3.4-stable. master already contains enhancements that bumps to 3.5
Thoughts?

Member

ashmaroli commented Mar 2, 2017

is this going to be merged into master?
I think 3.4.1 should branch off the 3.4-stable. master already contains enhancements that bumps to 3.5
Thoughts?

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Mar 2, 2017

Member

is this going to be merged into master?
I think 3.4.1 should branch off the 3.4-stable. master already contains enhancements that bumps to 3.5
Thoughts?

You're correct! This is still an issue on master, though. Once this is merged, this will be backported.

Member

parkr commented Mar 2, 2017

is this going to be merged into master?
I think 3.4.1 should branch off the 3.4-stable. master already contains enhancements that bumps to 3.5
Thoughts?

You're correct! This is still an issue on master, though. Once this is merged, this will be backported.

parkr added some commits Mar 2, 2017

Attempt to alleviate strange Windows encoding error.
Error:
TestGeneratedSite#test_: generated sites should render latest post's content. :
Encoding::CompatibilityError: incompatible character encodings: IBM437 and UTF-8
    C:/projects/jekyll/test/test_generated_site.rb:22:in `include?'
    C:/projects/jekyll/test/test_generated_site.rb:22:in `block (2 levels) in <class:TestGeneratedSite>'
    C:/projects/jekyll/test/test_generated_site.rb:34:in `instance_exec'
    C:/projects/jekyll/test/test_generated_site.rb:34:in `block in create_test_from_should_hash'
Show outdated Hide outdated test/test_generated_site.rb
refute_nil -1, @site.posts.index { |post| post.relative_path == "_posts/2017-2-5-i-dont-like-zeroes.md" }
refute_nil @site.posts.index { |post|
post.relative_path == "_posts/2017-2-5-i-dont-like-zeroes.md"
}

This comment has been minimized.

@ashmaroli

ashmaroli Mar 2, 2017

Member

any reason you decided to depart from the convention of using do..end for code blocks?

      refute_nil @site.posts.index do |post|
        post.relative_path == "_posts/2017-2-5-i-dont-like-zeroes.md"
     end
@ashmaroli

ashmaroli Mar 2, 2017

Member

any reason you decided to depart from the convention of using do..end for code blocks?

      refute_nil @site.posts.index do |post|
        post.relative_path == "_posts/2017-2-5-i-dont-like-zeroes.md"
     end

This comment has been minimized.

@parkr

parkr Mar 2, 2017

Member

In this case, I like to imaging parentheses around the argument, like refute_nil(@site.posts.index...). The use of the curly braces indicate to me that this is used as an argument to refute_nil, whereas your example above doesn't read that directly. By diverging from the standard do...end, I call to attention that this statement is part of an argument.

@parkr

parkr Mar 2, 2017

Member

In this case, I like to imaging parentheses around the argument, like refute_nil(@site.posts.index...). The use of the curly braces indicate to me that this is used as an argument to refute_nil, whereas your example above doesn't read that directly. By diverging from the standard do...end, I call to attention that this statement is part of an argument.

@DirtyF

DirtyF approved these changes Mar 2, 2017

@oe

oe approved these changes Mar 2, 2017

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Mar 2, 2017

Member

@jekyllbot: merge +bug

Member

parkr commented Mar 2, 2017

@jekyllbot: merge +bug

@jekyllbot jekyllbot merged commit 3d5cf99 into master Mar 2, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jekyllbot jekyllbot added bug fix labels Mar 2, 2017

@jekyllbot jekyllbot deleted the allow-brief-post-dates branch Mar 2, 2017

jekyllbot added a commit that referenced this pull request Mar 2, 2017

parkr added a commit that referenced this pull request Mar 2, 2017

parkr added a commit that referenced this pull request Mar 2, 2017

Merge pull request #5924 from jekyll/3.4-stable-backport-5920
Backport #5920 for v3.4.x: Allow abbreviated post dates
@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Mar 2, 2017

Member

v3.4.1 released! Working on some release notes.

Member

parkr commented Mar 2, 2017

v3.4.1 released! Working on some release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment