Code Monkey home page Code Monkey logo

jekyll-assets's Introduction

Build Status Maintainability

Jekyll Assets

Jekyll Assets is a drop in asset pipeline that uses Sprockets to build specifically for Jekyll. It utilizes Sprockets, and Jekyll to try and achieve a clean, and extensible assets platform that supports plugins, caching, converting your assets. It even supports proxying of said assets in a way that does not interfere with either Sprockets, or Jekyll, or your own source. By default you can add Jekyll Assets to your Gemfile, as a plugin, and have it act as a drop-in replacement for Jekyll's basic SASS processors, with you only having to add it to your Gemfile, and updating your <img>, and <link>.

Installing

gem "jekyll-assets", group: :jekyll_plugins
gem "jekyll-assets", git: "https://github.com/envygeeks/jekyll-assets", group: :jekyll_plugins
gem "jekyll-assets", "~> x.x.alpha", group: :jekyll_plugins

System Requirements

  • ruby: 2.6+
  • sprockets: 4.0+
  • uglifier: 4.0
  • jekyll: 3.5+

Configuration

The configuration file is the same as Jekyll's, which is _config.yml. Except we use the special key called assets inside of that file. All values listed below are default, you need not copy these into your configuration file unless you plan to change a value. Setting a value makes it explicit, and shared across both production, and development.

# _config.yml
assets:
  source_maps: true
  destination: "/assets"
  compression: false
  gzip: false
  defaults:
    integrity:
      {css,img,js}: false
  caching:
    enabled: true
    path: ".jekyll-cache/assets"
    type: file
  # --
  # Assets you wish to always have compiled.
  #   This can also be combined with raw_precompile which
  #   copies assets without running through the pipeline
  #   making them ultra fast.
  # --
  precompile: []
  raw_precompile: [
    #
  ]
  # --
  # baseurl: whether or not to append site.baseurl
  # destination: the folder you store them in on the CDN.
  # url: the CDN url (fqdn, or w/ identifier).
  # --
  cdn:
    baseurl: false
    destination: false
    url: null
  # --
  # See lib/jekyll/assets/config.rb
  #   for a list of defaults
  # --
  sources:
    - _assets/custom
  plugins:
    css: { autoprefixer: {}}
    img: { optim: {}}

Tag {% asset %}, <img>

{% asset src @magick:double alt='This is my alt' %}
{% asset src @magick:double alt='This is my alt' %}
<img src="src" asset="@magick:double" alt="This is my alt">
<img src="src" alt="This is my alt" asset>

Defaults

We provide several defaults that get set when you run an asset, depending on content type, this could be anything from type, all the way to integrity. If there is a default attribute you do not wish to be included, you can disable the attribute with !attribute, and it will be skipped over.

{% asset img.png !integrity %}
{% asset bundle.css !type   %}

Arguments

Our tags will take any number of arguments, arbitrary or not... and convert them to HTML, and even attach them to your output if the HTML processor you use accepts that kind of data. This applies to anything but hashes, and arrays. So adding say, a class, or id, is as easy as doing id="val" inside of your tag arguments.

Built In

Arg Description Type Return Type
@data data URI */* text
@inline CSS <style> text/css text/html
@path Path */* text

Responsive Images

<img> usage

Configuration

Option Tag Option Type Description
automatic @automatic Boolean Upscale & Downscale images
automatic_min_width @min_width Integer Stop scaling before this width
automatic_scales scales String The scales to use
discovery_scales scales String The scales to look for
automatic_upscale @upscale Boolean Upscale, the source instead of downscale
discovery @discovery Boolean Responsive if an img matching source w/ @x exists

Each option is in the responsive namespace regardless of whether it's inside of the tag, or configuration.

Example

{% asset img.png @pic
    srcset:max-width="200"
    srcset:min-width="200"
    srcset:scales=1x
    srcset:scales=2x
    srcset:scales=3x
        %}
<img srcset="
    img-<hash>.png 3x,
    img-<hash>.png 2x,
    img-<hash>.png 1x"
        >

Discovery

When using discovery based responsive images, we will only do responsive images if we can find assets that match your scales based on the source file. For example if you do {% asset img.png responsive:discovery responsive:scales=1x responsive:scales=1.5x responsive:scales=2x %} then we will expect [email protected] and img.png@2x to exist. For any image that doesn't exist it will be skipped, and that scale will not be included!

Automatic

Automatic responsive images/scaling can either upscale, or downscale. This is useful if you have a ton of images for blog posts, and you always want to provide a single most high quality version and then have us downscale those, or if you have an image and wish us to upscale it! The argv1 of {% asset img.png %} is where the source is derived from. Given you give 2x, 1.5x and 1x if you choose to downscale, the source will be assumed to be 2x, and we will downscale to 1.5x and half. If you chose to upscale, the source will be assumed to be 1x, and we will multiply the width by 1.5 and 2

Liquid

We support liquid arguments for tag values (but not tag keys), and we also support Liquid pre-processing (with your Jekyll context) of most files if they end with .liquid. This will also give you access to our filters as well as their filters, and Jekyll's filters, and any tags that are globally available.

{% asset '{{ site.bg_img }}' %}
{% asset '{{ site.bg_img }}' proxy:key='{{ value }}' %}
{% asset {{\ site.bg_img\ }} %}

.sass, .scss

body {
  background-image: asset_url("'{{ site.bg_img }}'");
  background-image: asset_url("'{{ site.bg_img }}' proxy:key='{{ value }}'");
  background-image: asset_url("{{\ site.bg_img\ }}");
}

.liquid.ext

.ext.liquid

Supported file types:

  • .css
  • .sass
  • .scss
  • .js
  • .es6
  • .coffee
  • .svg

You have full access to your entire global context from any liquid processing we do. Depending on where you do it, you might or might not also have access to your local (page) context as well. You can also do whatever you like, and be as dynamic as you like, including full loops, and conditional Liquid, since we pre-process your text files. On Sprockets 4.x you can use .liquid.ext and .ext.liquid, but because of the way Sprockets 3.x works, we have opted to only allow the default extension of .ext.liquid when running on "Old Sprockets" (AKA 3.x.) If you would like Syntax + Liquid you should opt to install Sprockets 4.x so you can get the more advanced features.

Importing

**In order to import your Liquid pre-processed assets inside of Liquid or JS you should use a Sprockets //require=, Sprockets does not integrate that deeply into JavaScript and SASS to allow you to @import and pre-process.

.sass, .scss Helpers

We provide two base helpers, asset_path to return the path of an asset, and asset_url which will wrap asset_path into a url() for you, making it easy for you to extract your assets and their paths inside of SCSS. All other helpers that Sprockets themselves provide will use our asset_path helper, so you can use them like normal, including with Liquid

body {
  background-image: asset_url("img.png");
}

Proxies, and Other Arguments

Any argument that is supported by our regular tags, is also supported by our .sass/.scss helpers, with a few obvious exceptions (like srcset). This means that you can wrap your assets into magick if you wish, or imageoptim or any other proxy that is able to spit out a path for you to use. The general rule is, that if it returns a path, or @data then it's safe to use within .scss/.sass, otherwise it will probably throw.

body {
  background-image: asset_url("img.png @magick:half")
}

*Note: we do not validate your arguments, so if you send a conflicting *argument that results in invalid CSS, you are responsible for that, in *that if you ship us srcset we might or might not throw, depending on how *the threads are ran. So it might ship HTML if you do it wrong, and it will *break your CSS, this is by design so that if possible, in the future, we can allow more flexibility, or so that plugins can change based on arguments.

Listing Assets in Liquid

We provide all your assets as a hash of Liquid Drops so you can get basic info that we wish you to have access to without having to prepare the class. Note: The keys in the assets array are the names of the original files, e.g., use *.scss instead of *.css.

{{ assets["bundle.css"].content_type }} => "text/css"
{{ assets["images.jpg"].width  }} => 62
{{ assets["images.jpg"].height }} => 62

The current list of available accessors:

Method Description
content_type The RFC content type
filename The full path to the asset
height The asset height
width The asset width
digest_path The prefixed path
integrity The SRI hash

Looping

{% for k,v in assets %}
  {{ k }}
{% endfor %}

Dynamic

Using Liquid Drop assets, you can check whether an asset is present.

{% if assets[page.image] %}{% img '{{ page.image }}' %}
{% else %}
  {% img default.jpg %}
{% endif %}

Filter

{{ src | asset:"@magick:double magick:quality=92" }}

Hooks

Point Name Instance Args
:env :before_init
:env :after_init
:env :after_write
:config :before_merge Config{}
:asset :before_compile Asset, Manifest
:asset :after_compression input{}, output{}, type=/

Example

Jekyll::Assets::Hook.register :env, :before_init do
  append_path "myPluginsCustomPath"
end
Jekyll::Assets::Hook.register :config, :init do |c|
  c.deep_merge!({
    plugins: {
      my_plugin: {
        opt: true
      }
    }
  })
end

Plugin Hooks

Your plugin can also register it's own hooks on our Hook system, so that you can trigger hooks around your stuff as well, this is useful for extensive plugins that want more power.

Jekyll::Assets::Hook.add_point(
  :plugin, :hook
)
Jekyll::Assets::Hook.trigger(:plugin, :hook)  { |v| v.call(:arg) }
Jekyll::Assets::Hook.trigger(:plugin, :hook) do |v|
  instance_eval(&v)
end

Default Plugins

Google Closure Alternates

gem "crass"

Once crass is added, we will detect vendor prefixes, and add /* @alternate */ to them, with or without compression enabled, and with protections against compression stripping.

Font Awesome

gem "font-awesome-sass"
@import "font-awesome-sprockets";
@import "font-awesome";
html {
  // ...
}

CSS Auto-Prefixing

gem "autoprefixer-rails"
assets:
  autoprefixer:
    browsers:
    - "last 2 versions"
    - "IE > 9"

Bootstrap

gem "bootstrap-sass" # 3.x
gem "bootstrap"      # 4.x
@import 'bootstrap';
html {
  // ...
}
//=require _bootstrap.css
//=require bootstrap/_reboot.css

ImageMagick

gem "mini_magick"

Args

See the MiniMagick docs to get an idea what <value> can be.

Name Accepts Value
magick:compress
magick:resize
magick:format*
magick:quality
magick:rotate
magick:gravity
magick:crop
magick:extent
magick:flip
magick:background
magick:transparency
@magick:double
@magick:half

* magick:format requires an ext or a valid MIME content type like image/jpeg or .jpg. We will ImageMagick -format on your behalf with that information by getting the extension.

ImageOptim

gem "image_optim"
gem "image_optim_pack" # Optional

Configuration

assets:
  plugins:
    img:
      optim:
        {}

Check the ImageOptim to get idea about configuration options, and to get a list of stuff you need to install on your system to use it, if you do not wish to use "image_optim_pack".

To disable ImageOptim (i.e. for development builds), use following configuration:

assets:
  plugins:
    img:
      optim: false

Args

Name Accepts Value
optim
@optim

By default @optim will use the default jekyll, otherwise you can provide optim=preset and have it used that preset. ImageOptim provides advanced, and default as their default presets, you can define your own preset via Jekyll Assets configuration listed above.

LibVIPS

gem "ruby-vips"

The "ruby-vips" gem requires a functional install of (libvips)[https://github.com/libvips/libvips/].

Args

Name Accepts Value
vips:crop
vips:resize
vips:format
vips:quality
vips:compression
@vips:near_lossless
@vips:interlace
@vips:lossless
vips:strip
@vips:strip
@vips:double
@vips:half
vips:resize

Accepts an argument of either 'width', 'x' or 'x'. All resize processes keep the original aspect ratio so width and height are used to specify the bounding box for the resize process.

If no height is specified the image is resized to fit withing a bounding box of 'width' x 'width'. Similarly specifying just a height sets the bounding box for the resize to 'height' x 'height'. This form only exists for compatibility with the "magick" plugin.

{% asset img.png vips:resize='x100' %}
{% asset img.png vips:resize='100x50' %}
{% asset img.png vips:resize='100x' %}
vips:format

Convert the image to the specified format. Format support depends on the compile options of the libvips library. Format is specified as the file extension such as '.jpg', '.webp' or '.png'.

{% asset image.png vips:format='.webp' %}
vips:crop

Only has any effect when combined with "vips:resize". Use the following arguments (all except "fill" are documented here):

  • fill: resize the image to the specified size while maintaining the aspect ratio then fills the "empty" background with blurred version of the original image
  • entropy: use an entropy measure
  • high: position the crop towards the high coordinate
  • attention: look for features likely to draw human attention
  • low: position the crop towards the low coordinate
  • centre: crop from the centre
  • none: do nothing
{% asset image.jpg vips:resize='100' vips:crop='fill' %}
vips:strip

Removes metadata from images. This is set "true" by default, but can be disabled by passing "false".

{% asset image.jpg vips:strip=false %}

Building Your Own Plugins

Globals

Name Class
env Jekyll::Assets::Env
args Liquid::Tag::Parser{}
jekyll Jekyll::Site
asset Sprockets::Asset

HTML

Name Class Type
@doc Nokogiri:: XML::Document image/svg+xml
@doc Nokogiri::HTML::Document image/*

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

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!

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

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 %});
}

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

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.

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".

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?

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?

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?

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

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.

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.

Allow remote assets

Would this feature make sense?

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

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

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

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!

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

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

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.

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.

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

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.

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.

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
// ...

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.

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

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?

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.

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?

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)>'

"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.

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

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)

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?

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'.

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>

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)

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.