middleman-favicon-maker 3.7 → 4.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -26
- data/lib/middleman-favicon-maker/extension.rb +13 -4
- data/lib/middleman-favicon-maker/version.rb +4 -4
- data/middleman-favicon-maker.gemspec +1 -1
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9672cc8464dbe8e5aba3429910aad38247302fc8
|
4
|
+
data.tar.gz: 672107a0821c62202b7f746fd848df0b1b4a1576
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24636e68a027c4fad522fde903f2cb41dde7a3c0d4a00abcd39491953e242476b190d245ef1941763d239319a6a54bbecbc3f9cf5ca9450d857c4bf80c2c5b8c
|
7
|
+
data.tar.gz: 9098727af8dcaf0bec0ef7ef4d3da9b7676cecaa72f2003280a02beed18f0e70069549ecc3dfa2e666c2c47d363eabf31b210c686d2a49d2c62766c35b2724b4
|
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
# middleman-favicon-maker
|
1
|
+
# middleman-favicon-maker
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/middleman-favicon-maker.svg)](http://badge.fury.io/rb/middleman-favicon-maker)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/follmann/middleman-favicon-maker.png)](https://codeclimate.com/github/follmann/middleman-favicon-maker)
|
2
4
|
|
3
5
|
[FaviconMaker](https://github.com/follmann/favicon_maker) is a gem which generates favicon files in various sizes from a base image. This gem integrates FaviconMaker effortlessly into your [Middleman](https://github.com/middleman/middleman) project.
|
4
6
|
|
@@ -15,17 +17,17 @@ brew install imagemagick
|
|
15
17
|
### Using Bundler
|
16
18
|
|
17
19
|
``` ruby
|
18
|
-
gem "middleman-favicon-maker", "~> 3.
|
20
|
+
gem "middleman-favicon-maker", "~> 3.7"
|
19
21
|
```
|
20
22
|
|
21
23
|
If you're using Middleman version 2.x, use version 0.0.6 of middleman-favicon-maker.
|
22
24
|
|
23
25
|
## Integrating with Middleman
|
24
|
-
|
25
|
-
Create an image e.g. named `_favicon_template.png` and place it in your source directory. The leading underscore prevents it from being copied into the build directory. Ideally, this image's dimensions would be 152 x 152 or have multiple templates for different ranges (small, medium, big). In your config.rb, extend the `configure :build` block.
|
26
|
+
### Templates
|
27
|
+
Create an image e.g. named `_favicon_template.png` and place it in your source directory. The leading underscore prevents it from being copied into the build directory. Ideally, this image's dimensions would be 152 x 152 or have multiple templates for different ranges (small, medium, big). In your config.rb, extend the `configure :build` block. The image formats used for templates should be either PNG or SVG (since v3.6).
|
26
28
|
|
27
29
|
### Simple config
|
28
|
-
This config assumes that a PNG file named
|
30
|
+
This config assumes that a PNG file named `_favicon_template.png` lives in the source folder. The generated icons are stored in the build folder root.
|
29
31
|
|
30
32
|
``` ruby
|
31
33
|
configure :build do
|
@@ -42,14 +44,13 @@ end
|
|
42
44
|
```
|
43
45
|
|
44
46
|
### Advanced config
|
45
|
-
Using all configuration options. The `template_dir` and `output_dir`
|
47
|
+
Using all configuration options. The `template_dir` and `output_dir` point to source and build dir if not set, you can use absolute or relative paths. You can use multiple template files that suit the different resolutions better. `format` and `size` are optional and only required when the size of the icon and/or the file format is not encoded in the filename. Multiple resolutions in one file is only supported for the .ico format.
|
46
48
|
|
47
49
|
``` ruby
|
48
50
|
configure :build do
|
49
51
|
...
|
50
52
|
activate :favicon_maker do |f|
|
51
|
-
f.template_dir =
|
52
|
-
f.output_dir = File.join(root, 'build')
|
53
|
+
f.template_dir = 'source/images'
|
53
54
|
f.icons = {
|
54
55
|
"_favicon_template_hires.png" => [
|
55
56
|
{ icon: "apple-touch-icon-152x152-precomposed.png" },
|
@@ -72,24 +73,28 @@ This is a moving target. Feel free to extend it and submit the change.
|
|
72
73
|
|
73
74
|
``` ruby
|
74
75
|
[
|
75
|
-
{ icon: "apple-touch-icon-152x152-precomposed.png" },
|
76
|
-
{ icon: "apple-touch-icon-144x144-precomposed.png" },
|
77
|
-
{ icon: "apple-touch-icon-120x120-precomposed.png" },
|
78
|
-
{ icon: "apple-touch-icon-114x114-precomposed.png" },
|
79
|
-
{ icon: "apple-touch-icon-76x76-precomposed.png" },
|
80
|
-
{ icon: "apple-touch-icon-72x72-precomposed.png" },
|
81
|
-
{ icon: "apple-touch-icon-60x60-precomposed.png" },
|
82
|
-
{ icon: "apple-touch-icon-57x57-precomposed.png" },
|
83
|
-
{ icon: "apple-touch-icon-precomposed.png", size: "57x57" },
|
84
|
-
{ icon: "apple-touch-icon.png", size: "57x57" },
|
85
|
-
{ icon: "favicon-196x196.png" },
|
86
|
-
{ icon: "favicon-160x160.png" },
|
87
|
-
{ icon: "favicon-96x96.png" },
|
88
|
-
{ icon: "favicon-32x32.png" },
|
89
|
-
{ icon: "favicon-16x16.png" },
|
90
|
-
{ icon: "favicon.png", size: "16x16" },
|
91
|
-
{ icon: "favicon.ico", size: "64x64,32x32,24x24,16x16" },
|
92
|
-
{ icon: "mstile-
|
76
|
+
{ icon: "apple-touch-icon-152x152-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for retina iPad with iOS7.
|
77
|
+
{ icon: "apple-touch-icon-144x144-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for retina iPad with iOS6 or prior.
|
78
|
+
{ icon: "apple-touch-icon-120x120-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for retina iPhone with iOS7.
|
79
|
+
{ icon: "apple-touch-icon-114x114-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for retina iPhone with iOS6 or prior.
|
80
|
+
{ icon: "apple-touch-icon-76x76-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for non-retina iPad with iOS7.
|
81
|
+
{ icon: "apple-touch-icon-72x72-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for non-retina iPad with iOS6 or prior.
|
82
|
+
{ icon: "apple-touch-icon-60x60-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for non-retina iPhone with iOS7.
|
83
|
+
{ icon: "apple-touch-icon-57x57-precomposed.png" }, # iPhone and iPad users can turn web pages into icons on their home screen. Such link appears as a regular iOS native application. When this happens, the device looks for a specific picture. The 57x57 resolution is convenient for non-retina iPhone with iOS6 or prior. Learn more in Apple docs.
|
84
|
+
{ icon: "apple-touch-icon-precomposed.png", size: "57x57" }, # Same as apple-touch-icon.png, expect that is already have rounded corners (but neither drop shadow nor gloss effect).
|
85
|
+
{ icon: "apple-touch-icon.png", size: "57x57" }, # Same as apple-touch-icon-57x57.png, for "default" requests, as some devices may look for this specific file. This picture may save some 404 errors in your HTTP logs. See Apple docs
|
86
|
+
{ icon: "favicon-196x196.png" }, # For Android Chrome M31+.
|
87
|
+
{ icon: "favicon-160x160.png" }, # For Opera Speed Dial (up to Opera 12; this icon is deprecated starting from Opera 15), although the optimal icon is not square but rather 256x160. If Opera is a major platform for you, you should create this icon yourself.
|
88
|
+
{ icon: "favicon-96x96.png" }, # For Google TV.
|
89
|
+
{ icon: "favicon-32x32.png" }, # For Safari on Mac OS.
|
90
|
+
{ icon: "favicon-16x16.png" }, # The classic favicon, displayed in the tabs.
|
91
|
+
{ icon: "favicon.png", size: "16x16" }, # The classic favicon, displayed in the tabs.
|
92
|
+
{ icon: "favicon.ico", size: "64x64,32x32,24x24,16x16" }, # Used by IE, and also by some other browsers if we are not careful.
|
93
|
+
{ icon: "mstile-70x70.png", size: "70x70" }, # For Windows 8 / IE11.
|
94
|
+
{ icon: "mstile-144x144.png", size: "144x144" },
|
95
|
+
{ icon: "mstile-150x150.png", size: "150x150" },
|
96
|
+
{ icon: "mstile-310x310.png", size: "310x310" },
|
97
|
+
{ icon: "mstile-310x150.png", size: "310x150" }
|
93
98
|
]
|
94
99
|
```
|
95
100
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "favicon_maker"
|
2
|
+
require "pathname"
|
2
3
|
|
3
4
|
module Middleman
|
4
5
|
module FaviconMaker
|
@@ -25,25 +26,33 @@ module Middleman
|
|
25
26
|
options[:icons].each do |input_filename, icon_configs|
|
26
27
|
from input_filename do
|
27
28
|
icon_configs.each do |icon_config|
|
28
|
-
icon icon_config
|
29
|
+
icon icon_config[:icon], icon_config
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
32
33
|
|
33
34
|
each_icon do |filepath, template_filepath|
|
34
|
-
|
35
|
+
pathname = Pathname.new(filepath)
|
36
|
+
rel_path =
|
37
|
+
if pathname.absolute?
|
38
|
+
pathname.relative_path_from(Pathname.new(app.root)).to_s
|
39
|
+
else
|
40
|
+
filepath
|
41
|
+
end
|
42
|
+
builder.trigger(:create, nil, rel_path)
|
35
43
|
end
|
36
44
|
end
|
37
45
|
|
38
46
|
end
|
39
47
|
|
40
48
|
private
|
49
|
+
|
41
50
|
def source_path
|
42
|
-
File.join(app.root, app.
|
51
|
+
File.join(app.root, app.config.source)
|
43
52
|
end
|
44
53
|
|
45
54
|
def build_path
|
46
|
-
File.join(app.root, app.
|
55
|
+
File.join(app.root, app.config.build_dir)
|
47
56
|
end
|
48
57
|
end
|
49
58
|
end
|
@@ -19,6 +19,6 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
21
|
# Additional dependencies
|
22
|
-
gem.add_runtime_dependency 'middleman-core', '
|
22
|
+
gem.add_runtime_dependency 'middleman-core', '~> 4.0.beta'
|
23
23
|
gem.add_runtime_dependency 'favicon_maker', '~> 1.3'
|
24
24
|
end
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-favicon-maker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Follmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.beta
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.beta
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: favicon_maker
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.3'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.3'
|
41
41
|
description: Generate favicon files in various sizes from a base image in your Middleman
|
@@ -46,7 +46,7 @@ executables: []
|
|
46
46
|
extensions: []
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
|
-
- .gitignore
|
49
|
+
- ".gitignore"
|
50
50
|
- Gemfile
|
51
51
|
- LICENSE
|
52
52
|
- README.md
|
@@ -66,17 +66,17 @@ require_paths:
|
|
66
66
|
- lib
|
67
67
|
required_ruby_version: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
|
-
- -
|
69
|
+
- - ">="
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ">"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
76
|
+
version: 1.3.1
|
77
77
|
requirements: []
|
78
78
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.
|
79
|
+
rubygems_version: 2.4.5
|
80
80
|
signing_key:
|
81
81
|
specification_version: 4
|
82
82
|
summary: Generate favicon files in various sizes from a base image in your Middleman
|