jekyll-generate-favicons 0.0.2 → 0.0.3
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/README.md +28 -6
- data/lib/jekyll-generate-favicons/version.rb +1 -1
- data/lib/jekyll-generate-favicons.rb +10 -0
- 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: '0449f6e35b1890f8779b393c75422d234d73768713e5eade37196bc752e0435f'
|
4
|
+
data.tar.gz: e7176bc5a6afbfa4a065fca90f1b1b9b57778d07bc6d2fdca818b99328eea3bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad9df4ee28755fd049f2ae46a1282a248d71aa8234d06c71227f68442ddd71a840841f0fa7f5ec37ac5fb4efb5e4a6e7236f70ff73e86ca528a4436cca8ebdc5
|
7
|
+
data.tar.gz: 5a833a107ad29a316d011315e1088d9c9ec958a0403ddf42c3397129e02745b71e313f07aeff2e3490170022fb80087d59d65af1519d92ee8be36fc4406fc408
|
data/README.md
CHANGED
@@ -1,16 +1,38 @@
|
|
1
1
|
# Jekyll Generate Favicons
|
2
2
|
|
3
3
|
Want to keep your repository free from unnecessary amounts of assets?
|
4
|
-
|
4
|
+
Use this simple Jekyll plugin that generates common favicon formats from SVG files with ImageMagick.
|
5
5
|
|
6
|
-
|
6
|
+
#### 1. To enable, add the plugin into your Gemfile:
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
```ruby
|
9
|
+
group :jekyll_plugins do
|
10
|
+
gem 'jekyll-generate-favicons'
|
11
|
+
end
|
12
|
+
```
|
10
13
|
|
11
|
-
|
14
|
+
Putting the Gem in the `jekyll_plugins` group will directly enable it in Jekyll. If it is not working (e.g., in safe mode), you might have to add it also in your `_config.yml` file:
|
12
15
|
|
13
|
-
|
16
|
+
```yaml
|
17
|
+
plugins:
|
18
|
+
- jekyll-generate-favicons
|
19
|
+
```
|
20
|
+
|
21
|
+
#### 2. Define an `icon` and/or `apple_touch_icon` in your `_config.yml` to enable auto generation.
|
22
|
+
|
23
|
+
```yaml
|
24
|
+
icon: favicon.svg
|
25
|
+
apple_touch_icon: apple-touch-icon.svg
|
26
|
+
apple_mask_icon:
|
27
|
+
src: apple-mask-icon.svg
|
28
|
+
color: black
|
29
|
+
```
|
30
|
+
|
31
|
+
The plugin will search directly for the file or look it up under `assets/img`
|
32
|
+
|
33
|
+
`apple_mask_icon` will not transform the svg but only insert the reflected link the head. See [Apple Guidelines](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/pinnedTabs/pinnedTabs.html) for details.
|
34
|
+
|
35
|
+
#### 3. Include the generated files with a `favicons` tag in your html `<head>`:
|
14
36
|
|
15
37
|
{% favicons %}
|
16
38
|
|
@@ -34,7 +34,17 @@ module Jekyll
|
|
34
34
|
s << "<link rel=\"apple-touch-icon\" sizes=\"#{size}x#{size}\" href=\"#{site.baseurl}/assets/img/favicons/apple-touch-icon-#{size}.png\">\n"
|
35
35
|
}
|
36
36
|
end
|
37
|
+
apple_mask_icon = site.config["apple_mask_icon"]
|
38
|
+
if apple_mask_icon
|
39
|
+
mask_src = apple_mask_icon["src"]
|
40
|
+
mask_color = apple_mask_icon["color"]
|
41
|
+
mask_color = "black" unless mask_color
|
37
42
|
|
43
|
+
mask_src = apple_mask_icon unless mask_src
|
44
|
+
|
45
|
+
icon_path, _ = Jekyll::GenerateFavicons::find_icon_file(site, mask_src)
|
46
|
+
s << "<link rel=\"mask-icon\" href=\"#{baseurl}/#{icon_path}\" color=\"#{mask_color}\">"
|
47
|
+
end
|
38
48
|
s.string
|
39
49
|
end
|
40
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-generate-favicons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Sosnowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|