/
Rules
90 lines (74 loc) · 1.83 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env ruby
# compile '/**/*.html' do
# layout '/default.*'
# 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.*'
# #end
# route '/**/*.{html,md,rb}' do
# if item.identifier =~ '/index.*'
# '/index.html'
# else
# item.identifier.without_ext + '/index.html'
# end
# end
# compile '/**/*' do
# write item.identifier.to_s
# end
layout '/**/*', :erb
# Below is added by Shekhar. on 7 July 2017
# default rep, although you can pass
# :rep => :default explicitly too
compile '/nyaplot/*.{html}' do
filter :erb
layout '/nyaplot_layout.*'
end
route '/nyaplot/*.{html}' do
# Just an example; you probably need something else
'/' + item.identifier
end
compile '/highcharts/*.{html}' do
filter :erb
layout '/highcharts_layout.*'
end
route '/highcharts/*.{html}' do
# Just an example; you probably need something else
'/' + item.identifier
end
compile '/googlecharts/*.{html}' do
filter :erb
layout '/googlecharts_layout.*'
end
route '/googlecharts/*.{html}' do
# Just an example; you probably need something else
'/' + item.identifier
end
# to compile outer index.html
compile '/index.html' do
layout '/default.*'
end
route '/*.{html}' do
if item.identifier =~ '/index.*'
'/index.html'
else
item.identifier.without_ext + '/index.html'
end
end
# stylesheet.css compile
compile '/**/*' do
write item.identifier.to_s
end
# compile '/stuff/*/', :rep => :special do
# filter :erb
# layout 'special' # this is different
# end
# route '/stuff/*/', :rep => :special do
# # /stuff/foo/ -> /special/stuff/foo/
# # Again, just an example
# '/special' + item.identifier
# end