Skip to content
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 extensionless document in a strict site #7950

Merged
merged 3 commits into from Apr 30, 2020

Conversation

ashmaroli
Copy link
Member

  • This is a 🐛 bug fix.
  • I've added tests

Background

Jekyll allows Documents in a custom collection to be without an extension (even if Markdown content in it won't get converted).
But in Jekyll 4.0, such documents output an error:

Error: could not read file source/_foo/bar: undefined method `gsub!' for nil:NilClass

But building proceeds since the error is rescued away.
However, if the site has been configured with strict_front_matter: true, the build aborts on error.

Summary

Ensure a non-nil slug for extensionless document in a custom collection and not abort builds with strict_front_matter: true.
Extensionless document inside _posts continue to remain unread.

@ashmaroli ashmaroli added the fix label Dec 26, 2019
@ashmaroli ashmaroli added this to the 4.1 milestone Dec 26, 2019
@ashmaroli ashmaroli requested a review from a team December 26, 2019 17:34
Copy link
Member

@DirtyF DirtyF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really remember why we allow extensionless documents in collection :)

@ashmaroli
Copy link
Member Author

why we allow extensionless documents in collection

@DirtyF I tested down until Jekyll 3.6..
It doesn't look like if we ever explicitly supported extensionless documents in a collection.. 🤷‍♂️

@DirtyF
Copy link
Member

DirtyF commented Apr 13, 2020

We should rather aim at removing those discrepancies and align on posts behavior for extensionless documents.

@ashmaroli
Copy link
Member Author

aim at removing those discrepancies and align on posts behavior for extensionless documents

Could you clarify with an example scenario..?

@DirtyF
Copy link
Member

DirtyF commented Apr 13, 2020

I haven't got a specific scenario in mind, where you would need to have extensionless files in a collection, do you?

@DirtyF
Copy link
Member

DirtyF commented Apr 30, 2020

@jekyll: merge +fix

@jekyllbot jekyllbot merged commit f69471c into jekyll:master Apr 30, 2020
@jekyllbot jekyllbot added the bug label Apr 30, 2020
jekyllbot added a commit that referenced this pull request Apr 30, 2020
@ashmaroli ashmaroli deleted the extensionless-doc-slug branch April 30, 2020 19:01
@jekyll jekyll locked and limited conversation to collaborators Apr 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants