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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed609eeb1532e8a059e7ef24393b922d654ff2d5f895effbce097d6c4c16bd68
4
- data.tar.gz: 992f2ede1c31b3e822fb51106f32dbcc44e8cb36675593e91e159d5aba80e570
3
+ metadata.gz: '0449f6e35b1890f8779b393c75422d234d73768713e5eade37196bc752e0435f'
4
+ data.tar.gz: e7176bc5a6afbfa4a065fca90f1b1b9b57778d07bc6d2fdca818b99328eea3bd
5
5
  SHA512:
6
- metadata.gz: dad0f1a877c55b0e9ad78f86577a63884e6cc78bf534bf8fa095a4fd8c5a2937ba8da7401b3ca1da0831e2df5b36498c4853be4b3f8ec70b0a1da27414d2b3f3
7
- data.tar.gz: a2cf454b59cb3f77945501ab578a7b84f5579581536d41536f4df2e35ddaafad81a09f0b75d2fa2aa8ddaafd52dcac160b109246ca46034f1b26777864229b63
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
- USe this simple Jekyll plugin that generates common favicon formats from SVG files with ImageMagick.
4
+ Use this simple Jekyll plugin that generates common favicon formats from SVG files with ImageMagick.
5
5
 
6
- Define an `icon` and/or `apple_touch_icon` in your `_config.yml` to enable auto generation.
6
+ #### 1. To enable, add the plugin into your Gemfile:
7
7
 
8
- icon: favicon.svg
9
- apple_touch_icon: apple-touch-icon.svg
8
+ ```ruby
9
+ group :jekyll_plugins do
10
+ gem 'jekyll-generate-favicons'
11
+ end
12
+ ```
10
13
 
11
- Will search directly for the file or look it up in `assets/img`
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
- Include the generated files with a `favicons` tag in your html `<head>`:
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
 
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module GenerateFavicons
3
- VERSION = "0.0.2".freeze
3
+ VERSION = "0.0.3".freeze
4
4
  end
5
5
  end
@@ -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.2
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-24 00:00:00.000000000 Z
11
+ date: 2025-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll