jekyll-favicon 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +17 -2
- data/jekyll-favicon.gemspec +2 -0
- data/lib/jekyll/favicon/generator.rb +14 -6
- data/lib/jekyll/favicon/hooks.rb +7 -0
- data/lib/jekyll/favicon/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 590c0b3dfe2a0579884c97e48080e958346a04f5
|
4
|
+
data.tar.gz: e9e13583226995f28b563ee29eabf400be6c22a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96c9a2c68d1ce1694aac86706f5f71f1d79cb8a25f6a88f6068b25db4db8154fed07878b59582c7daef905467d5e78082bd86265e3d5fd3c887ad1af7af185f7
|
7
|
+
data.tar.gz: 2e7cba7d7c95a6d3cd968687488c9a9871fde455ff5e8165134b55752a3789d1febb18d76b8602664a2c08eac7bb3adc052439ea20d981131959e78f03798719
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,14 +9,29 @@ This [Jekyll](https://jekyllrb.com) plugin adds:
|
|
9
9
|
- a [browser configuration schema](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426%28v=vs.85%29)
|
10
10
|
- a tag to generate all the corresponding links and metadata needed in the head tag
|
11
11
|
|
12
|
-
|
12
|
+
|
13
|
+
|
14
|
+
## Prerequisites
|
15
|
+
|
16
|
+
Before using this plugin your system must have installed [ImageMagick](http://www.imagemagick.org) (or [GraphicsMagick](http://www.graphicsmagick.org/)).
|
17
|
+
|
18
|
+
Check if it is already installed by running:
|
19
|
+
|
20
|
+
```sh
|
21
|
+
$ convert --version
|
22
|
+
Version: ImageMagick 7.0.7-27 Q16 x86_64 2018-03-18 http://www.imagemagick.org
|
23
|
+
Copyright: © 1999-2018 ImageMagick Studio LLC
|
24
|
+
License: http://www.imagemagick.org/script/license.php
|
25
|
+
Features: Cipher DPC HDRI Modules
|
26
|
+
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
|
27
|
+
```
|
13
28
|
|
14
29
|
## Installation
|
15
30
|
|
16
31
|
Add this line to your application's Gemfile:
|
17
32
|
|
18
33
|
```ruby
|
19
|
-
gem 'jekyll-favicon', '~> 0.2.
|
34
|
+
gem 'jekyll-favicon', '~> 0.2.2', group: :jekyll_plugins
|
20
35
|
```
|
21
36
|
|
22
37
|
## Usage
|
data/jekyll-favicon.gemspec
CHANGED
@@ -22,6 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
|
+
spec.required_ruby_version = '>= 2.1.0'
|
26
|
+
|
25
27
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
26
28
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
27
29
|
spec.add_development_dependency 'rake', '~> 10.0'
|
@@ -4,10 +4,13 @@ module Jekyll
|
|
4
4
|
class Generator < Jekyll::Generator
|
5
5
|
priority :high
|
6
6
|
|
7
|
+
attr_accessor :template
|
8
|
+
|
7
9
|
def generate(site)
|
8
10
|
@site = site
|
9
11
|
if File.exist? favicon_source
|
10
|
-
|
12
|
+
@template = favicon_tempfile
|
13
|
+
generate_files Favicon.config['path']
|
11
14
|
else
|
12
15
|
Jekyll.logger.warn 'Jekyll::Favicon: Missing' \
|
13
16
|
" #{Favicon.config['source']}, not generating" \
|
@@ -15,12 +18,17 @@ module Jekyll
|
|
15
18
|
end
|
16
19
|
end
|
17
20
|
|
21
|
+
def clean
|
22
|
+
return unless @tempfile
|
23
|
+
@template.close
|
24
|
+
@template.unlink
|
25
|
+
end
|
26
|
+
|
18
27
|
private
|
19
28
|
|
20
|
-
def generate_files(
|
21
|
-
|
22
|
-
|
23
|
-
generate_png_from favicon_template.path, prefix, sizes
|
29
|
+
def generate_files(prefix)
|
30
|
+
generate_ico_from @template.path
|
31
|
+
generate_png_from @template.path, prefix
|
24
32
|
if File.extname(favicon_source) == '.svg'
|
25
33
|
generate_svg_from favicon_source, prefix,
|
26
34
|
'safari-pinned-tab.svg'
|
@@ -34,7 +42,7 @@ module Jekyll
|
|
34
42
|
@site.static_files << ico_favicon
|
35
43
|
end
|
36
44
|
|
37
|
-
def generate_png_from(source, prefix
|
45
|
+
def generate_png_from(source, prefix)
|
38
46
|
['classic', 'ie', 'chrome', 'apple-touch-icon'].each do |template|
|
39
47
|
Favicon.config[template]['sizes'].each do |size|
|
40
48
|
png_favicon = Icon.new(@site, prefix, "favicon-#{size}.png", source)
|
data/lib/jekyll/favicon/hooks.rb
CHANGED
@@ -2,3 +2,10 @@ Jekyll::Hooks.register :site, :after_init do |site|
|
|
2
2
|
Jekyll::Favicon.merge site.config['favicon']
|
3
3
|
site.config['exclude'] << Jekyll::Favicon.config['source']
|
4
4
|
end
|
5
|
+
|
6
|
+
Jekyll::Hooks.register :site, :post_write do |site|
|
7
|
+
favicon_generators = site.generators.select do |generator|
|
8
|
+
generator.is_a? Jekyll::Favicon::Generator
|
9
|
+
end
|
10
|
+
favicon_generators.each(&:clean)
|
11
|
+
end
|
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: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alvaro Faundez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -148,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
148
|
requirements:
|
149
149
|
- - ">="
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
151
|
+
version: 2.1.0
|
152
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
153
|
requirements:
|
154
154
|
- - ">="
|
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
version: '0'
|
157
157
|
requirements: []
|
158
158
|
rubyforge_project:
|
159
|
-
rubygems_version: 2.2.
|
159
|
+
rubygems_version: 2.2.0
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
162
|
summary: Jekyll plugin for favicon tag generation.
|