forked from atom/flight-manual.atom.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rules
68 lines (57 loc) · 1.47 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
require 'extended-markdown-filter'
compile '/index.html' do
filter :erb
layout '/toc.html'
end
compile '**/*.asciidoc' do
filter :html_pipeline, @config[:asciidoc_pipeline_config]
filter :erb
filter :colorize_syntax, :default_colorizer => :rouge
layout '/article.html'
end
compile '**/index.md' do
filter :html_pipeline, @config[:markdown_pipeline_config]
filter :erb
filter :colorize_syntax, :default_colorizer => :rouge
layout '/section.html'
end
compile '**/*.md' do
filter :html_pipeline, @config[:markdown_pipeline_config]
filter :erb
filter :colorize_syntax, :default_colorizer => :rouge
layout '/article.html'
end
compile '/search.html' do
filter :erb
layout '/toc.html'
end
compile '/search.json' do
filter :erb
end
passthrough '/**/*.jpg'
passthrough '/**/*.jpeg'
passthrough '/**/*.png'
passthrough '/**/*.gif'
passthrough '/CNAME'
route '/search.json' do
'/search.json'
end
route '**/*' do
if item.binary?
item.identifier.chop + (item[:extension] ? '.' + item[:extension] : '')
elsif item.identifier == '/index.html'
'/index.html'
elsif item.identifier =~ /\/404.asciidoc/
'/404.html'
elsif item.identifier =~ /\/404.md/
'/404.html'
elsif item.identifier =~ /index.asciidoc/
File.dirname(item.identifier) + '/index.html'
elsif item.identifier =~ /index.md/
File.dirname(item.identifier) + '/index.html'
else
item.identifier.without_ext + '/index.html'
end
end
layout '/**/*', :erb