-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rules
62 lines (48 loc) · 1.19 KB
/
Rules
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
#!/usr/bin/env ruby
require File.expand_path('../config/nanoc', __FILE__)
############ Compile ############
compile %r{/assets/(stylesheets|javascripts)/.+/} do
filter :sprockets, {
:css_compressor => Nanoc.production? ? :scss : nil,
:js_compressor => Nanoc.production? ? :uglifier : nil
}
snapshot :uncompressed
filter :gzip
end
compile %r{/assets/.+/} do
# don’t filter other assets items
end
compile '/google.+/' do
filter :erb
layout 'blank'
end
compile '*' do
if item.binary?
# don’t filter binary items
else
filter :erb
layout 'default'
end
end
############ Route ############
route %r{/assets/(stylesheets|javascripts)/.+/}, :snapshot => :uncompressed do
Nanoc::Helpers::Sprockets.asset_path(item)
end
route %r{/assets/(stylesheets|javascripts)/.+/} do
Nanoc::Helpers::Sprockets.asset_path(item) + '.gz'
end
route %r{/assets/.+/} do
Nanoc::Helpers::Sprockets.asset_path(item)
end
route '/htaccess/' do
'/.htaccess'
end
route '*' do
if item.children.size > 0 || item.identifier == '/'
item.identifier + 'index.html'
else
item.identifier.gsub(/\/$/, '') + '.' + item[:extension]
end
end
############ Layout ############
layout '*', :erb