2013-08-16 44 views
4

目錄路徑我已經設置config.rb文件,如下config.rb社科院字體添加斜線

http_path = "/" 
css_dir = "" 
sass_dir = "sass" 
images_dir = "images" 
fonts_dir = 'fonts' 
fonts_path = "" 
javascripts_dir = "js" 

這裏是我的目錄路徑

在項目的根

的style.css 字體/我的字體 sass/style.sass images/my-all-images

現在,當我嘗試添加字體u唱字體面是加入領先的字體目錄斜線狀/fonts但我想它只是fonts

SASS

+font-face("Ubuntu", font-files("ubuntu/ubuntu-r-webfont.eot", "ubuntu/ubuntu-r-webfont.eot?#iefix", "ubuntu/ubuntu-r-webfont.woff", "ubuntu/ubuntu-r-webfont.ttf", "ubuntu/ubuntu-r-webfont.svg#ubunturegular")) 

生成CSS

@font-face { 
    font-family: "Ubuntu"; 
    src: url('/fonts/ubuntu/ubuntu-r-webfont.eot') format('embedded-opentype'), url('/fonts/ubuntu/ubuntu-r-webfont.eot?#iefix') format('embedded-opentype'), url('/fonts/ubuntu/ubuntu-r-webfont.woff') format('woff'), url('/fonts/ubuntu/ubuntu-r-webfont.ttf') format('truetype'), url('/fonts/ubuntu/ubuntu-r-webfont.svg#ubunturegular') format('svg'); 
} 
+0

可能重複[如何使SASS把相對路徑在其輸出(http://stackoverflow.com/questions/12508630/how-to-make-sass-put-relative-paths-在-其輸出) – cimmanon

回答

10

您可以後正確的道路設置在設置relative_assets = true配置文件。

下面是一個樣例配置示例來處理相關資產。的

# Set this to the root of your project when deployed: 
http_path = "/" 
css_dir = "app/css" 
sass_dir = "app/css/sass" 
images_dir = "app/img" 
javascripts_dir = "app/js" 
fonts_dir = "app/css/fonts" 

output_style = :nested 
environment = :development 

relative_assets = true