Skip to content

Latest commit

 

History

History
111 lines (103 loc) · 2.34 KB

OLD_INSTRUCTIONS.md

File metadata and controls

111 lines (103 loc) · 2.34 KB

DEPRECATED - FaviconMaker v0.x

Integration

Middleman

In order to integrate the FaviconMaker effortless into your Middleman project use the following gem: middleman-favicon-maker till version v3.4

Capistrano

  1. Edit your Capfile and add the following line
require "favicon_maker"
  1. Add the following snippet to your deploy.rb
namespace :favicon do
  task :create_versions do
    options = {
      :root_dir => release_path,
      :input_dir => File.join("app", "assets", "public"),
      :output_dir => "public"
    }
    FaviconMaker::Generator.create_versions(options) do |filepath|
      puts "Created favicon: #{filepath}"
    end
  end
end

after "deploy:update_code", "favicon:create_versions"

Note: This snippet is untested but should work

v0.x Usage

Simple

require "rubygems"
require "favicon_maker"

FaviconMaker::Generator.create_versions

Uses the following defaults:

options = {
  :versions => [
    :apple_152,
    :apple_144,
    :apple_120,
    :apple_114,
    :apple_76,
    :apple_72,
    :apple_60,
    :apple_57,
    :apple,
    :fav_196,
    :fav_160,
    :fav_96,
    :fav_32,
    :fav_16,
    :fav_png,
    :fav_ico,
    :mstile_144
  ],
  :custom_versions => {},
  :root_dir => File.dirname(__FILE__),
  :input_dir => "favicons",
  :base_image => "favicon_base.png",
  :output_dir => "favicons_output",
  :copy => false
}

Advanced

(untested attempted Rails integration, using all available options. Could be used in a Rake task or Capistrano recipe)

options = {
  :versions => [
    :apple_152,
    :apple_144,
    :apple_120,
    :apple_114,
    :apple_76,
    :apple_72,
    :apple_60,
    :apple_57,
    :apple,
    :fav_196,
    :fav_160,
    :fav_96,
    :fav_32,
    :fav_16,
    :fav_png,
    :fav_ico,
    :mstile_144
  ],
  :custom_versions => {
    :apple_extreme_retina => {
      :filename => "apple-touch-icon-228x228-precomposed.png",
      :dimensions => "228x228",
      :format => "png"
    }
  },
  :root_dir => Rails.root,
  :input_dir => File.join("app", "assets", "public"),
  :base_image => "favicon.png",
  :output_dir => "public",
  :copy => true
}

FaviconMaker::Generator.create_versions(options) do |filepath|
  puts "Created favicon: #{filepath}"
end