Skip to content

Adapt StaticFile for collections, config defaults - #3823

Merged
envygeeks merged 1 commit into
jekyll:masterfrom
18F:adapt-static-file
Jul 1, 2015
Merged

envygeeks merged 1 commit into
jekyll:masterfrom
18F:adapt-static-file

Conversation

@mbland

@mbland mbland commented Jun 25, 2015

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

I like it 👍

@mbland
mbland force-pushed the adapt-static-file branch from 0743afd to 3f90a2a Compare June 25, 2015 17:33
mbland pushed a commit to 18F/jekyll that referenced this pull request Jun 25, 2015
@mbland

mbland commented Jun 25, 2015

Copy link
Copy Markdown
Contributor Author

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

@envygeeks

Copy link
Copy Markdown
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
mbland force-pushed the adapt-static-file branch from 3f90a2a to c66a874 Compare June 25, 2015 17:36
@mbland

mbland commented Jun 25, 2015

Copy link
Copy Markdown
Contributor Author

No problem! Done.

@dhcole

dhcole commented Jun 25, 2015

Copy link
Copy Markdown
Contributor

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

Comment thread lib/jekyll/static_file.rb Outdated

Copy link
Copy Markdown
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
Copy Markdown
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

parkr commented Jun 29, 2015

Copy link
Copy Markdown
Member

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
mbland force-pushed the adapt-static-file branch from fa282bb to 80ae0da Compare June 29, 2015 23:41
mbland pushed a commit to 18F/jekyll that referenced this pull request Jun 29, 2015
@mbland

mbland commented Jun 29, 2015

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
mbland force-pushed the adapt-static-file branch from 80ae0da to 250b6eb Compare June 29, 2015 23:58
@mbland

mbland commented Jun 29, 2015

Copy link
Copy Markdown
Contributor Author

Yep! Done.

@parkr

parkr commented Jun 30, 2015

Copy link
Copy Markdown
Member

Cool! :shipit:

@mbland

mbland commented Jul 1, 2015

Copy link
Copy Markdown
Contributor Author

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

@envygeeks

Copy link
Copy Markdown
Contributor

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

@mbland

mbland commented Jul 1, 2015

Copy link
Copy Markdown
Contributor Author

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.

5 participants