Last active
December 27, 2015 13:39
-
-
Save coskuntekin/7335404 to your computer and use it in GitHub Desktop.
Middleman Configuration for v3.4.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# Compass | |
### | |
# Bootstrap | |
# First: | |
# gem install sass-rails | |
# gem install bootstrap-sass | |
# require 'bootstrap-sass' | |
# Susy grids in Compass | |
# First: gem install compass-susy-plugin | |
# require 'susy' | |
# Change Compass configuration | |
compass_config do |config| | |
config.output_style = :nested | |
config.cache_path = File.join(root, '.cache/sass') | |
config.cache_path = sass_cache_path | |
config.http_path = '/' | |
config.images_dir = 'assets/images' | |
config.javascripts_dir = 'assets/javascripts' | |
end | |
# Location of SASS .sass_cache directory. | |
set :sass_cache_path, File.join('/tmp', "middleman-#{File.basename(Dir.pwd)}", '.cache/sass') | |
# Middleman ImageOptim | |
# You should install 'gem "middleman-imageoptim", "~> 0.1.2"' | |
activate :imageoptim | |
# Cache Buster | |
#activate :asset_hash | |
activate :cache_buster | |
### | |
# Page options, layouts, aliases and proxies | |
### | |
# Per-page layout changes: | |
# | |
# With no layout | |
# page "/path/to/file.html", :layout => false | |
# | |
# With alternative layout | |
# page "/path/to/file.html", :layout => :otherlayout | |
# | |
# A path which all have the same layout | |
# with_layout :admin do | |
# page "/admin/*" | |
# end | |
# Proxy (fake) files | |
# page "/this-page-has-no-template.html", :proxy => "/template-file.html" do | |
# @which_fake_page = "Rendering a fake page with a variable" | |
# end | |
### | |
# Helpers | |
### | |
# Automatic image dimensions on image_tag helper | |
activate :automatic_image_sizes | |
# Live Reload | |
activate :livereload | |
# Methods defined in the helpers block are available in templates | |
# helpers do | |
# def some_helper | |
# "Helping" | |
# end | |
# end | |
# Compass Target Directory Configuration | |
set :css_dir, 'assets/stylesheets' | |
set :js_dir, 'assets/javascripts' | |
set :images_dir, 'assets/images' | |
set :fonts_dir, 'assets/fonts' | |
activate :directory_indexes | |
# Build-specific configuration | |
configure :build do | |
# For example, change the Compass output style for deployment | |
activate :minify_css | |
# Minify Javascript on build | |
activate :minify_javascript | |
# Enable cache buster | |
activate :cache_buster | |
# Use relative URLs | |
activate :relative_assets | |
# Compress PNGs after build | |
# First: gem install middleman-smusher | |
# require "middleman-smusher" | |
# activate :smusher | |
# Or use a different image path | |
#set :http_path, "/images/" | |
end | |
# Middleman Deploy | |
# You should install 'gem "middleman-deploy"' | |
activate :deploy do |deploy| | |
deploy.method = :ftp | |
deploy.host = "ftp.example.com" | |
deploy.path = "public_html" | |
deploy.user = "user" | |
deploy.password = "secret" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment