-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.rb
71 lines (58 loc) · 2.07 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
71
::Sass.load_paths << File.join(root, "node_modules")
require 'slim'
Slim::Engine.default_options[:pretty] = true # Avoid HTML minification for Karl
activate :autoprefixer, browsers: ['last 2 versions', 'ie 8', 'ie 9']
activate :livereload
activate :directory_indexes
set :css_dir, 'assets/stylesheets'
set :images_dir, 'assets/images'
set :js_dir, 'assets/javascripts'
page '/*.xml', layout: false
page '/*.json', layout: false
page '/*.txt', layout: false
# Build-specific configuration
configure :build do
activate :favicon_maker do |f|
f.template_dir = File.join(root, 'source/assets/images/logos/')
f.output_dir = File.join(root, 'build')
f.icons = {
'favicon_base.png' => [
{ icon: 'chrome-touch-icon-192x192.png' },
{ icon: 'apple-touch-icon.png', size: '152x152' },
{ icon: 'ms-touch-icon-144x144-precomposed.png', size: '144x144' },
{ icon: 'favicon-196x196.png' },
{ icon: 'favicon-160x160.png' },
{ icon: 'favicon-96x96.png' },
{ icon: 'favicon-32x32.png' },
{ icon: 'favicon-16x16.png' },
{ icon: 'favicon.ico', size: '64x64,32x32,24x24,16x16' },
]
}
end
activate :asset_hash
activate :gzip
activate :minify_css
activate :minify_javascript
activate :sitemap, hostname: data.settings.site.url
activate :sitemap_ping do |config|
config.host = "#{data.settings.site.url}"
end
activate :robots,
rules: [{:user_agent => '*', :allow => %w(/)}],
sitemap: data.settings.site.url+'/sitemap.xml'
# Use this for github.io gh-pages
set :relative_links, true
activate :relative_assets
end
# Push-it to the web
activate :deploy do |deploy|
deploy.method = :git
deploy.branch = 'gh-pages'
deploy.build_before = true # always use --no-clean options
committer_app = "#{Middleman::Deploy::PACKAGE} v#{Middleman::Deploy::VERSION}"
commit_message = "Deployed using #{committer_app}"
if ENV["TRAVIS_BUILD_NUMBER"] then
commit_message += " (Travis Build \##{ENV["TRAVIS_BUILD_NUMBER"]})"
end
deploy.commit_message = commit_message
end