-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rules
56 lines (44 loc) · 999 Bytes
/
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
#!/usr/bin/env ruby
compile '/**/*.{md,markdown}' do
filter :redcarpet, renderer: ::Redcarpet::Render::Language,
options: { fenced_code_blocks: true }
filter :colorize_syntax, :default_colorizer => :rouge
layout '/post.*'
end
compile '/**/*.{js,txt}' do
# don’t filter
end
compile '/**/*.haml' do
filter :haml
layout '/default.*'
end
compile '/**/*.xml' do
filter :erb
end
compile '/**/*.css' do
filter :rainpress
end
compile '/**/*' do
if ! item.binary?
filter :erb
layout '/default.*'
end
end
route '/_posts/*' do
y, m, d, slug = /([0-9]+)\-([0-9]+)\-([0-9]+)\-(.+)\./.match(item.identifier.to_s).captures
"/blog/#{y}/#{m}/#{d}/#{slug}/index.html"
end
route '/404.*' do
'/404.html'
end
route '/**/*.{html,md,haml}' do
if item.identifier =~ '**/index.*'
item.identifier.without_ext + '.html'
else
item.identifier.without_ext + '/index.html'
end
end
route '/**/*' do
item.identifier.to_s
end
layout '/**/*', :haml