Allow collections YAML to end with dots #3134

Merged
merged 1 commit into from Jan 17, 2015

Conversation

Projects
None yet
5 participants
@davidized
Contributor

davidized commented Nov 20, 2014

Posts can have YAML front matter that ends with three dots instead of dashes since 52ac2b3 but that only applies to posts. This PR adds the ability for the YAML front matter of collections files to end with dots as well.

I don't have very much experience in writing ruby code and tests, but I managed to write one. It probably can be improved but I just don't have enough experience to know how to do that yet.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Nov 20, 2014

Member

Hm. As much as I want to abide by the YAML spec, I want to make it such that each outcome has only one method to achieve it. So saying "either dots or dashes" does not help new users learn Jekyll... it just complicates things.

I agree we should have parity but I guess I'd rather we use dashes everywhere.

Member

parkr commented Nov 20, 2014

Hm. As much as I want to abide by the YAML spec, I want to make it such that each outcome has only one method to achieve it. So saying "either dots or dashes" does not help new users learn Jekyll... it just complicates things.

I agree we should have parity but I guess I'd rather we use dashes everywhere.

@pathawks

This comment has been minimized.

Show comment
Hide comment
@pathawks

pathawks Nov 21, 2014

Member

It seems like, either way, a firm decision should be made. Dots are ok everywhere, or dots are ok nowhere.

I don't know what Jekyll would have to gain by breaking compatibility with the YAML spec; that doesn't make things easier.

Member

pathawks commented Nov 21, 2014

It seems like, either way, a firm decision should be made. Dots are ok everywhere, or dots are ok nowhere.

I don't know what Jekyll would have to gain by breaking compatibility with the YAML spec; that doesn't make things easier.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Nov 21, 2014

Member

It gains simplicity, directness. I agree we need a decision. I will think on it.

Member

parkr commented Nov 21, 2014

It gains simplicity, directness. I agree we need a decision. I will think on it.

@troyswanson

This comment has been minimized.

Show comment
Hide comment
@troyswanson

troyswanson Nov 21, 2014

Member

My vote is to stop dots.

ccg02-l

(Hopefully someone got that Onyxia Wipe reference.)

Member

troyswanson commented Nov 21, 2014

My vote is to stop dots.

ccg02-l

(Hopefully someone got that Onyxia Wipe reference.)

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Nov 22, 2014

Member

Removing the dots. Thanks for the pull request, @davidized!

Member

parkr commented Nov 22, 2014

Removing the dots. Thanks for the pull request, @davidized!

@parkr parkr closed this Nov 22, 2014

@parkr parkr referenced this pull request Nov 22, 2014

Closed

Revert "Permit YAML blocks to end with three dots" #3138

1 of 2 tasks complete

@parkr parkr reopened this Jan 17, 2015

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Jan 17, 2015

Member

Yeah I changed my mind. I don't care about supporting dots. May as well do it. /cc @lmullen sorry for the headaches guys, I'm just frustrated by the potential to make Jekyll more complex. Complexity is usually increased when adding flexibility. More state to keep in the brain when you're writing a website.

Member

parkr commented Jan 17, 2015

Yeah I changed my mind. I don't care about supporting dots. May as well do it. /cc @lmullen sorry for the headaches guys, I'm just frustrated by the potential to make Jekyll more complex. Complexity is usually increased when adding flexibility. More state to keep in the brain when you're writing a website.

@@ -210,7 +210,7 @@ def read(opts = {})
@data = defaults
end
@content = File.read(path, merged_file_read_opts(opts))
- if content =~ /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m
+ if content =~ /\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m

This comment has been minimized.

@parkr

parkr Jan 17, 2015

Member

Let's put this in some const somewhere. It's used in site.rb as well.

@parkr

parkr Jan 17, 2015

Member

Let's put this in some const somewhere. It's used in site.rb as well.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Jan 17, 2015

Member

This'll need a rebase.

Member

parkr commented Jan 17, 2015

This'll need a rebase.

@parkr parkr added this to the 3.0 milestone Jan 17, 2015

@parkr parkr merged commit d7e3d4d into jekyll:master Jan 17, 2015

1 check failed

continuous-integration/travis-ci The Travis CI build failed
Details

parkr added a commit that referenced this pull request Jan 17, 2015

parkr added a commit that referenced this pull request Jan 18, 2015

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

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