2012-07-17 00:52:06 +04:00
|
|
|
###
|
2011-07-25 20:48:49 -07:00
|
|
|
# Compass
|
|
|
|
###
|
|
|
|
|
|
|
|
# Change Compass configuration
|
|
|
|
# compass_config do |config|
|
|
|
|
# config.output_style = :compact
|
|
|
|
# end
|
|
|
|
|
|
|
|
###
|
2011-12-23 10:55:25 -08:00
|
|
|
# Page options, layouts, aliases and proxies
|
2011-07-25 20:48:49 -07:00
|
|
|
###
|
|
|
|
|
|
|
|
# Per-page layout changes:
|
2012-07-17 00:52:06 +04:00
|
|
|
#
|
2010-09-04 20:26:48 -07:00
|
|
|
# With no layout
|
2014-03-01 15:19:38 -03:00
|
|
|
page '/*.xml', layout: false
|
|
|
|
page '/*.json', layout: false
|
|
|
|
page '/*.txt', layout: false
|
2012-07-17 00:52:06 +04:00
|
|
|
#
|
2010-09-04 20:26:48 -07:00
|
|
|
# With alternative layout
|
2014-05-26 17:58:35 -07:00
|
|
|
# page "/path/to/file.html", layout: :otherlayout
|
2011-07-25 20:48:49 -07:00
|
|
|
|
2014-01-27 09:35:30 +02:00
|
|
|
# Proxy pages (http://middlemanapp.com/basics/dynamic-pages/)
|
2014-05-26 17:58:35 -07:00
|
|
|
# proxy "/this-page-has-no-template.html", "/template-file.html", locals: {
|
|
|
|
# which_fake_page: "Rendering a fake page with a local variable" }
|
2009-10-22 17:25:15 -07:00
|
|
|
|
2011-07-25 20:48:49 -07:00
|
|
|
###
|
2009-10-22 17:25:15 -07:00
|
|
|
# Helpers
|
2011-07-25 20:48:49 -07:00
|
|
|
###
|
|
|
|
|
2011-12-23 10:55:25 -08:00
|
|
|
# Automatic image dimensions on image_tag helper
|
|
|
|
# activate :automatic_image_sizes
|
|
|
|
|
2013-05-02 18:59:39 -07:00
|
|
|
# Reload the browser automatically whenever files change
|
2014-03-09 17:50:34 -07:00
|
|
|
# configure :development do
|
|
|
|
# activate :livereload
|
|
|
|
# end
|
2013-03-26 11:21:05 -03:00
|
|
|
|
2011-07-25 20:48:49 -07:00
|
|
|
# Methods defined in the helpers block are available in templates
|
2011-07-10 13:57:31 -07:00
|
|
|
# helpers do
|
2011-07-25 20:48:49 -07:00
|
|
|
# def some_helper
|
2011-07-10 13:57:31 -07:00
|
|
|
# "Helping"
|
|
|
|
# end
|
|
|
|
# end
|
2009-10-22 17:25:15 -07:00
|
|
|
|
2012-03-03 16:40:03 -08:00
|
|
|
<% if options[:css_dir] -%>
|
|
|
|
set :css_dir, '<%= options[:css_dir] -%>'
|
2011-02-05 10:32:04 -08:00
|
|
|
<% else -%>
|
2010-09-04 20:26:48 -07:00
|
|
|
# Change the CSS directory
|
|
|
|
# set :css_dir, "alternative_css_directory"
|
2011-02-05 10:32:04 -08:00
|
|
|
<% end -%>
|
2009-10-22 17:25:15 -07:00
|
|
|
|
2012-03-03 16:40:03 -08:00
|
|
|
<% if options[:js_dir] -%>
|
|
|
|
set :js_dir, '<%= options[:js_dir] -%>'
|
2011-02-05 10:32:04 -08:00
|
|
|
<% else -%>
|
2010-09-04 20:26:48 -07:00
|
|
|
# Change the JS directory
|
|
|
|
# set :js_dir, "alternative_js_directory"
|
2011-02-05 10:32:04 -08:00
|
|
|
<% end -%>
|
2010-09-04 20:26:48 -07:00
|
|
|
|
2012-03-03 16:40:03 -08:00
|
|
|
<% if options[:images_dir] -%>
|
|
|
|
set :images_dir, '<%= options[:images_dir] -%>'
|
2011-02-05 10:32:04 -08:00
|
|
|
<% else -%>
|
2010-09-04 20:26:48 -07:00
|
|
|
# Change the images directory
|
|
|
|
# set :images_dir, "alternative_image_directory"
|
2011-02-05 10:32:04 -08:00
|
|
|
<% end -%>
|
2009-11-02 16:41:28 -08:00
|
|
|
|
2009-10-22 17:25:15 -07:00
|
|
|
# Build-specific configuration
|
|
|
|
configure :build do
|
|
|
|
# For example, change the Compass output style for deployment
|
2010-09-06 18:48:25 -07:00
|
|
|
# activate :minify_css
|
2012-07-17 00:52:06 +04:00
|
|
|
|
2009-11-02 16:41:28 -08:00
|
|
|
# Minify Javascript on build
|
2010-09-06 18:48:25 -07:00
|
|
|
# activate :minify_javascript
|
2012-07-17 00:52:06 +04:00
|
|
|
|
2009-11-17 11:13:32 -08:00
|
|
|
# Enable cache buster
|
2013-05-02 18:59:39 -07:00
|
|
|
# activate :asset_hash
|
2012-07-17 00:52:06 +04:00
|
|
|
|
2011-04-19 14:24:21 -07:00
|
|
|
# Use relative URLs
|
|
|
|
# activate :relative_assets
|
2012-07-17 00:52:06 +04:00
|
|
|
|
2009-10-22 17:25:15 -07:00
|
|
|
# Or use a different image path
|
2013-08-15 15:24:03 -07:00
|
|
|
# set :http_prefix, "/Content/images/"
|
2013-03-26 11:21:05 -03:00
|
|
|
end
|