Middleman build results in wrong asset directories
ezramechaber opened this issue · comments
Ezra Mechaber commented
Hi there,
When I run bundle exec middleman build
using the default config.rb, it creates the wrong paths for my CSS/Javascript and images. Adding activate :relative_assets
solves my CSS/JS folder issues, but it still thinks my images live in meme/images
rather than meme/build/images
.
What am I doing wrong here?
Here's what my config.rb file looks like:
# Reload the browser automatically whenever files change
activate :livereload
###
# Compass
###
compass_config do |config|
config.output_style = :compressed
end
###
# Helpers
###
helpers do
def get_url
absolute_prefix + url_prefix
end
end
###
# Config
###
set :css_dir, 'stylesheets'
set :js_dir, 'javascripts'
set :images_dir, 'images'
set :url_prefix, '/'
set :absolute_prefix, 'http://localhost:4567'
# Build-specific configuration
configure :build do
puts "local build"
set :url_prefix, ""
set :absolute_prefix, ""
activate :asset_hash
activate :minify_javascript
activate :minify_css
end
Ezra Mechaber commented
Got it working by leaving out activate :relative_assets
and just adjusting index.html to remove the leading "/" afterwards, but feels like there's got to be a more elegant solution. (Thanks for the tool, it's very useful!)