-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRules
36 lines (29 loc) · 751 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
#!/usr/bin/env ruby
compile '/**/*.md' do
filter :erb unless item.identifier =~ %r{/posts/}
filter :commonmarker
filter :colorize_syntax, default_colorizer: :rouge
filter :jjlog
filter :toc
layout '/default.*'
filter :relativize_paths, type: :html5
if item.identifier =~ '**/index.*'
target = item.identifier.without_ext + '.html'
else
target = item.identifier.without_ext + '/index.html'
end
if item[:draft]
target = target.gsub!(%r{\A/posts/}, '/drafts/')
else
target = target.gsub(%r{\A/posts/(.+)/index.html\z}, '/\1.html')
end
write target
end
compile '/*.xml.erb' do
filter :erb
write item.identifier.without_ext
end
compile '/**/*' do
write item.identifier.to_s
end
layout '/**/*', :erb