Please Note!
This fix depends upon support in the 'middleman-sprockets' gem, where the following code must be present:
# lib/middleman-sprockets/extension.rb
<snip…>
append_path app.css_dir
# add custom assets paths to the scope
app.js_assets_paths.each do |p|
append_path p
end
The purpose of this addition is to support including JS files from external (global) repositories.
Example usage:
# in config.rb
set :js_assets_path, [ "#{root}/assets/js/", "~/.js-repo/"]
Using symlinks or copying files to the Middleman project can get messy quickly. This fix reduces some of those issues.
Compass is great, but sometimes we need to have common framework code in one (global) location with local overrides in the app.
This addition adds built-in support for loading SASS/SCSS files from multiple locations external to the "source" directory and even the Middleman app root.
Example usage:
# in config.rb
set :sass_assets_path, [ "#{root}/assets/sass/", "~/.sass-repo/"]
Using symlinks or copying files to the Middleman project can get messy quickly. This fix reduces some of those issues.
First time working with Cucumber, so perhaps not the best way to do things.
* Tests for default setting which stores the .sass_cache directory in Middleman app root.
* Tests for custom setting which stores the .sass_cache directory in /tmp directory.
Please Note! Unable to test the output of the default .sass_cache location since the directory is stored outside of the app root during testing, but inside app root in "production"
The default output of SASS .sass_cache directory is in the Middleman app root directory, which to my mind adds clutter to the directory.
Secondly, when storing Middleman apps in a Dropbox subfolder, the .sass_cache directory gets synced unnecessarily.
This fix enables moving the .sass_cache directory to any path on the system, such as the "/tmp" directory for automatic discarding of files when restarting the system.
Suggested usage:
#in config.rb
set :sass_cache_path, File.join('/tmp', "middleman-#{File.basename(Dir.pwd)}", "sass_cache")
which could return something like:
`/tmp/middleman-example.com/sass_cache`
This keeps multiple projects separated and easily identifiable.
This allows extensions, templates and monkey-patches to chdir
when needed, without triggering this ruby warning:
warning: conflicting chdir during another chdir block
If the destination_path matches the index_file but the original path
does not (as can happen with proxied resources) then directory_indexes
will add the index file a second time, e.g. resource.path = "myres.html"
and resource.destination_path = "myres/index.html" then
directory_indexes will convert this to resource.destination_path =
"myres/index/index.html". This patch fixes that by making
directory_indexes check the destination_path when determining whether to
reroute.
"set :trailing_slash, false" will cause resource urls that match the
index_file to have the trailing slash stripped off the directory URL,
e.g. instead of "/dir/index.html" becoming "/dir/" it will be "/dir"