-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rules
68 lines (54 loc) · 1.33 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
#!/usr/bin/env ruby
REDCARPET_OPTIONS = {
no_infra_emphasis: true,
autolink: true,
}
preprocess do
questions = @items.find_all('/question/*.md')
authors = {}
questions.each do |q|
author_id = q[:owner_id]
authors[author_id] = { questions: [], id: author_id, name: q[:owner_display_name], karma: q[:owner_karma] } unless authors.include? author_id
authors[author_id][:questions] << q
end
authors.each_value do |author|
@items.create(
'',
author,
"/users/#{author[:id]}.md"
)
end
end
compile '/**/index.md' do
filter :redcarpet, options: REDCARPET_OPTIONS
layout '/index.*'
layout '/default.*'
write ext: 'html'
end
compile '/**/*.html' do
layout '/default.*'
filter :erubis
if item.identifier =~ '**/index.*'
write item.identifier.to_s
else
write item.identifier.without_ext + '/index.html'
end
end
compile '/question/*.md' do
filter :redcarpet, options: REDCARPET_OPTIONS
layout '/question.html'
write item.identifier.without_ext + '/index.html'
end
compile '/users/*.md' do
filter :redcarpet, options: REDCARPET_OPTIONS
layout '/user.html'
write item.identifier.without_ext + '/index.html'
end
compile '/httpd/*.conf.inc' do
filter :erubis
write item.identifier.to_s
end
compile '/**/*' do
write item.identifier.to_s
end
layout '/**/*', :erubis