-
Notifications
You must be signed in to change notification settings - Fork 23
/
Rules
62 lines (52 loc) · 1.06 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
passthrough '/CNAME'
compile '/assets/*' do
case item[:extension]
when 'sass'
filter :sass
end
end
compile '*' do
if item.binary?
# don’t filter binary items
else
case item[:extension]
when 'md'
filter :kramdown
when 'html'
filter :erb
end
if item[:github]
filter :link_github_issues
filter :link_github_nicks
end
if item[:glossary]
filter :add_glossary
end
filter :mustache
filter :colorize_syntax, :default_colorizer => :pygmentsrb
layout item[:layout] || 'default'
if item[:has_toc]
filter :add_toc
end
end
end
route '/assets/*' do
out_ext = case item[:extension]
when 'sass'
'css'
else
item[:extension]
end
item.identifier.chop + '.' + out_ext
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 '*', :erb