jekyll-fontawesome-svg 0.1.0 → 0.1.1
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/Gemfile.lock +1 -1
- data/README.md +24 -8
- data/lib/jekyll/fontawesome/svg/fa-generator.rb +4 -7
- data/lib/jekyll/fontawesome/svg/version.rb +1 -1
- 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: 5686cb96e1696401e97e25099ad749f7b15fdc83383318379a2b62ecae62af41
|
4
|
+
data.tar.gz: 4cf23d7b7ca080730cff3c9780df73263de39057486600848b9efe8bb8ff05ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02d81849a201fe11f10d6f8fae8b9a97af2debbbbf3f8312e7f27e832504f136efcbd711c8057a07eddb65247f285952f769b1b60e3aa8b1aa157eb1f534a02d
|
7
|
+
data.tar.gz: d7f7539966ebd4cf0d121e182f00cc6ad065e2493817aeac469fae9ad41674ce8f37dd8d3b5843b3e424ddb14933faa4e583262a8b271e3496cb905828ca74c1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,28 @@
|
|
1
1
|
# Jekyll::Fontawesome::Svg
|
2
2
|
|
3
|
-
|
3
|
+
[](https://badge.fury.io/rb/jekyll-fontawesome-svg)
|
4
4
|
|
5
|
-
|
5
|
+
Use all of [FontAwesome Icons](http://fontawesome.com/) without the need to import the full css / svg.
|
6
|
+
|
7
|
+
This Jekyll plugin will look for the icon you include in your page and only include the icons you used.
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
- When you want to include an icon, you can use the same name as you will do to with FontAwesome
|
12
|
+
|
13
|
+
`{% fa_svg fab.fa-twitter %}`
|
14
|
+
|
15
|
+
Use the `fa_svg` liquid tag, with the type of the icon you want to use (`fab`, `fas` or `far`), a dot (**important**) and the icon name.
|
16
|
+
|
17
|
+
Each icon get the `icon` class, which you can use in your CSS to customize the appearance of your icon.
|
18
|
+
|
19
|
+
- You will need to have in **one** part of your project (at the end of your layout for example) liquid tag to generate the SVG definition.
|
20
|
+
|
21
|
+
The syntax is this one `{% fa_svg_generate %}`
|
22
|
+
|
23
|
+
### Examples
|
24
|
+
|
25
|
+
You can find an example on [my personnal site repository](https://github.com/sylvainmetayer/sylvainmetayer), more specifically [here](https://github.com/sylvainmetayer/sylvainmetayer/blob/feature/48-fa-module/_includes/icons.html) and [here](https://github.com/sylvainmetayer/sylvainmetayer/blob/feature/48-fa-module/_includes/social-links.html)
|
6
26
|
|
7
27
|
## Installation
|
8
28
|
|
@@ -20,10 +40,6 @@ Or install it yourself as:
|
|
20
40
|
|
21
41
|
$ gem install jekyll-fontawesome-svg
|
22
42
|
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
43
|
## Development
|
28
44
|
|
29
45
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -32,7 +48,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
48
|
|
33
49
|
## Contributing
|
34
50
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
51
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/sylvainmetayer/jekyll-fontawesome-svg. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
52
|
|
37
53
|
## License
|
38
54
|
|
@@ -40,4 +56,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
40
56
|
|
41
57
|
## Code of Conduct
|
42
58
|
|
43
|
-
Everyone interacting in the Jekyll::Fontawesome::Svg project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
59
|
+
Everyone interacting in the Jekyll::Fontawesome::Svg project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/sylvainmetayer/jekyll-fontawesome-svg/blob/master/CODE_OF_CONDUCT.md).
|
@@ -8,8 +8,7 @@ module Jekyll
|
|
8
8
|
def render(context)
|
9
9
|
output = nil
|
10
10
|
unless context.environments.first['page']['fa_svg'].nil?
|
11
|
-
output = '
|
12
|
-
<svg display="none" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
11
|
+
output = '<svg display="none" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
13
12
|
<defs>
|
14
13
|
<!--
|
15
14
|
Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com
|
@@ -17,15 +16,13 @@ module Jekyll
|
|
17
16
|
-->
|
18
17
|
'
|
19
18
|
|
20
|
-
context.environments.first['page']['fa_svg'].each do |icon|
|
19
|
+
context.environments.first['page']['fa_svg'].uniq.each do |icon|
|
21
20
|
fa_icon = FontAwesomeIcon.new(icon)
|
22
21
|
output += fa_icon.to_svg_html
|
23
22
|
end
|
24
23
|
|
25
|
-
output += '
|
26
|
-
|
27
|
-
</svg>
|
28
|
-
'
|
24
|
+
output += '</defs>
|
25
|
+
</svg>'
|
29
26
|
end
|
30
27
|
|
31
28
|
unless output.nil?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-fontawesome-svg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain METAYER
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|