Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add extension to middleman-sprockets to get http_prefix in Sass
We want to be able to prefix directory paths with the http_prefix in Sass, however normally the `asset-path` helper tries to add a file extension, so this commit adds a small extension that skips the usual logic if the path ends with `/`. The extension works by reaching into the `Sprockets::Envionment` instance in the `middleman-sprockets` extension [1], and replacing the definition of the method `asset_path` [2]. Sprockets turns any calls to `asset-path` in any CSS/Sass it processes into a call to this method, so this is our way to smuggle information into our Sass. [1]: https://github.com/middleman/middleman-sprockets/blob/a32cbe3c8ca129b608bdc852c7ff7ad489f9a087/lib/middleman-sprockets/extension.rb#L28 [2]: https://github.com/middleman/middleman-sprockets/blob/a32cbe3c8ca129b608bdc852c7ff7ad489f9a087/lib/middleman-sprockets/extension.rb#L58
- Loading branch information