This repository has been archived by the owner on Apr 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.rb
executable file
·78 lines (59 loc) · 2.63 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
72
73
74
75
76
77
78
# --------------------------------------------------------------------------------------------------
# Helpers
# --------------------------------------------------------------------------------------------------
helpers do
# Helpers are defined in and can be added to `helpers/custom_helpers.rb`.
# In case you require helpers within `config.rb`, they can be added here.
end
# --------------------------------------------------------------------------------------------------
# Extensions
# --------------------------------------------------------------------------------------------------
# Use LiveReload
activate :livereload
# Use Search Engine Sitemap
set :url_root, data.config.site.root_url
activate :search_engine_sitemap
# User Bower to manage vendor scripts
activate :bower
# Automatic image dimensions on image_tag helper (only works with local images)
activate :automatic_image_sizes
# Split up each required asset into its own script/style tag instead of combining them
set :debug_assets, true
# --------------------------------------------------------------------------------------------------
# Paths
# --------------------------------------------------------------------------------------------------
set :css_dir, 'stylesheets'
set :fonts_dir, 'fonts'
set :images_dir, 'images'
set :js_dir, 'javascripts'
# Pretty URLs - See https://middlemanapp.com/advanced/pretty_urls/
activate :directory_indexes
# --------------------------------------------------------------------------------------------------
# Build configuration
# --------------------------------------------------------------------------------------------------
configure :build do
# Exclude any vendor components (bower or custom builds) in the build
ignore 'stylesheets/vendor/*'
ignore 'javascripts/vendor/*'
activate :gzip
# Minify CSS
activate :minify_css
# Minify Javascript
activate :minify_javascript
# Minify HTML
activate :minify_html, remove_http_protocol: false,
remove_https_protocol: false,
remove_input_attributes: false,
remove_quotes: false
# Compress images (default)
require 'middleman-smusher'
activate :smusher
# Compress ALL images (advanced)
# Before activating the below, follow setup instructions on https://github.com/toy/image_optim
# activate :imageoptim do |options|
# options.pngout = false # set to true when pngout is also installed
# end
# Uniquely-named assets (cache buster)
# Exception: svg & png in images folder because they need to be interchangeable by JS
activate :asset_hash, ignore: [%r{images/(.*\.png|.*\.svg)$}i]
end