GithubHelp home page GithubHelp logo

envygeeks / jekyll-assets Goto Github PK

View Code? Open in Web Editor NEW
1.1K 23.0 167.0 6.72 MB

:art: Asset pipelines for Jekyll.

License: ISC License

Ruby 94.01% JavaScript 0.08% HTML 1.67% CSS 0.81% Liquid 0.18% Shell 3.26%
jekyll-assets sprockets asset-pipeline liquid sass scss assets jekyll sprockets-4 uglifier

jekyll-assets's People

Contributors

6twenty avatar adilsoncarvalho avatar alexey-pelykh avatar andrewheberle avatar beanieboi avatar chalin avatar dependabot-preview[bot] avatar devm33 avatar drewish avatar envygeeks avatar fmeum avatar ixti avatar j15e avatar jeremy avatar justinmusgrove avatar kikobeats avatar maesitos avatar migueldemoura avatar mikej avatar mitchellcash avatar mloberg avatar nhoizey avatar nlemoine avatar nz avatar philnash avatar roshanshariff avatar sajal2692 avatar tomdiggle avatar yankie avatar zmbush avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jekyll-assets's Issues

CSS Liquid Processing?

Let's say that I have some CSS in _assets/stylesheets/styles.css which looks like this:


---

---

#header {
  background-image: /images/mybackground.png
}

But now I move that image into _assets as well. I need my CSS to be able to reference the cache-busted version:


---

---

#header {
  background-image: {% asset_path mybackground.png %}
}

But this doesn't seem to work? Even though the CSS file has a yaml header, it doesn't get processed, apparently because it's in _assets? Is there a correct way to do this?

JavaScript licenses being removed

Hello there, if I have Uglifier set as the compressor, comments that contain licensing information at the top of the file are being removed. Take, for example, Modernizr:

/* Modernizr 2.5.3 (Custom Build) | MIT & BSD
 * Build: http://www.modernizr.com/download/#-cssclasses-load
 */

Or jQuery:

/*! jQuery v1.7.2 jquery.com | jquery.org/license */

Is there a configuration setting I'm missing? When I run Uglifier normally it keeps the comments around. Thank you very much for the wonderful library.

Copy and compile SCSS files even if not directly included via liquid tags when using @import url() directive

In my layout I've included my stylesheet common.css.scss in this way

<!--[if gt IE 8]><!-->{% stylesheet common %}<!--<![endif]-->

and this correctly generates

<!--[if gt IE 8]><!--><link rel="stylesheet" href="/assets/common.css?cb=094e764b8130638a5ad5f3bfa0efe705" /><!--<![endif]-->

Now, in my SCSS file I'd like to have the capabilty to also import some css file (not the sass @import, I'm talking about the CSS2.1 @import directive), e.g.

@import url(homepage.css);
@import url(welcomepage.css);

because the templates I'm working on will be integrated later in some kind of CMS and the system integrator asked me to have on single css file with all clean inclusions. So I tried this approach, creating my homepage.css.scss and welcomepage.css.scss but these files are neither compiled nor copied into my destination folder.

Don't know if a different solution exists or if this can be an improvement for your plugin: right now I'm just using the SASS @import but this "explodes" all the content of several sass in one single file (the common.css)

Thank you.

Create a cache-busted file + regular one.

It would be great if there was an option to generate both a regular asset and a cache-busted asset.

I'm using my site programatically and I need to know the location of particular assets beforehand.

I could set cachebust to none and be done with it, but I like cache bustin'.

Is there a way to require a JS file which also requires JS files?

_assets/javascripts/main.js

//= require bootstrap/bootstrap

_assets/javascripts/bootstrap/bootstrap.js

//= require bootstrap/bootstrap/transition
//= require bootstrap/bootstrap/alert
//= require bootstrap/bootstrap/button
//= require bootstrap/bootstrap/carousel
// ...

SASS/SCSS asset_path not working correctly

Hi ixti,

I've created a mixin:

@mixin font-face($nick, $name, $file, $weight: normal, $style: normal){
    @font-face {
        font-family: $nick;
        src: url(asset_path("#{$file}.eot"));
        src: url(asset_path("#{$file}.eot?#iefix")) format('embedded-opentype'),
             url(asset_path("#{$file}.woff")) format('woff'),
             url(asset_path("#{$file}.ttf")) format('truetype'),
             url(asset_path("#{$file}.svg##{$name}")) format('svg');
        font-weight: $weight;
        font-style: $style;
    }
}

