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

Expose site.static_files to Liquid #2075

Merged
merged 9 commits into from Feb 19, 2014

Conversation

Projects
None yet
4 participants
@parkr
Copy link
Member

parkr commented Feb 19, 2014

site.static_files now contains objects like this:

file.path => /css/screen.css
file.extname => .css
file.modified_time => 1232353253

WHY DIDN'T WE DO THIS BEFORE

@parkr parkr added this to the 2.0 milestone Feb 19, 2014

@parkr parkr added the Feature label Feb 19, 2014

@mattr-

This comment has been minimized.

Copy link
Member

mattr- commented Feb 19, 2014

Are we testing what we expose to Liquid? If not, then 👍

@parkr

This comment has been minimized.

Copy link
Member Author

parkr commented Feb 19, 2014

Looking into it...

@parkr

This comment has been minimized.

Copy link
Member Author

parkr commented Feb 19, 2014

Boom.

@parkr parkr referenced this pull request Feb 19, 2014

Closed

Add JSON index file #2

parkr added some commits Feb 19, 2014

{
"path" => relative_path,
"modified_time" => mtime.to_s,
"extname" => File.extname(relative_path)

This comment has been minimized.

@parkr

parkr Feb 19, 2014

Author Member

@benbalter Any other variables you think would be useful here for static files?

parkr added a commit that referenced this pull request Feb 19, 2014

@parkr parkr merged commit 27be7e2 into master Feb 19, 2014

@parkr parkr deleted the expose-static-files branch Feb 19, 2014

parkr added a commit that referenced this pull request Feb 19, 2014

parkr added a commit that referenced this pull request Feb 25, 2014

@gjtorikian

This comment has been minimized.

Copy link
Member

gjtorikian commented Dec 11, 2014

@parkr I have a site with ~300 collection files, and it takes about a minute and a half to build (just that portion).

My stackprof boils down nearly a fourth of the calls to relative_path in static_file.rb. That's actually a red herring, though; the real problem seems to come from the sort call in sort.rb, introduced in this PR.

My question is whether or not this sort is actually necessary. I'm not entirely sure what its purpose is. I haven't investigated whether removing this sort would change the build impact, but can do so if it's helpful.

@parkr

This comment has been minimized.

Copy link
Member Author

parkr commented Dec 11, 2014

My stackprof boils down nearly a fourth of the calls to relative_path in static_file.rb. That's actually a red herring, though; the real problem seems to come from the sort call in sort.rb, introduced in this PR.

Interesting! It is sorted on every call, which is a huge no-no. D'oh! Those could be sorted after all the static files are read in. That would be wiser.

The sort call just means when you co {% for file in site.static_files %}, you get each file in a given order. It means Windows & Linux behave the same way (Windows has been known to read files in in an unordered way).

parkr added a commit that referenced this pull request Dec 11, 2014

parkr added a commit that referenced this pull request Dec 18, 2014

parkr added a commit that referenced this pull request Dec 27, 2014

@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.
You can’t perform that action at this time.