jekyll-favicon 1.0.0.pre.2 → 1.0.0.pre.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.devcontainer/Dockerfile +3 -1
- data/CHANGELOG.md +4 -0
- data/README.md +5 -4
- data/config/jekyll/favicon.yml +9 -9
- data/config/jekyll/favicon/static_file/convertible.yml +5 -6
- data/lib/jekyll/favicon/static_file/convertible.rb +18 -10
- data/lib/jekyll/favicon/static_graphic_file.rb +1 -1
- data/lib/jekyll/favicon/utils.rb +5 -0
- data/lib/jekyll/favicon/utils/convert.rb +1 -1
- data/lib/jekyll/favicon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2143f5ca47523996edd21924f528455195a44924ce70ff0769bff1a1945c5e1d
|
4
|
+
data.tar.gz: b51d9acfbad24d42d244a0e2d0cf992eb2f1c3e22742228887a1da08893d1444
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eeb8f081b15aba2072554ced2a44838b59405aa6e4c1cd56e4cb605bf98eda5a27cd54c78d2ebeaebdb4f8bd03b18da10558f76a2a9c6c37b88a31faf309a820
|
7
|
+
data.tar.gz: 0203d4422b676347b4d398735201dc38b238113176e8d8f80af8e86acee013d13bea905070d79e6154ece2dec095583b33b9e8fc8d26f3dad544ad589ffe9bc9
|
data/.devcontainer/Dockerfile
CHANGED
@@ -11,7 +11,9 @@ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/l
|
|
11
11
|
|
12
12
|
# [Optional] Uncomment this section to install additional OS packages.
|
13
13
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
14
|
-
&& apt-get -y install
|
14
|
+
&& apt-get -y install librsvg2-bin
|
15
|
+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
16
|
+
&& apt-get -y install imagemagick
|
15
17
|
|
16
18
|
# [Optional] Uncomment this line to install additional gems.
|
17
19
|
RUN gem install reek standard webrick
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.0.0.pre.3] - 2021-06-12
|
10
|
+
### Fixed
|
11
|
+
- fix SVG to PNG quality
|
12
|
+
|
9
13
|
## [1.0.0.pre.2] - 2021-06-11
|
10
14
|
### Fixed
|
11
15
|
- mime time error when starting new project
|
data/README.md
CHANGED
@@ -27,6 +27,8 @@ If you have a [problem converting SVG files](https://github.com/afaundez/jekyll-
|
|
27
27
|
sudo apt install librsvg2-bin
|
28
28
|
```
|
29
29
|
|
30
|
+
You may need to install ImageMagick after installing the RSVG renderer.
|
31
|
+
|
30
32
|
Check the devcontainer's [Dockerfile](.devcontainer/Dockerfile) for more practical details.
|
31
33
|
|
32
34
|
## Installation
|
@@ -34,7 +36,7 @@ Check the devcontainer's [Dockerfile](.devcontainer/Dockerfile) for more practic
|
|
34
36
|
Add this line to your application's Gemfile:
|
35
37
|
|
36
38
|
```ruby
|
37
|
-
gem 'jekyll-favicon', '~> 1.0.0.pre.
|
39
|
+
gem 'jekyll-favicon', '~> 1.0.0.pre.3', group: :jekyll_plugins
|
38
40
|
```
|
39
41
|
|
40
42
|
## Usage
|
@@ -116,12 +118,11 @@ The convert configuration is specific for each type of convertion: SVG to ICO/PN
|
|
116
118
|
|----------------|---------------|-------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
|
117
119
|
| alpha | string | see [convert config](config/jekyll/favicon/static_file/convertible.yml) | see [imagemagick alpha docs](https://imagemagick.org/script/command-line-options.php#alpha) |
|
118
120
|
| background | string/symbol | see [convert config](config/jekyll/favicon/static_file/convertible.yml) | see [imagemagick background docs](https://imagemagick.org/script/command-line-options.php#background) |
|
119
|
-
| define | string/symbol | see [convert config](config/jekyll/favicon/static_file/convertible.yml) | see [imagemagick define docs](https://imagemagick.org/script/command-line-options.php#define) |
|
120
|
-
| density | string/symbol | see [convert config](config/jekyll/favicon/static_file/convertible.yml) | see [imagemagick density docs](https://imagemagick.org/script/command-line-options.php#density) |
|
121
|
+
| define | string/symbol | see [convert config](config/jekyll/favicon/static_file/convertible.yml) | see [imagemagick define docs](https://imagemagick.org/script/command-line-options.php#define) | |
|
121
122
|
| extent | string/symbol | see [convert config](config/jekyll/favicon/static_file/convertible.yml) | see [imagemagick extent docs](https://imagemagick.org/script/command-line-options.php#extent) |
|
122
123
|
| gravity | string | see [convert config](config/jekyll/favicon/static_file/convertible.yml) | see [imagemagick gravity docs](https://imagemagick.org/script/command-line-options.php#gravity) |
|
123
124
|
| resize | string | see [convert config](config/jekyll/favicon/static_file/convertible.yml) | see [imagemagick resize docs](https://imagemagick.org/script/command-line-options.php#resize) |
|
124
|
-
|
|
125
|
+
| size | string | see [convert config](config/jekyll/favicon/static_file/convertible.yml) | see [imagemagick size docs](https://imagemagick.org/script/command-line-options.php#size) |
|
125
126
|
|
126
127
|
Symbol values:
|
127
128
|
|
data/config/jekyll/favicon.yml
CHANGED
@@ -8,7 +8,7 @@ assets:
|
|
8
8
|
- name: favicon.ico
|
9
9
|
convert:
|
10
10
|
define: 'icon:auto-resize=36,24,16'
|
11
|
-
|
11
|
+
resize: 36x36
|
12
12
|
tag:
|
13
13
|
- link:
|
14
14
|
href: :href
|
@@ -17,7 +17,7 @@ assets:
|
|
17
17
|
sizes: :sizes
|
18
18
|
- name: favicon.png
|
19
19
|
convert:
|
20
|
-
|
20
|
+
resize: 196x196
|
21
21
|
tag:
|
22
22
|
- link:
|
23
23
|
href: :href
|
@@ -26,7 +26,7 @@ assets:
|
|
26
26
|
sizes: :sizes
|
27
27
|
- name: apple-touch-icon.png
|
28
28
|
convert:
|
29
|
-
|
29
|
+
resize: 180x180
|
30
30
|
- name: safari-pinned-tab.svg
|
31
31
|
tag:
|
32
32
|
- link:
|
@@ -35,21 +35,21 @@ assets:
|
|
35
35
|
rel: mask-icon
|
36
36
|
- name: android-chrome-192x192.png
|
37
37
|
convert:
|
38
|
-
|
38
|
+
resize: 192x192
|
39
39
|
refer:
|
40
40
|
- webmanifest:
|
41
41
|
icons:
|
42
42
|
- src: :href
|
43
43
|
- name: android-chrome-512x512.png
|
44
44
|
convert:
|
45
|
-
|
45
|
+
resize: 512x512
|
46
46
|
refer:
|
47
47
|
- webmanifest:
|
48
48
|
icons:
|
49
49
|
- src: :href
|
50
50
|
- name: mstile-icon-128x128.png
|
51
51
|
convert:
|
52
|
-
|
52
|
+
resize: 128x128
|
53
53
|
refer:
|
54
54
|
- browserconfig:
|
55
55
|
msapplication:
|
@@ -68,7 +68,7 @@ assets:
|
|
68
68
|
|
69
69
|
- name: mstile-icon-270x270.png
|
70
70
|
convert:
|
71
|
-
|
71
|
+
resize: 270x270
|
72
72
|
refer:
|
73
73
|
- browserconfig:
|
74
74
|
msapplication:
|
@@ -79,7 +79,7 @@ assets:
|
|
79
79
|
_src: :href
|
80
80
|
- name: mstile-icon-558x270.png
|
81
81
|
convert:
|
82
|
-
|
82
|
+
resize: 558x270
|
83
83
|
refer:
|
84
84
|
- browserconfig:
|
85
85
|
msapplication:
|
@@ -90,7 +90,7 @@ assets:
|
|
90
90
|
_src: :href
|
91
91
|
- name: mstile-icon-558x558.png
|
92
92
|
convert:
|
93
|
-
|
93
|
+
resize: 558x558
|
94
94
|
refer:
|
95
95
|
- browserconfig:
|
96
96
|
msapplication:
|
@@ -3,27 +3,26 @@ defaults: &defaults
|
|
3
3
|
alpha: null
|
4
4
|
background: null
|
5
5
|
define: null
|
6
|
-
density: null
|
7
6
|
extent: null
|
8
7
|
gravity: null
|
9
8
|
resize: null
|
10
|
-
|
9
|
+
size: null
|
11
10
|
.svg:
|
12
11
|
.png:
|
13
12
|
<<: *defaults
|
14
13
|
background: :background
|
15
|
-
density: :max
|
16
14
|
extent: :auto
|
17
15
|
gravity: center
|
18
|
-
|
16
|
+
resize:
|
17
|
+
size: :auto
|
19
18
|
.ico:
|
20
19
|
<<: *defaults
|
21
20
|
background: :background
|
22
21
|
define:
|
23
|
-
density: :max
|
24
22
|
extent: :auto
|
25
23
|
gravity: center
|
26
|
-
|
24
|
+
resize:
|
25
|
+
size: :auto
|
27
26
|
.svg:
|
28
27
|
<<: *defaults
|
29
28
|
.png:
|
@@ -30,11 +30,22 @@ module Jekyll
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
+
def convert_odd_source?
|
34
|
+
img = MiniMagick::Image.open path
|
35
|
+
Utils.odd? img.dimensions
|
36
|
+
end
|
37
|
+
|
38
|
+
def convert_size(size, separator = "x")
|
39
|
+
return size unless convert_odd_source? || Utils.odd?(size)
|
40
|
+
min_dimension = size.split(separator).min
|
41
|
+
[min_dimension, min_dimension].join(separator)
|
42
|
+
end
|
43
|
+
|
33
44
|
def sizes
|
34
45
|
if (match = Utils.name_to_size(name)) then [match[1]]
|
35
46
|
elsif (define = Utils.define_to_size(convert_spec["define"])) then define
|
36
47
|
elsif (resize = convert_spec["resize"]) then [resize]
|
37
|
-
elsif (
|
48
|
+
elsif (size = convert_spec["size"]) then [size]
|
38
49
|
end
|
39
50
|
end
|
40
51
|
|
@@ -88,20 +99,17 @@ module Jekyll
|
|
88
99
|
end
|
89
100
|
|
90
101
|
def convert_patch_options(options)
|
91
|
-
%w[
|
102
|
+
%w[size extent].each_with_object(options) do |name, memo|
|
92
103
|
method = "convert_patch_option_#{name}".to_sym
|
93
104
|
memo[name] = send(method, options[name])
|
94
105
|
end
|
95
106
|
end
|
96
107
|
|
97
|
-
def
|
98
|
-
case
|
99
|
-
when :
|
100
|
-
|
101
|
-
|
102
|
-
.max
|
103
|
-
length * 3
|
104
|
-
else density
|
108
|
+
def convert_patch_option_size(size)
|
109
|
+
case size
|
110
|
+
when :auto
|
111
|
+
convert_size size if (size = sizes.first)
|
112
|
+
else size
|
105
113
|
end
|
106
114
|
end
|
107
115
|
|
data/lib/jekyll/favicon/utils.rb
CHANGED
@@ -18,7 +18,7 @@ module Jekyll
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.convert_options(convert, options = {})
|
21
|
-
priorities = %w[resize
|
21
|
+
priorities = %w[resize size]
|
22
22
|
convert_apply convert, options.slice(*priorities)
|
23
23
|
common_options = options.reject { |key| priorities.include? key }
|
24
24
|
convert_apply convert, common_options
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-favicon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.
|
4
|
+
version: 1.0.0.pre.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alvaro Faundez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|