-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rules
137 lines (107 loc) · 2.92 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/usr/bin/env ruby
# Preprocess {{{1
preprocess do
#create_tag_pages
create_authors_htags
create_archive_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 '/members/*/*/index.*' do
filter :asciidoctor, linkcss: true
filter :colorize_syntax, :default_colorizer => :pygmentsrb
layout '/member.*'
filter :relativize_paths, type: :html
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 '/archives/*/*.html' do
layout '/archive-by-year.html'
filter :relativize_paths, type: :html
end
compile '/archives/*/*/*.html' do
layout '/archive-by-year-month.html'
filter :relativize_paths, type: :html
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
# /articles/**/yyyy-mm-dd-slug/**/index.{html,adoc} => /yyyy/mm/dd/slug/**/index.html
# /articles/**/yyyy-mm-dd-slug/**/*.{html,adoc} => /yyyy/mm/dd/slug/**/*/index.html
route %r[^/articles/(?:.+?/)?(\d{4})-(\d{2})-(\d{2})-(.+?)(?:/index)?\.(?:html|adoc)$] do |yyyy, mm, dd, slug_relpath|
"/#{yyyy}/#{mm}/#{dd}/#{slug_relpath}/index.html"
end
# /articles/**/yyyy-mm-dd-slug/* => /yyyy/mm/dd/slug/*
route %r[^/articles/(?:.+?/)?(\d{4})-(\d{2})-(\d{2})-(.+)$] do |yyyy, mm, dd, slug_relpath|
"/#{yyyy}/#{mm}/#{dd}/#{slug_relpath}"
end
route '/assets/**/*.scss' do
@item.identifier.without_ext + '.css'
end
route '/assets/**/*' do
@item.identifier.to_s
end
route %r[/archives(/.*)] do |relpath|
relpath[0]
end
# /members/yyyy/*/index.adoc => /members/yyyy/*/index.html
route %r[^/members/(\d{4})/([^/]+)/index\.adoc$] do |year, name|
"/members/#{year}/#{name}/index.html"
end
route '/**/*.{html,json}.erb' do
@item.identifier.without_ext
end
route '/**/*' do
@item.identifier.to_s
end
layout '/**/*', :erb
# vim: set foldmethod=marker :