forked from vivekrp/tent.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rules
88 lines (72 loc) · 1.54 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
#!/usr/bin/env ruby
preprocess do
create_robots_txt
create_webmaster_tools_authentications
create_sitemap
end
compile '/assets/css/*' do
filter :cache_buster
filter :rainpress
end
route %r{^/(assets/.*|sitemap|robots|atom)/$} do
next nil if item.identifier.split('/')[-1][0,1] == '_' # partial
fp = cachebust?(item) ? fingerprint(item[:filename]) : ''
item.identifier.chop + fp + '.' + item[:extension]
end
compile '/sitemap/' do
filter :erb
end
compile '/blog/feed/' do
filter :erb
end
route '/blog/feed/' do
'/blog.xml'
end
compile %r{^/(google|robots|assets|favicon)} do
end
compile '*' do
case item[:extension]
when 'slim'
filter :slim
when 'md'
filter :schema_table
filter :api_example
filter :erb
filter :redcarpet, renderer: MarkdownHTML, options: {
fenced_code_blocks: true,
no_intra_emphasis: true,
autolink: true,
tables: true,
strikethrough: true,
lax_html_blocks: true,
space_after_headers: true,
superscript: true
}
end
case item.identifier
when %r{/_}
layout 'none'
when %r{^/blog/.+}
layout 'post'
when %r{^/docs/}
layout 'doc'
else
layout 'default'
end
filter :cache_buster
end
route '/' do
'/index.html'
end
route 'api_examples.yaml' do
end
route '*' do
next nil if item.identifier.split('/')[-1][0,1] == '_' # partial
if item.binary?
# Write item with identifier /foo/ to /foo.ext
item.identifier.chop + '.' + item[:extension]
else
item.identifier.chop + '.html'
end
end
layout '*', :slim