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

Adapt StaticFile for collections, config defaults #3823

Merged
merged 1 commit into from Jul 1, 2015

Conversation

mbland
Copy link
Contributor

@mbland mbland commented Jun 25, 2015

This enables files such as images and PDFs to show up in the same relative output directory as other HTML and Markdown documents in the same collection.

It also enables static files to be hidden using defaults from _config.yml in the same way that other documents in the same collection and directories may be hidden using published: false.

Extracted from 18F/hub#332.

cc: @afeld @gboone @jeremiak @dhcole

@envygeeks
Copy link
Contributor

I like it 👍

mbland pushed a commit to 18F/jekyll that referenced this pull request Jun 25, 2015
@mbland
Copy link
Contributor Author

mbland commented Jun 25, 2015

@envygeeks Thanks for the rapid feedback. All comments incorporated!

@envygeeks
Copy link
Contributor

Do you mind rebasing the two commits into a single commit and forcing it up again so that other reviewers can see both the changes and everything in on swift review? Thanks!

@mbland
Copy link
Contributor Author

mbland commented Jun 25, 2015

No problem! Done.

@dhcole
Copy link
Contributor

dhcole commented Jun 25, 2015

Nice work @mbland. Would be great to see this land in Jekyll core.

title: '',
},
}).to_s
@url = @url.gsub /\/$/, ''
Copy link
Member

Choose a reason for hiding this comment

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

this is effectively @url.gsub! – why not use the bang method here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

I must've been thinking about how gsub! will return nil if nothing was changed, and how that would not work as a return value. But it's not a return value here.

@parkr
Copy link
Member

parkr commented Jun 29, 2015

Looking pretty good! Thanks, @mbland.

Looks like you're coming from a Python background, based on all those self.'s. In Ruby, we only use them when setting an attribute on a class instance, such as self.url = "some new url". When we access the attribute, however, we do not include the self. If you would please remove each instance of self. whenever accessing instance variables or methods, I would be most appreciative!

mbland pushed a commit to 18F/jekyll that referenced this pull request Jun 29, 2015
mbland pushed a commit to 18F/jekyll that referenced this pull request Jun 29, 2015
@mbland
Copy link
Contributor Author

mbland commented Jun 29, 2015

Thanks, @parkr! Took out all the self.s, though it's actually @afeld's fault I started using them in Ruby. :-P

@envygeeks
Copy link
Contributor

Can you please rebase all this into a single commit so that it can be re-reviewed in one swift shot.

Thanks.

This enables files such as images and PDFs to show up in the same relative
output directory as other HTML and Markdown documents in the same collection.

It also enables static files to be hidden using defaults from _config.yml in
the same way that other documents in the same collection and directories may
be hidden using `published: false`.
@mbland
Copy link
Contributor Author

mbland commented Jun 29, 2015

Yep! Done.

@parkr
Copy link
Member

parkr commented Jun 30, 2015

Cool! :shipit:

@mbland
Copy link
Contributor Author

mbland commented Jul 1, 2015

Hey gang, not to nag, but is there further review pending, or is this ready to merge?

@envygeeks
Copy link
Contributor

This is ready! Sorry I didn't notice @parkr said to :shipit:

envygeeks added a commit that referenced this pull request Jul 1, 2015
Adapt StaticFile for collections, config defaults
@envygeeks envygeeks merged commit 3a49770 into jekyll:master Jul 1, 2015
@mbland
Copy link
Contributor Author

mbland commented Jul 1, 2015

Sweeet, thanks, @envygeeks!

@mbland mbland deleted the adapt-static-file branch July 7, 2015 14:17
@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants