checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
---
2
- SHA1:
3
- metadata.gz: 348c5ecbd6ff6959ef000b7ed5e303247c54ab62
4
- data.tar.gz: 3115c60efdc82f1d9963f7abdff6b250a1deaa79
2
+ SHA256:
3
+ metadata.gz: caf32655a87cfda4b33b8a7c71d9b88767a37f6586fc0daf264f46dec0d1720d
4
+ data.tar.gz: c7fa97ebcffd2808026f049efabbb5b80e2fcd20254d840e9825f3bdb943811c
5
5
SHA512:
6
- metadata.gz: 0e81924b776ed34b9d7b0772dd9052fb9ddfb1e53fae3865860a07661e031a3d86a229d6d08e2d68d760e576a5620d38f560c0255b1286b09c34feb99d1658a6
7
- data.tar.gz: bd14abae772e7a03abaa2223a6cc93bcac8bdc5f102b27848ead37adff996c0bff2b0ddbf6a06a4f1616d9e89839d28fa6c5cdf5878a1cc9e9753bf60ec346e5
6
+ metadata.gz: 5a8de79c35b12649cf20a8f83c706ca1447862a4271b1071216ceb830a7193cd998892ff82277ffc0f93d7932d325cef2841819414bfd5cc12e3f3bee9bc928d
7
+ data.tar.gz: a9b0a7bf04a3a13f28b42607cc83845900afb669f636842eff2d22aa7cf37861ec771397f1447cc144b1c72f6c54d5a90af1a26888498791873880b8b4e4f0ec
data/.github/ISSUE_TEMPLATE/bug_report.md ADDED
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+
5
+ ---
6
+
7
+ **Describe the bug**
8
+ A clear and concise description of what the bug is.
9
+
10
+ **To Reproduce**
11
+ Steps to reproduce the behavior:
12
+ 1. Go to '...'
13
+ 2. Click on '....'
14
+ 3. Scroll down to '....'
15
+ 4. See error
16
+
17
+ **Expected behavior**
18
+ A clear and concise description of what you expected to happen.
19
+
20
+ **Screenshots**
21
+ If applicable, add screenshots to help explain your problem.
22
+
23
+ **Desktop (please complete the following information):**
24
+ - OS: [e.g. iOS]
25
+ - Browser [e.g. chrome, safari]
26
+ - Version [e.g. 22]
27
+
28
+ **Smartphone (please complete the following information):**
29
+ - Device: [e.g. iPhone6]
30
+ - OS: [e.g. iOS8.1]
31
+ - Browser [e.g. stock browser, safari]
32
+ - Version [e.g. 22]
33
+
34
+ **Additional context**
35
+ Add any other context about the problem here.
data/.github/ISSUE_TEMPLATE/feature_request.md ADDED
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+
5
+ ---
6
+
7
+ **Is your feature request related to a problem? Please describe.**
8
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9
+
10
+ **Describe the solution you'd like**
11
+ A clear and concise description of what you want to happen.
12
+
13
+ **Describe alternatives you've considered**
14
+ A clear and concise description of any alternative solutions or features you've considered.
15
+
16
+ **Additional context**
17
+ Add any other context or screenshots about the feature request here.
data/.github/PULL_REQUEST_TEMPLATE.md ADDED
@@ -0,0 +1,14 @@
1
+ # PR Template
2
+
3
+ Include at least this concepts:
4
+
5
+ - Explain what you wanted to achieve
6
+
7
+ - Explain what you did
8
+
9
+ - use markdown
10
+ - include screenshots if helps to explain
11
+
12
+ - Explain how to test it
13
+
14
+ Thanks for contrubuting!
data/CHANGELOG.md ADDED
@@ -0,0 +1,46 @@
1
+ # Changelog
2
+ All notable changes to Jekyll-Favicon will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.2.3] - 2015-03-27
10
+ ### Added
11
+ - Changelog
12
+ - Contributing guide
13
+ - Issue and Pull Request templates
14
+ - Improve Readme usage
15
+
16
+ ### Fixed
17
+ - Missing baseurl in links from `favicon` tag
18
+
19
+ ## [0.2.2] - 2015-03-27
20
+ ### Fixed
21
+ - Missing png template
22
+
23
+ ## [0.2.1] - 2015-03-27
24
+ ### Fixed
25
+ - Jekyll gem version dependency
26
+
27
+ ## [0.2.0] - 2015-03-27
28
+ ### Added
29
+ - Jekyll generator with ImageMagick dependency
30
+ - Configuration file options
31
+ - Rubocop (and changes suggested by it)
32
+
33
+ ### Changed
34
+ - Templates structure
35
+
36
+ ## [0.1.2] - 2015-03-17
37
+ ### Fixed
38
+ - Fix gem version
39
+
40
+ ## [0.1.1] - 2015-03-17
41
+ ### Changed
42
+ - Replace heredoc for ruby >=2.1 compatibility
43
+
44
+ ## [0.1.0] - 2018-01-30
45
+ ### Added
46
+ - Jekyll tag `favicon`
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,5 @@
1
+ # Contributing to Jekyll Favicon
2
+
3
+ Want to contribute? Be polite and use words like hello and thanks.
4
+
5
+ Also check the [Code of Conduct](CODE_OF_CONDUCT.md).
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
PATH
2
2
remote: .
3
3
specs:
4
- jekyll-favicon (0.2.1)
4
+ jekyll-favicon (0.2.3)
5
5
jekyll (~> 3.0)
6
6
mini_magick (~> 4.5)
7
7
@@ -16,13 +16,13 @@ GEM
16
16
em-websocket (0.5.1)
17
17
eventmachine (>= 0.12.9)
18
18
http_parser.rb (~> 0.6.0)
19
- eventmachine (1.2.5)
20
- ffi (1.9.23)
19
+ eventmachine (1.2.7)
20
+ ffi (1.9.25)
21
21
forwardable-extended (2.6.0)
22
22
http_parser.rb (0.6.0)
23
23
i18n (0.9.5)
24
24
concurrent-ruby (~> 1.0)
25
- jekyll (3.7.3)
25
+ jekyll (3.8.3)
26
26
addressable (~> 2.4)
27
27
colorator (~> 1.0)
28
28
em-websocket (~> 0.5)
@@ -39,27 +39,30 @@ GEM
39
39
sass (~> 3.4)
40
40
jekyll-watch (2.0.0)
41
41
listen (~> 3.0)
42
- kramdown (1.16.2)
42
+ kramdown (1.17.0)
43
43
liquid (4.0.0)
44
44
listen (3.0.8)
45
45
rb-fsevent (~> 0.9, >= 0.9.4)
46
46
rb-inotify (~> 0.9, >= 0.9.7)
47
47
mercenary (0.3.6)
48
48
mini_magick (4.8.0)
49
+ mini_portile2 (2.3.0)
49
50
minitest (5.11.3)
51
+ nokogiri (1.8.4)
52
+ mini_portile2 (~> 2.3.0)
50
53
parallel (1.12.1)
51
54
parser (2.5.0.5)
52
55
ast (~> 2.4.0)
53
56
pathutil (0.16.1)
54
57
forwardable-extended (~> 2.6)
55
58
powerpack (0.1.1)
56
- public_suffix (3.0.2)
59
+ public_suffix (3.0.3)
57
60
rainbow (3.0.0)
58
61
rake (10.5.0)
59
62
rb-fsevent (0.10.3)
60
63
rb-inotify (0.9.10)
61
64
ffi (>= 0.5.0, < 2)
62
- rouge (3.1.1)
65
+ rouge (3.2.1)
63
66
rubocop (0.54.0)
64
67
parallel (~> 1.10)
65
68
parser (>= 2.5)
@@ -69,7 +72,7 @@ GEM
69
72
unicode-display_width (~> 1.0, >= 1.0.1)
70
73
ruby-progressbar (1.9.0)
71
74
safe_yaml (1.0.4)
72
- sass (3.5.6)
75
+ sass (3.5.7)
73
76
sass-listen (~> 4.0.0)
74
77
sass-listen (4.0.0)
75
78
rb-fsevent (~> 0.9, >= 0.9.4)
@@ -83,6 +86,7 @@ DEPENDENCIES
83
86
bundler (~> 1.16)
84
87
jekyll-favicon!
85
88
minitest (~> 5.0)
89
+ nokogiri (~> 1.8)
86
90
rake (~> 10.0)
87
91
rubocop (~> 0.54.0, >= 0.54.0)
88
92
data/README.md CHANGED
@@ -9,19 +9,36 @@ 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
- Note: this project depends on [minimagick/minimagick](https://github.com/minimagick/minimagick/), which depends on [ImageMagick](https://imagemagick.org/) or [GraphicsMagick](http://www.graphicsmagick.org/).
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.1', group: :jekyll_plugins
34
+ gem 'jekyll-favicon', '~> 0.2.3', group: :jekyll_plugins
20
35
```
21
36
22
37
## Usage
23
38
24
- Note: this plugin does not work with the [github-pages](https://pages.github.com) build, but you can generate the site and push it.
39
+ If you are going to use this plugin in a hosted build/service, be sure that they include your plugins as part of the process. You can check [running example](https://afaundez.gitlab.io/jekyll-favicon-example/) hosted by [GitLab](https://about.gitlab.com/features/pages/).
40
+
41
+ As [Github Pages](https://pages.github.com) build doesn't load custom plugins, this plugin won't work. As an alternative, you can build your site and push all files (for example, build to `docs`, version it and push it, although this works only for project pages).
25
42
26
43
### Generator
27
44
data/jekyll-favicon.gemspec CHANGED
@@ -22,8 +22,11 @@ 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'
29
+ spec.add_development_dependency 'nokogiri', '~> 1.8'
27
30
spec.add_development_dependency 'rake', '~> 10.0'
28
31
spec.add_development_dependency 'rubocop', '~> 0.54.0', '>= 0.54.0'
29
32
data/lib/jekyll/favicon/generator.rb CHANGED
@@ -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
- generate_files Favicon.config['sizes'], Favicon.config['path']
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(sizes, prefix)
21
- favicon_template = favicon_tempfile
22
- generate_ico_from favicon_template.path
29
+ def generate_files(prefix)
30
+ generate_ico_from @template.path
31
+ generate_png_from @template.path, prefix
23
- generate_png_from favicon_template.path, prefix, sizes
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, sizes)
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
data/lib/jekyll/favicon/metadata.rb CHANGED
@@ -9,11 +9,10 @@ module Jekyll
9
9
@name = name
10
10
11
11
process @name
12
+ prepend_path = @site.baseurl || ''
12
13
template = File.read File.join Favicon.templates, "#{name}.erb"
13
14
self.content = ERB.new(template, nil, '-').result binding
14
- self.data = {}
15
+ self.data = { 'name' => name, 'layout' => nil }
15
- data['name'] = name
16
- data['layout'] = nil
17
16
end
18
17
end
19
18
end
data/lib/jekyll/favicon/tag.rb CHANGED
@@ -9,6 +9,7 @@ module Jekyll
9
9
10
10
def render(context)
11
11
site = context.registers[:site]
12
+ prepend_path = site.baseurl || ''
12
13
templates_dir = Favicon.templates
13
14
head = "<!-- Begin Jekyll Favicon tag v#{Favicon::VERSION} -->"
14
15
body = %w[classic safari chrome ie].collect do |template|
data/lib/jekyll/favicon/templates/browserconfig.xml.erb CHANGED
@@ -1,10 +1,11 @@
1
1
<browserconfig>
2
2
<msapplication>
3
3
<tile>
4
- <square310x310logo src="<%= File.join Favicon.config['path'], 'favicon-558x558.png' %>" />
5
- <wide310x150logo src="<%= File.join Favicon.config['path'], 'favicon-558x270.png' %>" />
6
- <square150x150logo src="<%= File.join Favicon.config['path'], 'favicon-270x270.png' %>" />
7
- <square70x70logo src="<%= File.join Favicon.config['path'], 'favicon-128x128.png' %>" />
4
+ <%- favicon_path = File.join prepend_path, Favicon.config['path'] -%>
5
+ <square310x310logo src="<%= File.join favicon_path, 'favicon-558x558.png' %>" />
6
+ <wide310x150logo src="<%= File.join favicon_path, 'favicon-558x270.png' %>" />
7
+ <square150x150logo src="<%= File.join favicon_path, 'favicon-270x270.png' %>" />
8
+ <square70x70logo src="<%= File.join favicon_path, 'favicon-128x128.png' %>" />
8
9
<TileColor><%= Favicon.config['ie']['tile-color'] %></TileColor>
9
10
</tile>
10
11
</msapplication>
data/lib/jekyll/favicon/templates/chrome.html.erb CHANGED
@@ -1,5 +1,5 @@
1
1
<!-- Chrome -->
2
2
<%- Favicon.config['chrome']['sizes'].each do |size| -%>
3
- <link rel="icon" sizes="<%= size %>" href="<%= File.join Favicon.config['path'], "favicon-#{size}.png" %>">
3
+ <link rel="icon" sizes="<%= size %>" href="<%= File.join prepend_path, Favicon.config['path'], "favicon-#{size}.png" %>">
4
4
<%- end -%>
5
- <link rel="manifest" href="<%= File.join Favicon.config['chrome']['manifest-path'], 'manifest.webmanifest' %>">
5
+ <link rel="manifest" href="<%= File.join prepend_path, Favicon.config['chrome']['manifest-path'], 'manifest.webmanifest' %>">
data/lib/jekyll/favicon/templates/classic.html.erb CHANGED
@@ -1,6 +1,7 @@
1
1
<!-- Classic -->
2
2
<link rel="shortcut icon" href="favicon.ico">
3
- <link rel="icon" sizes="<%= Favicon.config['ico']['sizes'].collect{|s| "#{s}x#{s}"}.join ' ' %>" href="<%= File.join Favicon.config['ico']['path'], 'favicon.ico' %>">
3
+ <%- favicon_path = File.join prepend_path, Favicon.config['path'] -%>
4
+ <link rel="icon" sizes="<%= Favicon.config['ico']['sizes'].collect{|s| "#{s}x#{s}"}.join ' ' %>" href="<%= File.join favicon_path, 'favicon.ico' %>">
4
5
<%- Favicon.config['classic']['sizes'].each do |size| -%>
5
- <link rel="icon" sizes="<%= size %>" type="image/png" href="<%= File.join Favicon.config['path'], "favicon-#{size}.png" %>">
6
+ <link rel="icon" sizes="<%= size %>" type="image/png" href="<%= File.join favicon_path, "favicon-#{size}.png" %>">
6
7
<%- end -%>
data/lib/jekyll/favicon/templates/ie.html.erb CHANGED
@@ -1,4 +1,4 @@
1
1
<!-- IE -->
2
2
<meta name="msapplication-TileColor" content="<%= Favicon.config['ie']['tile-color'] %>">
3
- <meta name="msapplication-TileImage" content="<%= File.join Favicon.config['path'], 'favicon-144x144.png' %>">
4
- <meta name="msapplication-config" content="<%= File.join Favicon.config['ie']['browserconfig-path'], 'browserconfig.xml' %>">
3
+ <meta name="msapplication-TileImage" content="<%= File.join prepend_path, Favicon.config['path'], 'favicon-144x144.png' %>">
4
+ <meta name="msapplication-config" content="<%= File.join prepend_path, Favicon.config['ie']['browserconfig-path'], 'browserconfig.xml' %>">
data/lib/jekyll/favicon/templates/manifest.webmanifest.erb CHANGED
@@ -1 +1 @@
1
- <%= JSON.pretty_generate icons: Favicon.config['chrome']['sizes'].collect{|size| {src: File.join(Favicon.config['path'], "favicon-#{size}.png"), type: 'png', sizes: size}} %>
1
+ <%= JSON.pretty_generate icons: Favicon.config['chrome']['sizes'].collect{|size| {src: File.join(prepend_path, Favicon.config['path'], "favicon-#{size}.png"), type: 'png', sizes: size}} %>
data/lib/jekyll/favicon/templates/safari.html.erb CHANGED
@@ -1,5 +1,6 @@
1
1
<!-- Safari -->
2
+ <%- favicon_path = File.join prepend_path, Favicon.config['path'] -%>
2
3
<%- Favicon.config['apple-touch-icon']['sizes'].each do |size| -%>
3
- <link rel="apple-touch-icon" sizes="<%= size %>" href="<%= File.join Favicon.config['path'], "favicon-#{size}.png" %>">
4
+ <link rel="apple-touch-icon" sizes="<%= size %>" href="<%= File.join favicon_path, "favicon-#{size}.png" %>">
4
5
<%- end -%>
5
- <link rel="mask-icon" color="<%= Favicon.config['safari-pinned-tab']['mask-icon-color'] %>" href="<%= File.join Favicon.config['path'], 'safari-pinned-tab.svg' %>">
6
+ <link rel="mask-icon" color="<%= Favicon.config['safari-pinned-tab']['mask-icon-color'] %>" href="<%= File.join favicon_path, 'safari-pinned-tab.svg' %>">
data/lib/jekyll/favicon/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
module Jekyll
2
2
module Favicon
3
- VERSION = '0.2.1'.freeze
3
+ VERSION = '0.2.3'.freeze
4
4
end
5
5
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.1
4
+ version: 0.2.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: 2018-03-27 00:00:00.000000000 Z
11
+ date: 2018-08-17 00:00:00.000000000 Z
12
12
dependencies:
13
13
- !ruby/object:Gem::Dependency
14
14
name: bundler
@@ -39,6 +39,20 @@ dependencies:
39
39
- !ruby/object:Gem::Version
40
40
version: '5.0'
41
41
- !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.8'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.8'
55
+ - !ruby/object:Gem::Dependency
42
56
name: rake
43
57
requirement: !ruby/object:Gem::Requirement
44
58
requirements:
@@ -108,10 +122,15 @@ executables: []
108
122
extensions: []
109
123
extra_rdoc_files: []
110
124
files:
125
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
126
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
127
+ - ".github/PULL_REQUEST_TEMPLATE.md"
111
128
- ".gitignore"
112
129
- ".rubocop.yml"
113
130
- ".travis.yml"
131
+ - CHANGELOG.md
114
132
- CODE_OF_CONDUCT.md
133
+ - CONTRIBUTING.md
115
134
- Gemfile
116
135
- Gemfile.lock
117
136
- LICENSE.txt
@@ -148,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
167
requirements:
149
168
- - ">="
150
169
- !ruby/object:Gem::Version
151
- version: '0'
170
+ version: 2.1.0
152
171
required_rubygems_version: !ruby/object:Gem::Requirement
153
172
requirements:
154
173
- - ">="
@@ -156,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
175
version: '0'
157
176
requirements: []
158
177
rubyforge_project:
159
- rubygems_version: 2.2.5
178
+ rubygems_version: 2.7.3
160
179
signing_key:
161
180
specification_version: 4
162
181
summary: Jekyll plugin for favicon tag generation.