-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.rb
More file actions
67 lines (55 loc) · 1.74 KB
/
config.rb
File metadata and controls
67 lines (55 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# ************************************
# HTTP Path
# ************************************
http_path = "/"
# ************************************
# CSS Directory
# ************************************
css_dir = "css/"
# ************************************
# Sass Directory
# ************************************
sass_dir = "scss/"
# ************************************
# Image Directory
# ************************************
images_dir = "images/"
# ************************************
# JavaScript Directory
# ************************************
javascripts_dir = "js/"
# ************************************
# Other
# ************************************
# .sass-cacheを出力するかどうか
cache = false
# クエストにクエリ文字列付けてキャッシュ防ぐ
asset_cache_buster :none
# Sassファイルをブラウザで確認
sass_options = { :debug_info => false }
# cssの主力形式
output_style = :expanded
# trueで相対パス、falseで絶対パス
relative_assets = true
# CSSファイルにSassファイルの何行目に記述されたものかを出力する
line_comments = false
# ************************************
# Sprites
# ************************************
# Make a copy of sprites with a name that has no uniqueness of the hash.
on_sprite_saved do |filename|
if File.exists?(filename)
FileUtils.cp filename, filename.gsub(%r{-s[a-z0-9]{10}\.png$}, '.png')
FileUtils.rm_rf(filename)
end
end
# Replace in stylesheets generated references to sprites
# by their counterparts without the hash uniqueness.
on_stylesheet_saved do |filename|
if File.exists?(filename)
css = File.read filename
File.open(filename, 'w+') do |f|
f << css.gsub(%r{-s[a-z0-9]{10}\.png}, '.png')
end
end
end