A compass that slashes forward in front of images when creating sprites

I use Compass to create sprites. Sprites are created, but css output indicates the wrong location for the image catalog.

conclusion:

.menu-sprite, .menu-about, .menu-art, .menu-drum, .menu-links, 
.menu-music, .menu-science, .menu-writing {
    background: url('/images/menu-sb7e36b009c.png') no-repeat;
}

but I want it to be:

.menu-sprite, .menu-about, .menu-art, .menu-drum, .menu-links, 
.menu-music, .menu-science, .menu-writing {
    background: url('images/menu-sb7e36b009c.png') no-repeat;
}

here is my confib.rb setting:

http_path = "/"
css_dir = "."
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "js"

and here is how im calls sprites in my scss file:

@import "compass/utilities/sprites/base";
@import "menu/*.png";
@include all-menu-sprites;

what am I doing wrong? How to remove this first slash before images?

Thanks for any help.

+5
source share
1 answer

By default, the compass uses absolute paths for all assets.

To change this behavior, add this line to your config.rb:

relative_assets = true

Otherwise, you can also change the "http_path" parameter to indicate where your project sites are on your deployment server.

+6
source

All Articles