Skip to content

Commit

Permalink
Merge pull request ares-ensiie#43 from Soulou/favicon
Browse files Browse the repository at this point in the history
Add a favicon
  • Loading branch information
Soulou committed Mar 16, 2013
2 parents f34fada + 9b04108 commit 3b09e8e
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ group :assets do
gem 'select2-rails'
gem 'uglifier', '>= 1.0.3'
gem 'asset_sync' # sync assets with s3 or openstack
gem 'favicon_maker'
end

# Database
Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ GEM
factory_girl_rails (4.2.1)
factory_girl (~> 4.2.0)
railties (>= 3.0.0)
favicon_maker (0.2.0)
mini_magick (~> 3.5)
fog (1.10.0)
builder
excon (~> 0.14)
Expand Down Expand Up @@ -121,6 +123,8 @@ GEM
railties
method_source (0.8.1)
mime-types (1.21)
mini_magick (3.5.0)
subexec (~> 0.2.1)
mongoid (3.1.2)
activemodel (~> 3.2)
moped (~> 1.4.2)
Expand Down Expand Up @@ -238,6 +242,7 @@ GEM
actionpack (~> 3.0)
activemodel (~> 3.0)
railties (~> 3.0)
subexec (0.2.2)
thor (0.17.0)
tilt (1.3.5)
tire (0.5.5)
Expand Down Expand Up @@ -275,6 +280,7 @@ DEPENDENCIES
devise
doorkeeper
factory_girl_rails
favicon_maker
fog
haml
high_voltage
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/favicons/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/favicons/favicon.ico
Binary file not shown.
Binary file added app/assets/images/favicons/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
%title IntranetSXB
= stylesheet_link_tag "application", :media => "all"
= javascript_include_tag "application"
%link{"rel" => "apple-touch-icon-precomposed", "sizes" => "144x144", "href" => (asset_path "favicons/apple-touch-icon-144x144-precomposed.png")}
%link{"rel" => "apple-touch-icon-precomposed", "sizes" => "114x114", "href" => (asset_path "favicons/apple-touch-icon-114x114-precomposed.png")}
%link{"rel" => "apple-touch-icon-precomposed", "sizes" => "72x72", "href" => (asset_path "favicons/apple-touch-icon-72x72-precomposed.png")}
%link{"rel" => "apple-touch-icon-precomposed", "sizes" => "57x57", "href" => (asset_path "favicons/apple-touch-icon-57x57-precomposed.png")}
%link{"rel" => "shortcut icon", "href" => (asset_path "favicons/favicon.png")}
= favicon_link_tag (asset_path "favicons/favicon.ico")
= csrf_meta_tags
%meta(name="viewport" content="width=device-width, initial-scale=1.0")
%body
Expand Down
36 changes: 36 additions & 0 deletions lib/tasks/favicon.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
require "rubygems"
require "favicon_maker"

namespace :favicon do
desc "Create the favicons and put them in assets/images"
task :generate => :environment do

def gen(options)
FaviconMaker::Generator.create_versions(options) do |file|
puts "Generate #{file}"
end
end

options = {
versions: [:apple_144],
root_dir: Rails.root,
input_dir: File.join("app", "assets", "images"),
base_image: "logo-256px.png",
output_dir: File.join("app", "assets", "images", "favicons")
}
gen(options)
options[:versions] = [:apple_114, :apple_72]
options[:base_image] = "logo-128px.png"
gen(options)
options[:versions] = [:apple_57, :apple_pre, :apple]
options[:base_image] = "logo-64px.png"
gen(options)
options[:versions] = [:fav_png]
options[:base_image] = "logo-32px.png"
gen(options)
options[:versions] = [:fav_ico]
options[:base_image] = "logo-16px.png"
gen(options)
end
end

Empty file removed public/favicon.ico
Empty file.

0 comments on commit 3b09e8e

Please sign in to comment.