-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rules
44 lines (37 loc) · 1001 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
#!/usr/bin/env ruby
$debug = false
compile '/css/*.css' do
dputs 'css: ' + item.identifier
filter :relativize_paths, type: :css
write item.identifier
end
compile '/**/*.xml' do
dputs 'xml: ' + item.identifier
filter :erb
filter :relativize_paths, type: :html5
write item.identifier
end
compile '/**/*.md' do
filter :erb
filter :sourcecode
filter :kramdown
layout item[:layout] || '/default.*'
filter :relativize_paths, type: :html5
write item_linkname(item) + 'index.html'
dputs 'markdown: ' + item.identifier + ' => ' + item_linkname(item) + 'index.html'
end
compile '/**/*' do
dputs 'copy: ' + item.identifier
write item.identifier
end
layout '/**/*', :erb
preprocess do
@items.each do |item|
if is_article(item)
item[:kind] = "article"
item[:created_at] = derive_created_at(item)
item[:uuid] = item.identifier.without_ext.to_s.split('/')[-1];
dputs "article: " + item[:uuid]
end
end
end