-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRules
More file actions
53 lines (44 loc) · 884 Bytes
/
Rules
File metadata and controls
53 lines (44 loc) · 884 Bytes
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
#!/usr/bin/env ruby
compile '/static/*' do
end
compile '*' do
if item.binary?
# don’t filter binary items
else
case item[:extension]
when 'slim'
filter :slim
layout 'default'
when 'scss'
filter :sass, syntax: :scss
when 'coffee'
filter :coffeescript
end
end
end
route '/static/*' do
# /static/foo.html/ → /foo.html
item.identifier[7..-2]
end
route '/scripts/*' do
item.identifier.chop + '.' + item[:extension]
end
route '/stylesheets/stylesheet' do
item.identifier.chop + '.css'
end
route '/stylesheets/*' do
nil
end
route '/pages/*' do
nil
end
route '*' do
if item.binary?
# Write item with identifier /foo/ to /foo.ext
item.identifier.chop + '.' + item[:extension]
else
# Write item with identifier /foo/ to /foo/index.html
item.identifier + 'index.html'
end
end
layout '*', :slim