follmann / middleman-favicon-maker

Generate favicon files in various sizes from a base image in your middleman project
MIT License
114 stars 15 forks source link

Allow absolute build path #21

Closed Arcovion closed 10 years ago

Arcovion commented 10 years ago

Errors from https://github.com/follmann/middleman-favicon-maker/issues/17 have cropped up again, suggest editing extension.rb similar to this:

require "pathname"
...
options[:output_dir] = if Pathname.new(app.build_dir).absolute?
  app.build_dir
else
  File.join(app.root, app.build_dir)
end

The builder.remove_file is also pointing to the wrong place as before, surely it's best to cover this with middleman's built-in behaviour by just putting an underscore in front of the favicon_template.png?

follmann commented 10 years ago

Can't you just set f.output_dir = <absolute-path>? I actually don't want to include this logic in the extension. Therefore template_dirand output_dir require absolute paths.

Arcovion commented 10 years ago

Yes, f.output_dir = config[:build_dir] works and I can use a relative path for f.template_dir as expected - but it still doesn't remove the favicon_template.png if f.template_dir is changed. I think some stuff like f.output_dir = config[:build_dir] should be a default within the extension logic itself...

Arcovion commented 10 years ago

3.5.2: Issues persist This line: f.output_dir = config[:build_dir] is still required Favicon not being removed and also not showing removal message

Steps to recreate:

Issues: