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

template_dir, output_dir and using SVG not working as of 4.0 #42

Open raefa opened 7 years ago

raefa commented 7 years ago

Both these are getting ignored.

    f.template_dir = '/source/images/'
    f.output_dir = '/source/images/icons'

I resorted to putting the templates in the root and expecting the output in the root also.

Also, if I specify SVG templates the generated files are SVG despite what the file extension says. I resorted to using PNG templates.

Note, I upgraded to the latest ImageMagik (brew upgrade imagemagik) and I am running on OSX.

joshRpowell commented 7 years ago

@raefa this comment points out a solution. there was a bug introduced in 4.0.4

raefa commented 7 years ago

@joshRpowell Thanks for looking into it but that only works if I downgrade to Middleman gem. I have a working solution (as described above) so I am not too fussed about this now. If you do want to look into it, here are the gems I'm using:

# Middleman Gems
gem 'middleman', '>= 4.1.14'
gem 'middleman-livereload'
gem 'middleman-compass', '>= 4.0.1'
gem "middleman-favicon-maker", ">= 4.0.4"
gem 'middleman-s3_sync'
gem "middleman-blog", "~> 4.0"
gem 'strftime', '~> 1.0'
gem 'middleman-minify-html'
gem 'middleman-robots'
danielbayerlein commented 7 years ago

@raefa Can you try it with middleman-favicon-maker version 4.0.5?

raefa commented 7 years ago

@danielbayerlein Worked! Good stuff. I suggest you put an example of the output_dir in the docs. Took me a little while to work out what format it should be in.

  activate :favicon_maker do |f|
    f.template_dir = '/source/images/'
    f.output_dir = 'images/icons'
    f.icons = {
      "_favicon_template_apple.png" => [
        { icon: "apple-touch-icon.png", size: "180x180" }
      ],
      "_favicon_template.png" => [
        { icon: "favicon-32x32.png" },
        { icon: "favicon-16x16.png" },
        { icon: "android-chrome-192x192", size: "192x192" },
        { icon: "android-chrome-512x512", size: "512x512" },
        { icon: "favicon.ico", size: "64x64,32x32,24x24,16x16" }
      ]
    }
  end
raefa commented 7 years ago

@danielbayerlein Sorry. I take that back. The output directory did not work it put them in the root.