-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRules
49 lines (39 loc) · 897 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
#!/usr/bin/env ruby
compile '/blog' do
filter :erb
end
route '/blog' do
'/blog.xml'
end
compile '/blog/*' do
filter :kramdown
layout '/post.html'
end
compile '/blog/*' do
nil
end
route %r[/blog/([0-9]+)\-([0-9]+)\-([0-9]+)\-([^\/]+)\..*] do |y, m, d, slug|
"/blog/#{y}/#{m}/#{slug}/index.html"
end
compile '/index.html' do
layout '/default.*'
write '/index.html'
end
compile '/**/*.html' do
layout '/default.*'
filter :erb
write item.identifier.without_ext + '/index.html'
end
# This is an example rule that matches Markdown (.md) files, and filters them
# using the :kramdown filter. It is commented out by default, because kramdown
# is not bundled with Nanoc or Ruby.
#
compile '/**/*.md' do
filter :kramdown
layout '/default.*'
write item.identifier.without_ext + '/index.html'
end
compile '/**/*' do
write item.identifier.to_s
end
layout '/**/*', :erb