Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middleman build results in wrong asset directories #36

Open
ezramechaber opened this issue Jun 26, 2017 · 1 comment
Open

Middleman build results in wrong asset directories #36

ezramechaber opened this issue Jun 26, 2017 · 1 comment

Comments

@ezramechaber
Copy link

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
@ezramechaber
Copy link
Author

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!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant