rstacruz / sinatra-assetpack

Package your assets transparently in Sinatra.
http://ricostacruz.com/sinatra-assetpack/
MIT License
541 stars 97 forks source link

Problem with compass generated sprites path #77

Closed marya-ivanovna closed 11 years ago

marya-ivanovna commented 11 years ago

I'm working with Padrino.

app.rb

  c = Compass.configuration
  c.project_path     = root
  c.images_dir       = "assets/images"
  c.http_images_path = "images"

  set :sass, Compass.sass_engine_options

  set :sass, { :load_paths => [
      "#{self.root}/assets/stylesheets",
      "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets",
      "#{Gem.loaded_specs['bootstrap-sass'].full_gem_path}/vendor/assets/stylesheets"
  ]}

  set :scss, sass

footes.css

footer.scss

 $icons:sprite-map('icons/*.png', $layout: smart);
.get-vk {background:sprite($icons, icon-vk) no-repeat; }

Frontend output: (sprite is invisible, because path is wrong)

#get-footer .container li a.get-vk {
    background: url("/assets/images/icons-s1683dc2b9a.png") no-repeat scroll 0 0 transparent;
}

If I modify by firebug path to "/images/icons-s1683dc2b9a.png" - sprite become visible.

marya-ivanovna commented 11 years ago

c.http_images_path = "images" needs to replace by http_generated_images_path = "images"