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

Add the ability to precompile assets to the source directory. #66

Closed
wants to merge 1 commit into from
Closed

Conversation

robotdana
Copy link

This enables using safe mode and the default jekyll setup on github pages,
as long jekyll build is run once in unsafe mode after files in
the _assets directory are modified.

I'm doing this because jekyll-assets is the only plugin I'm using
and this gives me the flexibility to make changes to _posts using
the github interface or something.

This enables using safe mode and the default jekyll on github pages,
as long it `jekyll build` is run once in unsafe mode after files in
the _assets directory are modified.

I'm doing this because `jekyll-assets` is the only plugin I'm using
and this gives me the flexibility to make changes to `_posts` using
the github interface or something.
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 415680d on dnl:master into 9ac861a on ixti:master.

@robotdana
Copy link
Author

This change did require me to put this in my layout, as I wasn't sure how to tell jekyll-assets what files to write without using the liquid tags, and it doesn't allow me to use the cache busting.

{% capture assets %}
    {{ 'application.css' | asset_path }}
    {{ 'libs/modernizr.js' | asset_path }}
    {{ 'libs/jquery.js' | asset_path }}
    {{ 'application.js' | asset_path }}
{% endcapture %}

I have a plan for restoring cache-busting though. Writing an _include containing just the stylesheet and javascript links when run in unsafe mode, that can be included even in safe mode.

@ixti
Copy link
Contributor

ixti commented Dec 25, 2013

I don't see any value in this workflow. You can't have any 3rd party plugins on github pages anyway, so you won't be able to have your asset_path helper or tag running on GH. That leads to the question how else you would refer to dynamically compiled assets? If using "well-known" path, then there's no need to use jekyll-assets at all IMHO, it's easier to use sprockets CLI instead, so you will have same structure (_assets) and a small rake task that will execute sprockets to prebuild assets. Actually you can even use JekyllAssets interface to get to force compile assets:

site     = Jekyll::Site.new Jekyll.configuration Hash.new
manifest = Sprockets::Manifest.new site.assets, "_site/assets/manifest.json"
manifest.compile "application.css", "application.js" # ...

@ixti ixti closed this May 25, 2014
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.

None yet

3 participants