jekyll-heroicons 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f9892ee0260b9ee330b410ed33a452cb7ca59619e2eb4545f3c769bcaa28a84
4
- data.tar.gz: 10675f3ab7d06b9a2f877a56b7fca7fe605b992f7b88cf072014cafe60611a4a
3
+ metadata.gz: 1ea6e91e6cb36a520dca76e702ba049bace4d58ca10d9b4e052835d0326c0152
4
+ data.tar.gz: 2920e68dfc8f15f74915288bce410bd3ef9dd8cdfb02a3db977c9ef565f59846
5
5
  SHA512:
6
- metadata.gz: 00f81defdf20e8393da9bf39347cd4a9cc083a4b4246201d8e910d0ba85d7565c6a11ba45b7346de9dc1a30f89f6481257661467385ac6b34d36e1e98a11761d
7
- data.tar.gz: f280231e9dd755e81c3929f0e2338505dcb0e1c7d0c6ba0b1ed6f606a71eb84b0591ceb4647d8119ab9b437b8402928ca17f06a5ba6456261b6cc9229cbf9e72
6
+ metadata.gz: f9903507c9e0ebb0ec11078792689b8f3aa82544583000934e066bb254e059cfe0595e067cf58303b1540e167d857f9004c632e79ca84f5cccc2dadfeea7d372
7
+ data.tar.gz: 8cf3485c9eea35f1b84fd1d103ae14e3b259c5acb2d609ecd33cfc4ff5a4bc89a18217f5da8ecd7d150b3d5c70fc54298dc33bbaac50613e6346ff03640b742a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Jekyll-Heroicons
2
2
 
3
+ ## 0.4.0
4
+ - Add default variant as solid.
5
+ - Adding "disable_default_class" attribute to a tag, to avoid adding default classes to the icon.
3
6
  ## 0.3.1
4
7
  - Fix Site.configuration retrieval.
5
8
  ## 0.3.0
data/README.md CHANGED
@@ -25,7 +25,34 @@ This is heavily inspired by https://github.com/jclusso/heroicons
25
25
  ```
26
26
 
27
27
  ## Usage
28
- Configure default settings in `_config.yml`:
28
+ ```liquid
29
+ {% heroicon bell %}
30
+ ```
31
+ Heroicons comes in 4 variants: `solid`, `outline`, `mini`, and `micro`. The default variant is `solid`.
32
+ This can be changed through configuration in `_config.yml`:
33
+
34
+ ```ruby
35
+ heroicons:
36
+ variant: 'solid'
37
+ ```
38
+
39
+ Another way to provide variant and override defaults defined in config is to pass 'variant' to liquid tag:
40
+ ```liquid
41
+ {% heroicon bell variant: "mini" %}
42
+ ```
43
+
44
+ It's also possible to provide classes to the icon:
45
+ ```liquid
46
+ {% heroicon bell class: "text-red-500" %}
47
+ ```
48
+
49
+ Any other attributes will be passed to the SVG tag as well. As example:
50
+
51
+ ```liquid
52
+ {% heroicon bell class: "text-red-500" aria-hidden: true height:32 aria-label:hi %}
53
+ ```
54
+ ## Configuration
55
+ Besides variants, it's also possible to define default classes for each variant. Here is a recommended default configuration for `_config.yml`:
29
56
 
30
57
  ```ruby
31
58
  heroicons:
@@ -38,17 +65,10 @@ heroicons:
38
65
  }
39
66
  ```
40
67
 
41
- And then you can use:
42
-
43
- ```liquid
44
- {% heroicon bell class:"right left" %}
45
- ```
68
+ This default class will be applied to every icon. You can disable this on a per-icon basis by passing `disable_default_class: true`.
46
69
 
47
- Another way to provide variant would be like so:
48
70
  ```liquid
49
- {% heroicon solid/bell class:"right left"%}
50
- # or
51
- {% heroicon bell variant: "solid" class:"right left"%}
71
+ {% heroicon bell disable_default_class: true %}
52
72
  ```
53
73
 
54
74
  ## Development
@@ -5,6 +5,6 @@ module Liquid; class Tag; end; end
5
5
 
6
6
  module Jekyll
7
7
  class Heroicons < Liquid::Tag
8
- VERSION = "0.3.1"
8
+ VERSION = "0.4.0"
9
9
  end
10
10
  end
@@ -38,7 +38,7 @@ module Jekyll
38
38
 
39
39
  return nil if @symbol.nil?
40
40
 
41
- Icon.new(@symbol, @variant, @options.except(:variant)).raw
41
+ Icon.new(@symbol, @variant, @options.except(:variant, :disable_default_class)).raw
42
42
  end
43
43
 
44
44
  private
@@ -59,16 +59,17 @@ module Jekyll
59
59
  end
60
60
 
61
61
  def variant(markup)
62
- if (match = markup.split("/")).length > 1
63
- match.first
64
- elsif @options.key?(:variant)
62
+ if @options.key?(:variant)
65
63
  @options[:variant]
66
- else
64
+ elsif config["variant"]
67
65
  config["variant"]
66
+ else
67
+ "solid"
68
68
  end
69
69
  end
70
70
 
71
71
  def prepend_default_classes
72
+ return if @options[:disable_default_class].eql?('true')
72
73
  return unless config.dig("default_class", @variant)
73
74
 
74
75
  if @options[:class]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-heroicons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislav (Stas) Katkov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-24 00:00:00.000000000 Z
11
+ date: 2024-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll