forked from mongoid/mongoid-site
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRules
97 lines (79 loc) · 1.74 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
89
90
91
92
93
94
95
96
#!/usr/bin/env ruby
preprocess do
# authors may unpublish items by setting meta attribute publish: false
items.delete_if { |item| item[:publish] == false }
copy_static
end
require 'compass'
Compass.add_project_configuration('compass_config.rb')
### Images
compile '/images/*/' do
# No need to run images through a filter. This is just for getting em in right place
end
route '/images/*/' do
item.identifier.chop + '.' + item[:extension]
end
### Javascript
compile '/javascript/*/' do
# No need to run images through a filter. This is just for getting em in right place
end
route '/javascript/*/' do
item.identifier.chop + '.' + item[:extension]
end
### Stylesheets
compile '/stylesheets/*/' do
case item[:extension]
when 'sass'
filter :sass, Compass.sass_engine_options
when 'css'
end
end
route '/stylesheets/_*/' do
# don't output partials, so return nil
nil
end
route '/stylesheets/*/' do
# don't generate a directory like we do for HTML files
item.identifier.chop + '.css'
end
### html, md, haml etc
compile '/home*' do
filter :erb
end
compile '/docs/*/' do
case item[:extension]
when 'html'
filter :erb
when 'html.erb'
filter :erb
when 'haml'
filter :haml
when 'html.haml'
filter :haml
when 'markdown'
filter :kramdown
end
filter :syntax_colorize
layout 'docs'
end
compile '*' do
case item[:extension]
when 'html'
filter :erb
when 'html.erb'
filter :erb
when 'haml'
filter :haml
when 'html.haml'
filter :haml
when 'markdown'
filter :kramdown
end
filter :syntax_colorize
layout 'landing'
end
route '*' do
item.identifier + 'index.html'
end
### Layout rules - only HAML!
layout '*', :haml, :format => :html5