However, when I build the site I get the following error:

 Liquid Exception: Couldn't find file 'font/lacuna-webfont.eot?#iefix' (in /cygdrive/c/Users/Hans/git/hans.viessmann.co/_assets/stylesheets/main.css.scss) in default.html

I just recently updated to 0.6.0, have there been any changes in how asset_path works?

Thanks

Post content {% javascript app %} bug

When I use the following command inside a post body:

{% javascript app %}

The final html generate an unclosed script tag like this:

<script src="assets/javascript/app.js">

Disturbing all the following content.

Preprocess JS/CSS with Liquid

This should allow us use asset_path helpers without ERB in JS/CSS assets like this:

# file: app.js.coffee
yepnope.load '{% asset_path app.css %}'
/* file: app.css */
body {
  background-image: url({% asset_path bg.png %});
}

Overriding CSS and JS tags and generating asset_path without renaming the file to MD5

Jekyll Assets is great but, I would like to be able to change some things such as:

STYLESHEET = '<link rel="stylesheet" type="text/css" href="%s">'

Is it possible to be done extending / overriding in the _plugin ? If yes, what is the best approach?

I also would like to use the {% asset_path test.jpg %} without renaming the file to MD5. Is there any config option to disable it?

GZip support for general assets

When defining a background-image url in a CSS file, the asset pipeline does not pick this up and won't cachebust neither gzip this file.

When adding the files in to /assets/images/ they get copied to /_site/ when building which make the CSS background-image work fine but still no GZip compression.

Can this be fixed? And how?

site_patch.rb:53:in `uniq!': can't convert String into Integer (TypeError)

Iโ€™m trying to make Compass work. It fails with an error.

jekyll-assets 0.7.0
jekyll 1.0.3

plugins/jekyll-assets.rb

require "jekyll-assets"
require "jekyll-assets/compass"

default.html:

...
{% stylesheet main %}
...

_config.yml

assets:
  dirname: assets
  baseurl: /assets/
  sources:
    - _assets/sass
  debug: true
  css_compressor: 'sass'

_assets/sass/main.scss

@import "compass";
...
โžค bundle exec jekyll serve --watch --trace
Configuration file: /Users/nv/Sites/n12v.com/_config.yml
            Source: source
       Destination: public
      Generating... /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/jekyll-assets-0.7.0/lib/jekyll/assets_plugin/patches/site_patch.rb:53:in `uniq!': can't convert String into Integer (TypeError)
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/jekyll-assets-0.7.0/lib/jekyll/assets_plugin/patches/site_patch.rb:53:in `__wrap_write'
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/jekyll-1.0.3/lib/jekyll/site.rb:46:in `process'
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/jekyll-1.0.3/lib/jekyll/command.rb:18:in `process_site'
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/jekyll-1.0.3/lib/jekyll/commands/build.rb:23:in `build'
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/jekyll-1.0.3/lib/jekyll/commands/build.rb:7:in `process'
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/jekyll-1.0.3/bin/jekyll:85:in `block (2 levels) in <top (required)>'
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/runner.rb:402:in `run_active_command'
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/runner.rb:78:in `run!'
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/delegates.rb:11:in `run!'
    from /usr/local/Cellar/ruby/1.9.3-p362/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/import.rb:10:in `block in <top (required)>'

Process asset required by tags

Using liquid tags asset_path, javascript, stylesheet on assets that were not bundled, it's better bundle them instead of "warning".

Preprocessing breaks {{ }} interpolation in assets

Hey,

I just ran into some major problems with the liquid pre-processors..
https://github.com/ixti/jekyll-assets/blob/master/lib/jekyll/assets_plugin/environment.rb#L34

Basically it kills any script that has {{}} somewhere in the code.
Template interpolation get whiped out, template with {{ things }} turs into template with.
Angular.js source code breaks because it's literred with comments of illegal interpolations (according to liquid syntax)..

I saw you introduced this change here: #6

Was there any other reason for this? Why not use erb? Seems to do way more harm than good.

Allow remote assets

Would this feature make sense?

