forked from gilbert/staticmatic2
/
configuration.rb
47 lines (37 loc) · 1.21 KB
/
configuration.rb
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
module StaticMatic
class Configuration
attr_accessor :preview_server
attr_accessor :preview_server_host
attr_accessor :preview_server_port
attr_accessor :use_extensions_for_page_links
attr_accessor :default_template_engine
attr_accessor :engine_options, :preview_engine_options
attr_accessor :reverse_ext_mappings
def initialize
self.preview_server = Rack::Handler::WEBrick
self.preview_server_host = "localhost"
self.preview_server_port = 4000
self.use_extensions_for_page_links = true
self.default_template_engine = 'haml'
self.engine_options = {
'haml' => {}, 'sass' => {}, 'scss' => {},
}
self.preview_engine_options = self.engine_options.clone
# TODO: discover a way of auto-detecting these. one can hope.
self.reverse_ext_mappings = {
'sass' => 'css',
'scss' => 'css',
'less' => 'css',
'coffee' => 'js',
'builder' => 'xml',
'yajl' => 'json'
}
%w{
creole erb haml liquid radius mab markdown md
mediawiki mkd mw nokogiri rdoc rhtml slim textile wiki
}.each do |ext|
@reverse_ext_mappings[ext] = 'html'
end
end
end
end