-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.rb
70 lines (56 loc) · 1.56 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Slim::Engine.set_options format: :html
set :css_dir, 'stylesheets'
set :js_dir, 'javascripts'
set :images_dir, 'images'
# Proxy pages (https://middlemanapp.com/advanced/dynamic_pages/)
# PAGES = %w()
# PAGES.each do |page|
# proxy page, "#{page}.html"
# end
# Automatic image dimensions on image_tag helper
# activate :automatic_image_sizes
# Methods defined in the helpers block are available in templates
helpers do
def flash_class(type)
case type
when 'alert' then 'alert-warning'
when 'error' then 'alert-danger'
when 'notice' then 'alert-info'
when 'success' then 'alert-success'
else type
end
end
end
# Deployment configuration
commit_sha = `git log --pretty="%h" -n1`.strip
commit_message = "update to #{commit_sha}"
activate :deploy do |deploy|
deploy.build_before = true
deploy.method = :git
deploy.branch = 'gh-pages'
deploy.commit_message = commit_message
end
# Development configuration
configure :development do
activate :livereload
Slim::Engine.set_options pretty: true
end
# Build-specific configuration
configure :build do
# PAGES.map {|p| ignore p }
ignore 'fonts/bootstrap/*'
ignore 'stylesheets/main.css'
activate :minify_css
activate :minify_javascript
# Enable cache buster
# activate :asset_hash
# Use relative URLs
activate :relative_assets
end
# Copy README.md file to build dir
# after_build do |builder|
# src = File.join config[:source], 'README.md'
# dst = File.join config[:build_dir], 'README.md'
# builder.source_paths << File.dirname(__FILE__)
# builder.copy_file src, dst
# end