-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rules
78 lines (63 loc) · 1.69 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
#!/usr/bin/env ruby
require 'date'
preprocess do
@items.find_all('/meetings/*/audio_0.ogg').each do |recording|
generate_meeting_index_for(recording)
end
end
ignore '/meetings/*/*.json'
ignore '/meetings/*/notes'
compile '/meetings/*/agenda.md' do
filter :erb
filter :pandoc, args: [
{ from: :"markdown+autolink_bare_uris", to: :html5 },
{ base_header_level: 2 }
]
layout '/working_agenda.html'
write ext: 'html'
end
compile '/meetings/*/agenda.md', rep: :mail do
filter :erb
filter :pandoc, from: :markdown, to: :plain
layout '/agenda.mail'
cached_mail = @items[@item.identifier.without_ext + '.mail']
write cached_mail ? nil : { ext: 'mail' }
end
compile '/meetings/*/index' do
layout '/transcript.html'
write ext: 'html'
end
compile '/meetings/*/index', rep: :mail do
layout '/transcript.mail'
write ext: 'mail'
end
compile '/meetings/*/audio_*.vtt', rep: :html do
filter :transcript_from_vtt, to: :html
end
compile '/meetings/*/audio_*.vtt', rep: :text do
filter :transcript_from_vtt, to: :markdown
filter :pandoc, from: :markdown, to: :plain
end
compile '/**/*.html' do
filter :erb
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}' do
if item.identifier =~ '/**/index.*'
File.join(File.dirname(item.identifier), 'index.html')
else
item.identifier.without_ext + '/index.html'
end
end
compile '/**/*' do
write item.identifier.to_s
end
layout '/**/*', :erb, trim_mode: '<>'