-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.rb
More file actions
108 lines (74 loc) · 2.29 KB
/
config.rb
File metadata and controls
108 lines (74 loc) · 2.29 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
###
# Page options, layouts, aliases and proxies
###
# Global variables
ANALYTICS_KEY = 'UA-XXXXX-Y' # To disable GA, leave unset or set to nil
# Per-page layout changes:
#
# With no layout
page '/*.xml', layout: false
page '/*.json', layout: false
page '/*.txt', layout: false
# Specific layout
# With alternative layout
# page "/path/to/file.html", layout: :otherlayout
# Proxy pages (http://middlemanapp.com/basics/dynamic-pages/)
# proxy "/this-page-has-no-template.html", "/template-file.html", locals: {
# which_fake_page: "Rendering a fake page with a local variable" }
# General configuration
config[:source] = 'source'
config[:build_dir] = 'dist'
config[:layout] = 'page'
config[:js_dir] = 'assets/javascripts'
config[:css_dir] = 'assets/stylesheets'
config[:images_dir] = 'assets/images'
config[:fonts_dir] = 'assets/fonts'
# Reload the browser automatically whenever files change
configure :development do
# Activate url prettify
activate :directory_indexes
# Active localization
activate :i18n, :mount_at_root => false, :langs => [:it, :en]
# Activate prockets for sass globbing
activate :sprockets
# Activate livereload
activate :livereload
# Autoprefixer config
activate :autoprefixer do |config|
config.browsers = ['last 2 versions', 'Explorer >= 11']
end
end
###
# Helpers
###
# Build-specific configuration
configure :build do
# Activate url prettify
activate :directory_indexes
# Active localization
activate :i18n, :mount_at_root => false, :langs => [:it, :en]
# Activate prockets for sass globbing
activate :sprockets
# Minify CSS on build
activate :minify_css
# Minify Javascript on build
activate :minify_javascript
# Minify the HTML
activate :minify_html
# Activate resources hashing
activate :asset_hash
# Autoprefixer config
activate :autoprefixer do |config|
config.browsers = ['last 2 versions', 'Explorer >= 11']
end
end
# Change to your Google Analytics key (e.g. UA-XXXXX-Y)
config[:ga_key] = ANALYTICS_KEY != '' ? ANALYTICS_KEY : nil
activate :google_analytics do |ga|
# Property ID (default = nil)
ga.tracking_id = ANALYTICS_KEY
# Tracking in development environment (default = true)
ga.development = false
# Compress the JavaScript code (default = false)
ga.minify = true
end