{% stylesheet http://some-stylesheet.css %}
{% image http://some-image.jpg %}
...

Can't include a "fonts" directory

I'm using a font for icons and would like to include the different variants of the font in my assets folder (.svg, .eot, .ttf, .woff).

I tried adding sources: _assets/fonts to my _config.yml file and that didn't work. I also tried adding a custom vendor via the plugin. I don't think I'm doing this right.

I need jekyll-assets to include the fonts directory so that I can reference it in my scss. Thanks.

Images not being copied recursively when generating the site statically.

So, using the config.ru inclusion to serve assets dynamically, requests for say, /assets/some_dir/foo.png work fine. However, when generating the site statically, only images from source/_assets/images are copied -- not source/_assets/images/some_dir.

The relevant portion of my config.ru:

$root = ::File.dirname(__FILE__)
require File.expand_path(File.join($root, 'plugins/assets'))
map "/assets" do
  environment = Sprockets::Environment.new
  environment.append_path "source/_assets/stylesheets"
  environment.append_path "source/_assets/javascripts"
  environment.append_path "source/_assets/images"
  environment.append_path "source/_assets/fonts"
  run environment
end

And the relevant portion of my assets.yml (compiled by Octopress into _config.yml):

---
assets:
  #
  # Pathname of the destination of generated (bundled) assets relative
  # to the destination of the root.
  #
  dirname: assets
  #
  # Base URL of assets paths.
  #
  baseurl: /assets/
  #
  # Pathnames where to find assets relative to the root of the site.
  #
  sources:
    - _assets/javascripts
    - _assets/stylesheets
    - _assets/images
    - _assets/fonts
  #
  # Compression/minification tools.
  #
  compress:
    js:   uglifier
    css:  sass
  #
  # CDN URL.
  #
#  baseurl: //my.super-cool-cdn.com/
  #
  # Cache-busting.
  # Options are:
  # none - no cachebuster added to URL.
  # soft - filename is left alone, but ?cb=<x> is added via asset path helpers.
  # hard - filename is modified with checksum.
  #
  cachebust: none

coffee script compilation fails

Hello hello

I'm not sure what is the issue. The problem I have appeared today. before it was all fine.
When I run Jekyll with my app.js.coffee i now get an error:

WARN: tilt autoloading 'coffee_script' in a non thread-safe way; explicit require 'coffee_script' suggested.

and the site doesn't compile anymore.
Is there a way to require coffeescript. I tried by adding

require "coffee_script" in ext.rb but it doesn't work

How to add Compass configuration file config.rb?

To add a Compass config file config.rb I have added following line to _plugins/ext.rb

Compass.add_project_configuration('config.rb')

All the changes of the configuration settings seems to be set to Compass, because after that line I can print a new added configuration such as

puts "Compass.configuration.disable_warnings: #{Compass.configuration.disable_warnings}"

However, none of the settings defined in config.rb are used by jekyll-assets (or maybe by Sprockets?) It seems that there are overridden. Any idea?

Thanks!

Jekyll generates static site while SASS is compiling

I enabled sass for my stylesheets in _config.yml, and I started my server with --auto option, but every time I change a .css.scss file, I need to save it twice in order to see my css updated on the static copy even if webrick detected a change. Not a real problem but it's really an annoying behaviour.

Don't know if this issue could be related to this plugin, but there's a way to overcome the problem and avoid to save the sass file one more time?

Thank you

"Other Files" Not Processed

I have configured the gem to process the static assets on my Octopress blog, and everything is working great with stylesheets, javascripts, and images.

However, I have other static content that is consistently ignored no matter what I try.

Here is my configuration:

assets:
dirname: website/assets/
sources:
- _assets/images
- _assets/fancybox
- _assets/javascripts
- _assets/jwplayer
- _assets/stylesheets
- _assets/fonts
compress:
js: 'uglifier'
css: 'sass'
cachebust: hard
gzip: [ text/css, application/javascript ]

Nothing in fancybox, jwplayer, or fonts is moved to the website/assets folder.

How can I change my configuration so that everything is processed? Or is this a bug?

Thanks.

Jekyll server --auto

When I am using the "jekyll server --auto" command and I change any .scss file, I need to rebuild the all application to see It take effect

Add liquid tags for GZIP generated files

I love the auto generated gzip functionality for css and js files, but have issues linking to the gzipped version of the file. My site runs on Apache.

On Twitter @ixti suggested to use a filter...

{{ app.js | asset_path | append:".gz" }}

... but a tag like this would be more versatile imo.

{% stylesheet style .gz %}

Good somebody work this out?

Cheers

Problem when enabling SaSS line_comments

When configuring Sprockets::Sass to add line comments in the generated .css file, the asset_path function breaks.

Adding a plugin like this:

require "sprockets/sass"
Sprockets::Sass.options[:line_comments] = true

works fine and comments like:

/* line 250, /_assets/stylesheets/foundation/components/_orbit.scss */

is added in the generated CSS file which makes it much easier to track when developing.

However no

asset_path( *path* ) 

is translated so the page is completely without assets. I reckon this might be a quite easy fix or perhaps adding an

assets:
  line_comments: true

would be even better!

(If I knew how to do it I would already given you a fork)

Ignore asset url query string or anchor when generating path

I encountered and error when trying to use Font Awesome, this is however a more general bug I believe relating to the asset_path method.

The following is the code I used, edited to take advantage of font-path(). This code fails because it is looking for a filename that includes the query string. Removing everything after the ? will not throw any errors.

@font-face {
  font-family: 'FontAwesome';
  src: url(font-path('fontawesome-webfont.eot?v=3.0.1'));
  src: url(font-path('fontawesome-webfont.eot?#iefix&v=3.0.1')) format("embedded-opentype"),
       url(font-path('fontawesome-webfont.woff?v=3.0.1')) format("woff"),
       url(font-path('fontawesome-webfont.ttf?v=3.0.1')) format("truetype");
  font-weight: normal;
  font-style: normal;
}

This is not a problem only for this plugin, I found this issue in the Rails repo that proposes a simple solution.


If there is a work around other than this update that I'm missing please let me know!

Duplication of generated code by using Compass extension breakpoint (or respond-to)

Generated code by using the Compass extension breakpoint is duplicated.

Sass code (based on this breakpoint example):

$breakpoint-medium-width: 500px
$breakpoint-medium-not-wide: 500px 700px
$breakpoint-medium-height: 300px 700px 'height'

.foo
  @include breakpoint($breakpoint-medium-width)
    content: 'medium widths'

.baz
  @include breakpoint($breakpoint-medium-not-wide)
    content: 'medium, but not too wide'

.tgif
  @include breakpoint($breakpoint-medium-height)
    content: 'medium heights'

Generated code (note the duplicated @media parameters):

@media (min-width: 500px), (min-width: 500px) {
  .foo {
    content: "medium widths"; } }

@media (min-width: 500px) and (min-width: 700px), (min-width: 500px) and (min-width: 700px) {
  .baz {
    content: "medium, but not too wide"; } }

@media (min-width: 300px) and (min-width: 700px) and (height), (min-width: 300px) and (min-  width: 700px) and (height) {
  .tgif {
    content: "medium heights"; } }

The source of the plugin is pointed in my _plugins/ext.rb:

breakpoint_dir = Gem::Specification.find_by_name("breakpoint").gem_dir
Sprockets.append_path File.join(breakpoint_dir, "stylesheets")

My current setup:

jekyll-assets (0.3.0)
Jekyll 0.12.0
Sass 3.2.5 (Media Mark)
breakpoint (1.3)

The same issue occurs if I use the Compass extension respond-to, which is build on breakpoint

I'm not sure if this an issue of 'jekyll-assets' or 'breakpoint' ('respond-to'). At the breakpoint page you will find a similar issue, which is closed because it is caused by ScoutApp.

Maybe an issue caused by Sprockets...? Any idea?

Thanks!

-Jens

Liquid Exception: undefined method `singleton_class' for #<Sprockets::Index:...>

I tried to use this plugin with the folder structure you published here: https://github.com/ixti/jekyll-assets-demo

but when I regenerate static files I've got this error

Configuration from /Users/fcalderan/www/root/jky/_config.yml
Building site: /Users/fcalderan/www/root/jky -> /Users/fcalderan/www/root/jky/_site
Liquid Exception: undefined method `singleton_class' for #<Sprockets::Index:0x10230ff68> in default
/Library/Ruby/Gems/1.8/gems/jekyll-assets-0.3.4/lib/jekyll/assets_plugin/environment.rb:55:in `index'
/Library/Ruby/Gems/1.8/gems/jekyll-assets-0.3.4/lib/jekyll/assets_plugin/environment.rb:55:in `tap'
...

default.html is the name of my layout file and base.css the css file. The problem disappear when I remove

{% stylesheet base %}

from layout file (but of course no style is included).

I've currently installed

  • jekyll-assets-0.3.4
  • sprockets-2.8.2
  • jekyll-0.12.1

I've used the same Gemfile of the demo, but I have no idea what could be the problem. Have you any clue about it?

Thank you

scss @import's not including

If I have an _assets/stylesheets/ folder, and I have 2 files:

red.scss

@import "blue.css";
body { background: red }

blue.scss

body { color: blue }

And I add the red stylesheet to the head in a jekyll liquid template:

<html>
  <head>
    {% stylesheet red %}
  </head>
  <body>This is a test</body>
<html>

The red.scss file is included fine, but it still has the @import statement in it, and it neither compiles blue.scss, nor includes it inline. This is breaking everything from bootstrap to some custom existing stuff.. What am I missing, or is something broken?

I'm including these gems via bundler...
Gems included by the bundle:

  • bundler (1.3.5)
  • capistrano (2.15.5)
  • chunky_png (1.2.8)
  • classifier (1.3.3)
  • colorator (0.1)
  • commander (4.1.4)
  • compass (0.12.2)
  • directory_watcher (1.4.1)
  • execjs (1.4.0)
  • fast-stemmer (1.0.2)
  • fssm (0.2.10)
  • highline (1.6.19)
  • hike (1.2.3)
  • jekyll (1.0.3)
  • jekyll-assets (0.6.1)
  • kramdown (1.0.2)
  • libv8 (3.11.8.17)
  • liquid (2.3.0)
  • maruku (0.6.1)
  • multi_json (1.7.8)
  • net-scp (1.1.2)
  • net-sftp (2.1.2)
  • net-ssh (2.6.8)
  • net-ssh-gateway (1.2.0)
  • posix-spawn (0.3.6)
  • pygments.rb (0.5.2)
  • rack (1.5.2)
  • redcarpet (2.2.2)
  • ref (1.0.5)
  • safe_yaml (0.7.1)
  • sass (3.2.10)
  • sprockets (2.10.0)
  • sprockets-sass (1.0.1)
  • syntax (1.0.0)
  • therubyracer (0.11.4)
  • tilt (1.4.1)
  • uglifier (2.1.2)
  • yajl-ruby (1.1.0)

Add option for async JavaScript

It would be great if you could define a JavaScript to be loaded asynchronously...

<script async type="text/javascript" src="/assets/app-e11efcdf30942a4f025d8093f5729ab3.js"></script>

Tags and filters in assets seem not to be parsed by liquid

I one of my assets (main.css) I use jekyll-asset tags to link to other assets (in this case font files). Neither the tag nor its filter counterpart are parsed by liquid.

The section of css in question is:

@font-face {
    font-family: 'Lacuna';
    src: url('{% asset_path font/lacuna-webfont.eot %}');
    src: url('{% asset_path font/lacuna-webfont.eot %}?#iefix') format('embedded-opentype'),
         url('{% asset_path font/lacuna-webfont.woff %}') format('woff'),
         url('{% asset_path font/lacuna-webfont.ttf %}') format('truetype'),
         url('{% asset_path font/lacuna-webfont.svg %}#LacunaRegular') format('svg');
    font-weight: normal;
    font-style: normal;
}

which after a build looks like this:

@font-face {
     font-family:'Lacuna';
     src:url("{% asset_path font/lacuna-webfont.eot %}");
     src:url("{% asset_path font/lacuna-webfont.eot %}?#iefix") format("embedded-opentype"),
          url("{% asset_path font/lacuna-webfont.woff %}") format("woff"),
          url("{% asset_path font/lacuna-webfont.ttf %}") format("truetype"),
          url("{% asset_path font/lacuna-webfont.svg %}#LacunaRegular") format("svg");
   font-weight:normal;
   font-style:normal;
}

Furthermore, if I switch to using the filter instead, jekyll errors out and never completes the build.

This

@font-face {
    font-family: 'Lacuna';
    src: url('{{ 'font/lacuna-webfont.eot' | asset_path }}');
    src: url('{% asset_path font/lacuna-webfont.eot %}?#iefix') format('embedded-opentype'),
         url('{% asset_path font/lacuna-webfont.woff %}') format('woff'),
         url('{% asset_path font/lacuna-webfont.ttf %}') format('truetype'),
         url('{% asset_path font/lacuna-webfont.svg %}#LacunaRegular') format('svg');
    font-weight: normal;
    font-style: normal;
}

causes this:

 $ jekyll build
Configuration file: /cygdrive/c/Users/Hans/git/hans.viessmann.co/_config.yml
            Source: .
       Destination: ./_site
      Generating...   Liquid Exception: Invalid CSS after ".../lacuna-webfont": expected ")", was ".eot' | asset_p..." (in /cygdrive/c/Users/Hans/git/hans.viessmann.co/_assets/stylesheets/main.css) in default
(sass):8
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:1148:in `expected'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/lexer.rb:199:in `expected!'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:476:in `assert_tok'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:332:in `funcall'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:319:in `ident'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:228:in `unary_not'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:228:in `unary_div'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:228:in `unary_minus'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:228:in `unary_plus'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:209:in `times_div_or_mod'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:209:in `plus_or_minus'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:209:in `relational'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:209:in `eq_or_neq'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:209:in `and_expr'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:209:in `or_expr'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:298:in `space'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:283:in `interpolation'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:246:in `expr'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:470:in `assert_expr'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/script/parser.rb:49:in `parse'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:1022:in `sass_script'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:882:in `value!'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:859:in `declaration'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:582:in `block in declaration_or_ruleset'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:1122:in `call'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:1122:in `rethrow'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:592:in `declaration_or_ruleset'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:554:in `block_child'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:546:in `block_contents'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:166:in `directive_body'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:158:in `directive'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:553:in `block_child'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:543:in `block_contents'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:82:in `stylesheet'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/scss/parser.rb:27:in `parse'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/engine.rb:342:in `_to_tree'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/engine.rb:315:in `_render'
/usr/lib/ruby/gems/1.9.1/gems/sass-3.2.9/lib/sass/engine.rb:262:in `render'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/sass_compressor.rb:19:in `evaluate'
/usr/lib/ruby/gems/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/context.rb:197:in `block in evaluate'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/context.rb:194:in `each'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/context.rb:194:in `evaluate'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/bundled_asset.rb:25:in `initialize'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/base.rb:377:in `new'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/base.rb:377:in `build_asset'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/index.rb:94:in `block in build_asset'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/caching.rb:51:in `cache_asset'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/index.rb:93:in `build_asset'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/base.rb:287:in `find_asset'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/index.rb:61:in `find_asset'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-assets-0.5.1/lib/jekyll/assets_plugin/patches/index_patch.rb:19:in `find_asset_with_jekyll'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/environment.rb:75:in `find_asset'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-assets-0.5.1/lib/jekyll/assets_plugin/environment.rb:38:in `find_asset'
/usr/lib/ruby/gems/1.9.1/gems/sprockets-2.9.3/lib/sprockets/base.rb:295:in `[]'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-assets-0.5.1/lib/jekyll/assets_plugin/patches/site_patch.rb:43:in `asset_path'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-assets-0.5.1/lib/jekyll/assets_plugin/renderer.rb:21:in `render_asset_path'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-assets-0.5.1/lib/jekyll/assets_plugin/renderer.rb:35:in `render_stylesheet'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-assets-0.5.1/lib/jekyll/assets_plugin/tag.rb:14:in `render'
/usr/lib/ruby/gems/1.9.1/gems/liquid-2.5.0/lib/liquid/block.rb:106:in `block in render_all'
/usr/lib/ruby/gems/1.9.1/gems/liquid-2.5.0/lib/liquid/block.rb:93:in `each'
/usr/lib/ruby/gems/1.9.1/gems/liquid-2.5.0/lib/liquid/block.rb:93:in `render_all'
/usr/lib/ruby/gems/1.9.1/gems/liquid-2.5.0/lib/liquid/block.rb:82:in `render'
/usr/lib/ruby/gems/1.9.1/gems/liquid-2.5.0/lib/liquid/template.rb:124:in `render'
/usr/lib/ruby/gems/1.9.1/gems/liquid-2.5.0/lib/liquid/template.rb:132:in `render!'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-1.0.2/lib/jekyll/convertible.rb:77:in `render_liquid'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-1.0.2/lib/jekyll/convertible.rb:101:in `render_all_layouts'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-1.0.2/lib/jekyll/convertible.rb:136:in `do_layout'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-1.0.2/lib/jekyll/post.rb:285:in `render'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-1.0.2/lib/jekyll/site.rb:230:in `block in render'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-1.0.2/lib/jekyll/site.rb:229:in `each'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-1.0.2/lib/jekyll/site.rb:229:in `render'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-1.0.2/lib/jekyll/site.rb:44:in `process'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-1.0.2/lib/jekyll/command.rb:18:in `process_site'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-1.0.2/lib/jekyll/commands/build.rb:23:in `build'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-1.0.2/lib/jekyll/commands/build.rb:7:in `process'
/usr/lib/ruby/gems/1.9.1/gems/jekyll-1.0.2/bin/jekyll:59:in `block (2 levels) in <top (required)>'
/usr/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
/usr/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
/usr/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
/usr/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/runner.rb:402:in `run_active_command'
/usr/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/runner.rb:66:in `run!'
/usr/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/delegates.rb:11:in `run!'
/usr/lib/ruby/gems/1.9.1/gems/commander-4.1.3/lib/commander/import.rb:10:in `block in <top (required)>'
Build Failed

My Gemfile.lock:

 $ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    classifier (1.3.3)
      fast-stemmer (>= 1.0.0)
    colorator (0.1)
    commander (4.1.3)
      highline (~> 1.6.11)
    directory_watcher (1.4.1)
    execjs (1.4.0)
      multi_json (~> 1.0)
    fast-stemmer (1.0.2)
    highline (1.6.18)
    hike (1.2.2)
    jekyll (1.0.2)
      classifier (~> 1.3)
      colorator (~> 0.1)
      commander (~> 4.1.3)
      directory_watcher (~> 1.4.1)
      kramdown (~> 1.0.2)
      liquid (~> 2.3)
      maruku (~> 0.5)
      pygments.rb (~> 0.5.0)
      safe_yaml (~> 0.7.0)
    jekyll-assets (0.5.1)
      jekyll (~> 1.0)
      sprockets (~> 2.9)
    kramdown (1.0.2)
    liquid (2.5.0)
    maruku (0.6.1)
      syntax (>= 1.0.0)
    multi_json (1.7.3)
    posix-spawn (0.3.6)
    pygments.rb (0.5.0)
      posix-spawn (~> 0.3.6)
      yajl-ruby (~> 1.1.0)
    rack (1.5.2)
    rdiscount (2.0.7.3)
    safe_yaml (0.7.1)
    sass (3.2.9)
    sprockets (2.9.3)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    syntax (1.0.0)
    tilt (1.4.1)
    uglifier (2.1.0)
      execjs (>= 0.3.0)
      multi_json (~> 1.0, >= 1.0.2)
    yajl-ruby (1.1.0)

PLATFORMS
  ruby

DEPENDENCIES
  jekyll
  jekyll-assets
  rdiscount
  sass
  uglifier

Serving up 2x assets

I'm almost certain that this is more a question for the Sprocket folks, but I'm also inexperienced enough with Ruby to feel the need to ask at the highest point in my stack.

We're currently using retinajs for serving up double-sized assets to high-resolution screens, however migrating to jekyll-assets and using asset_path has left us with no copied @2x images in the resulting compiled site, since of course jekyll-assets thinks they're not being used anywhere.

Is there any immediate quick-and-easy way to extend jekyll-assets+Sprocket to look for and copy these unreferenced files? I see that jekyll-assets is eminently patchable, I just don't know Ruby enough to know what to do with that information.

Can't get .scss.erb partials to @import

Jekyll throws the following error when trying to include a partial that's named .scss.erb.

Generating...   Liquid Exception: File to import not found or unreadable: sections/contact-form. Load paths: (... and here's all the assets paths...)

I can rename the main app.scss with an erb extension and it processes Ruby code just fine, but I can't figure out how to @import the partial. I also tried renaming the main SCSS file with a .erb extension to see if that would effect parsing but it's still throwing the same error. It can't find the partial in the paths if you give it a .erb extension.

I'm doing a workaround now by using the asset_path() helper but I see this being a problem in the future.

asset_path in Octopress scss file not working

In an Octopress installation, the stylesheets are stored outside of the source folder in a folder called sass. When rake generate is called, it triggers a compass compile directive:

compass compile --css-dir #{source_dir}/_assets/stylesheets

In these stylesheets I use tags like

background-image: url('{% asset_path foo.jpg %}');

I have setup jekyll-assets to scan the _assets/stylesheets folder where is correctly finds and loads the compass-generated stylesheet. However, the '{% asset_path foo.jpg %} never gets interpretted and is printed to the css file as such.

Reading through some of the previous closed issues on the site I was under the impression that this was possible. Have I setup something wrong?

Using sass > 3.2.9 with jekyll-assets

I tried to upgrade sass 3.2.9 to 3.3.0-alpha (to have sourcemap functionality enabled on Chrome) but when I compile I get this output

> jekyll build --config _config.yml,_config_dev.yml --trace                                    Configuration file: _config.yml
Configuration file: _config_dev.yml
            Source: ./src
       Destination: ./dev
      Generating... Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/common-ie8.css.scssc: can't dump anonymous class #<Class:0x0000010117ebf0>
Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/common.css.scssc: can't dump anonymous class #<Class:0x0000010117ebf0>
Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/_variables.scssc: can't dump anonymous class #<Class:0x0000010117ebf0>
Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/_layout.css.scss.erbc: can't dump anonymous class #<Class:0x0000010117ebf0>
Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/_mixins.scssc: can't dump anonymous class #<Class:0x0000010117ebf0>
Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/_normalize.cssc: can't dump anonymous class #<Class:0x0000010117ebf0>
Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/_print.cssc: can't dump anonymous class #<Class:0x0000010117ebf0>
Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/common.css.scssc: can't dump anonymous class #<Class:0x0000010117ebf0>
Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/_variables.scssc: can't dump anonymous class #<Class:0x0000010117ebf0>
Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/_layout.css.scss.erbc: can't dump anonymous class #<Class:0x0000010117ebf0>
Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/_mixins.scssc: can't dump anonymous class #<Class:0x0000010117ebf0>
Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/_normalize.cssc: can't dump anonymous class #<Class:0x0000010117ebf0>
Warning. Error encountered while saving cache ./.sass-cache/fd289667dafa89ff81e88d2d405f984e3d190263/_print.cssc: can't dump anonymous class #<Class:0x0000010117ebf0>
done.

I've already tried to delete and recreate .sass-cache folder with full permissions but no luck.

I've also a plugin jekyll-asset.rb in which I've disabled the cache

require "jekyll-assets"
require "yui/compressor"
require "sprockets/sass"
require "sprockets/sass/functions"


module Sprockets
  class SassCompressor
    def evaluate(context, locals, &block)

      ::Sass::Engine.new(data, {
        :syntax => :scss,
        :cache => true,  
        :line_numbers => true,
        :style => :expanded
      }).render

    end

  end
end

class Jekyll::AssetsPlugin::Renderer
  remove_const :STYLESHEET
  remove_const :JAVASCRIPT
  STYLESHEET = '<link rel="stylesheet" href="%s" />'
  JAVASCRIPT = '<script src="%s"></script>'
end

but still it doesn't work. The same problem If I use sass 3.2.11
What could it be the problem?

Thank you

jekyll-assets ignores the _config.yml

Hi,

first of all this also could be just an issue because I am not very familiar with Ruby, but when I build my site the settings for thr jekyll-assetsplugin get completely ignored.

The liquid tags work and files reference by the tags get copied to the build directory. But my settings (see below) are ignored:

permalink: /:categories/:title.html
exclude: [scss, Gemfile, Gemfile.lock]
include: [.htaccess]
safe: false
assets:
  cache: false
  sources:
    - _assets/inmg
    - _assets/js
    - _assets/css
    - _assets/fonts

I am very confused and have no clue what I am doing wrong, because the plugin works just all settings are getting ignored :(

EDIT: Also, {{ site.assets }} works and displays all settings.

BTW I am building the site on my Windows machine.

Dev/Production mode

I want to compile Sass with source-maps for development mode and with --output-style=compact for production. Any examples of how to do it with jekyll-assets?

It would be great to add s3 uploading

Similar to the asset-sync gem, I would be pretty sweet to have assets auto-uploaded to s3, then use the s3 domain name + file instead of the local file.

Get Environment in another plugin

I wonder if it's possible to to add custom paths to the Sprockets::Environment? I'm using handlebars_assets, and I want to be able to do this:

env.append_path HandlebarsAssets.path

Possible?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.