-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRules
104 lines (80 loc) · 1.87 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/env ruby
# Preprocess {{{1
preprocess do
#create_tag_pages
create_htag_pages('/tags/', items: articles)
end
# }}}1
# sass partial.
ignore '/**/_*'
# vim tmp file.
ignore '/**/.*.swp'
compile '/articles/**/*.html' do
filter :colorize_syntax, :default_colorizer => :pygmentsrb
layout '/article.*'
filter :relativize_paths, type: :html
end
compile '/articles/**/*.adoc' do
filter :asciidoctor, linkcss: true
filter :colorize_syntax, :default_colorizer => :pygmentsrb
layout '/article.*'
filter :relativize_paths, type: :html
end
compile '/assets/**/*.scss' do
filter :sass, syntax: :scss
filter :relativize_paths, type: :css
end
compile '/tags/index.html.erb' do
filter :erb
layout '/page-base.*'
filter :relativize_paths, type: :html
end
compile '/tags/search.html' do
filter :colorize_syntax, :default_colorizer => :pygmentsrb
layout '/page-base.*'
filter :relativize_paths, type: :html
end
compile '/tags/**/*.html' do
layout '/htag-page.*'
filter :relativize_paths, type: :html
end
compile '/tags/**/*.json' do
layout '/htag-key.json'
end
compile '/feed.xml' do
filter :erb
end
compile '/**/*.html' do
layout '/page-base.html'
filter :relativize_paths, type: :html
end
compile '/**/*.html.erb' do
filter :erb
layout '/page-base.html'
filter :relativize_paths, type: :html
end
compile '/**/*.json.erb' do
filter :erb
end
compile '/**/*' do
write item.identifier.to_s
end
route %r[/articles(/.+?)(?:/index)?\.(?:html|adoc)$] do |path|
# Disallow creating `/index.html` (top page).
nil if path.empty?
path[0] + '/index.html'
end
route '/assets/**/*.scss' do
@item.identifier.without_ext + '.css'
end
route '/assets/**/*' do
@item.identifier.to_s
end
route '/**/*.{html,json}.erb' do
@item.identifier.without_ext
end
route '/**/*' do
@item.identifier.to_s
end
layout '/**/*', :erb
# vim: set foldmethod=marker :