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

Added support for loadCSS and async javascripts #56

Merged
merged 5 commits into from
May 4, 2015
Merged

Added support for loadCSS and async javascripts #56

merged 5 commits into from
May 4, 2015

Conversation

imathis
Copy link
Member

@imathis imathis commented May 3, 2015

This should fix octopress/asset-pipeline#15

@imathis
Copy link
Member Author

imathis commented May 3, 2015

Basically you'll be able to add this to your _config.yml and it will automatically load your CSS asynchronously, but only if it is building the combined file (for production).

asset_pipeline:
  async_css: true

This also sets async javascript to true for combined (production) script tags. Since the order is already defined by the plugins (or author in the case of octopress-asset-pipeline), this accomplishes the same as defer but loads the js in asynchronously.

@imathis
Copy link
Member Author

imathis commented May 3, 2015

Here is what it looks like when you generate with async_css: true.

@kogakure
Copy link

kogakure commented May 4, 2015

Nice! All I thought of was to have a path and you include loadCSS and all things needed by default 😮 Thank you for this cool solution! 👍

@imathis
Copy link
Member Author

imathis commented May 4, 2015

I started out looking at what it would take to make it work with paths, but the implementation using paths ended up being really inelegant. So I decided that I might as well make it work the way I'd want to use it. Thanks for drawing my attention to this. :)

imathis added a commit that referenced this pull request May 4, 2015
Added support for loadCSS and async javascripts
@imathis imathis merged commit 3d3f14c into master May 4, 2015
@imathis imathis deleted the async branch May 4, 2015 14:52
imathis added a commit that referenced this pull request May 18, 2015
Added support for loadCSS and async javascripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Path support
2 participants