-
Notifications
You must be signed in to change notification settings - Fork 9
/
config.rb
49 lines (39 loc) · 983 Bytes
/
config.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
48
49
# Layout page
with_layout :guide do
page "/guia/*"
end
# Relative Links
set :relative_links, true
# Markdown
set :markdown, :tables => true, :autolink => true, :gh_blockcode => true,
:fenced_code_blocks => true, :with_toc_data => true, :line_number => true
set :markdown_engine, :redcarpet
# Reload the browser automatically whenever files change
configure :development do
activate :livereload
end
helpers do
# Create chapters basead on titles
def chapters(post)
File.readlines(post.source_file).collect do |x|
if x =~ /^##\s(.*)/
$1
else
nil
end
end.select { |x| x }
end
end
# Sintax
activate :syntax
# Assets
set :css_dir, 'assets/stylesheets'
set :js_dir, 'assets/javascripts'
set :images_dir, 'assets/images'
sprockets.append_path File.join root.to_s, "source/assets/components"
# Build-specific configuration
configure :build do
activate :minify_css
activate :minify_javascript
activate :relative_assets
end