jekyll-heroicons 0.4.0 → 0.4.2

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: 1ea6e91e6cb36a520dca76e702ba049bace4d58ca10d9b4e052835d0326c0152
4
- data.tar.gz: 2920e68dfc8f15f74915288bce410bd3ef9dd8cdfb02a3db977c9ef565f59846
3
+ metadata.gz: aaacd8df25bd57a8be6b0dd2ae3b3f7aa50370507c64f792b93422d15dd99c02
4
+ data.tar.gz: 888790e9235e7cf2a779df4236938a65f04806e5c2bf469351257061438bb72d
5
5
  SHA512:
6
- metadata.gz: f9903507c9e0ebb0ec11078792689b8f3aa82544583000934e066bb254e059cfe0595e067cf58303b1540e167d857f9004c632e79ca84f5cccc2dadfeea7d372
7
- data.tar.gz: 8cf3485c9eea35f1b84fd1d103ae14e3b259c5acb2d609ecd33cfc4ff5a4bc89a18217f5da8ecd7d150b3d5c70fc54298dc33bbaac50613e6346ff03640b742a
6
+ metadata.gz: e89e45a4c265c9362dc1dc92878977b7af18ffb398941bd173b2cf1d61004ca0aeb34289f44bbb295cc562b19f69481443e6309e52cc394194c59210f62e1732
7
+ data.tar.gz: f415b568b48d2a0936b7e5d2d4cd366cc60f56b5d3073433eae4e760f3c24c3d1bfc3be19ff5b3e94fe3ca773940392c5523668465a375d677a501f1aab5bbae
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Jekyll-Heroicons
2
2
 
3
+ ## 0.4.2
4
+ ### Fixed
5
+ - "variant" method will not error out if configuration is missing, will use DEFAULT_VARIANT instead.
6
+
7
+ ## 0.4.1
8
+ ### Changed
9
+ - Don't reload configuration on every change
10
+ - Improve comments and code around picking default variants.
11
+
3
12
  ## 0.4.0
4
13
  - Add default variant as solid.
5
14
  - Adding "disable_default_class" attribute to a tag, to avoid adding default classes to the icon.
data/README.md CHANGED
@@ -10,6 +10,8 @@ This gem has no official affiliation with Tailwind CSS or the Heroicons team. Ch
10
10
 
11
11
  This is heavily inspired by https://github.com/jclusso/heroicons
12
12
 
13
+ If you are looking to build a Jekyll website with Tailwind and no-build, take a look at [Jekyll CLI Template](https://github.com/skatkov/jekyll-tailwind-cli-template) that contains already this gem.
14
+
13
15
  ## Installation
14
16
 
15
17
  1. Add this to `Gemfile`:
@@ -79,7 +81,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
79
81
 
80
82
  ## Contributing
81
83
 
82
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jekyll-heroicons. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/jekyll-heroicons/blob/master/CODE_OF_CONDUCT.md).
84
+ Bug reports and pull requests are welcome on GitHub at https://github.com/skatkov/jekyll-heroicons. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/skatkov/jekyll-heroicons/blob/master/CODE_OF_CONDUCT.md).
83
85
 
84
86
  ## License
85
87
 
@@ -87,4 +89,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
87
89
 
88
90
  ## Code of Conduct
89
91
 
90
- Everyone interacting in the Jekyll::Heroicons project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/jekyll-heroicons/blob/master/CODE_OF_CONDUCT.md).
92
+ Everyone interacting in the Jekyll::Heroicons project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/skatkov/jekyll-heroicons/blob/master/CODE_OF_CONDUCT.md).
@@ -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.4.0"
8
+ VERSION = "0.4.2"
9
9
  end
10
10
  end
@@ -13,6 +13,9 @@ module Jekyll
13
13
  File.dirname(__dir__)
14
14
  end
15
15
 
16
+ # In case no variant is specified, use solid as default
17
+ DEFAULT_VARIANT = "solid"
18
+
16
19
  # Syntax for the heroicon symbol
17
20
  SYNTAX = /\A(#{Liquid::VariableSignature}+)/
18
21
 
@@ -44,7 +47,7 @@ module Jekyll
44
47
  private
45
48
 
46
49
  def config
47
- @config ||= begin
50
+ @@config ||= begin
48
51
  Jekyll.configuration.dig("heroicons")
49
52
  rescue NoMethodError
50
53
  {}
@@ -58,14 +61,9 @@ module Jekyll
58
61
  prepend_default_classes
59
62
  end
60
63
 
64
+ # This method checks if heroicons liquid tag has a variant specified. If not, it check default variant in the config file. If both of those are not defined, it falls back to the default variant.
61
65
  def variant(markup)
62
- if @options.key?(:variant)
63
- @options[:variant]
64
- elsif config["variant"]
65
- config["variant"]
66
- else
67
- "solid"
68
- end
66
+ @options&.dig(:variant) || config&.dig("variant") || DEFAULT_VARIANT
69
67
  end
70
68
 
71
69
  def prepend_default_classes
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-heroicons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislav (Stas) Katkov
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-09-25 00:00:00.000000000 Z
10
+ date: 2025-02-10 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: jekyll
@@ -1348,7 +1347,6 @@ licenses:
1348
1347
  metadata:
1349
1348
  homepage_uri: https://github.com/skatkov/jekyll-heroicons
1350
1349
  source_code_uri: https://github.com/skatkov/jekyll-heroicons
1351
- post_install_message:
1352
1350
  rdoc_options: []
1353
1351
  require_paths:
1354
1352
  - lib
@@ -1363,8 +1361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1363
1361
  - !ruby/object:Gem::Version
1364
1362
  version: '0'
1365
1363
  requirements: []
1366
- rubygems_version: 3.5.11
1367
- signing_key:
1364
+ rubygems_version: 3.6.3
1368
1365
  specification_version: 4
1369
1366
  summary: Jekyll liquid tags for Heroicons.
1370
1367
  test_files: []