jekyll-fa-icons 0.0.2
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 +7 -0
- data/.gitignore +11 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +36 -0
- data/Rakefile +1 -0
- data/jekyll-fa-icons.gemspec +23 -0
- data/lib/jekyll-fa-icons.rb +35 -0
- data/lib/jekyll-fa-icons/version.rb +5 -0
- metadata +93 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5160c32f64ed30e587d58c22ceefbe57e5ddb7ab1be4385a74e7e76dd1deee21
|
4
|
+
data.tar.gz: 389c2b171936d46f682f9ab86ffa7f505a516945ff48bd8456868b48877900ab
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d4d7a055f9d54889f07e953c9e2984c6b6f602485eba834d043724e5c4832c502f34ac606c2ffb5e9ac0851c7ad618646def13fcb35d3bd7493e6f755b62d0d9
|
7
|
+
data.tar.gz: 19132cabb89ed24a27e2e7912cbe95628dd2041e4e3d3bd5af84c84f24d6419b79e30f397b7bbd24c007483898fa4a00982b2324c5b07a01aaa9159d7b58ba46
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 baua.gonzo@gmail.com
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Jekyll Font Awesome Icons
|
2
|
+
|
3
|
+
This Jekyll pluging provides a tag that takes a [Font Awesome](https://fontawesome.com/)<i class="fab fa-font-awesome"></i> code and puts the according `<i>` tag.
|
4
|
+
|
5
|
+
It has been implemented to ease my life in decorating http://storage-chaos.io/
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
group :jekyll_plugins do
|
13
|
+
gem "jekyll-fa-icons"
|
14
|
+
end
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Alternatively install the gem yourself as:
|
22
|
+
|
23
|
+
$ gem install jekyll-fa-icons
|
24
|
+
|
25
|
+
and put this in your ``_config.yml``
|
26
|
+
|
27
|
+
```yaml
|
28
|
+
plugins: [jekyll-fa-icons]
|
29
|
+
# This will require each of these gems automatically.
|
30
|
+
```
|
31
|
+
|
32
|
+
## Usage
|
33
|
+
|
34
|
+
* `{% fai %}` ; will display `<i class="fab fa-github"></i>`
|
35
|
+
* `{% fai k8s %}` or any other shortcut from `DEFAULT_ICONS` ; will display `<i class="fas fa-dharmachakra"</i>` or the related icon
|
36
|
+
* `{% fai fab fa-500px %}` or any other code from https://fontawesome.com/icons?d=gallery ; will display `<i class="fab fa-500px"></i>` or the refered code
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jekyll-fa-icons/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "jekyll-fa-icons"
|
8
|
+
spec.version = Jekyll::FontAwesomeIcons::VERSION
|
9
|
+
spec.authors = ["bauagonzo"]
|
10
|
+
spec.email = ["baua.gonzo@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{jekyll plugin to easily display FontAwesome icons}
|
13
|
+
spec.description = %q{jekyll plugin to generate html snippets for embedding fa-icons}
|
14
|
+
spec.homepage = "https://github.com/coulof/jekyll-fa-icons"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_dependency 'jekyll', "~> 4.0"
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'jekyll'
|
4
|
+
require 'jekyll-fa-icons/version'
|
5
|
+
|
6
|
+
# TODO deal with other tags like color, etc.
|
7
|
+
class FontAwesomeIcons < Liquid::Tag
|
8
|
+
DEFAULT_ICONS = { 'gh' => 'fab fa-github',
|
9
|
+
'k8s' => 'fas fa-dharmachakra',
|
10
|
+
'rb' => 'fas fa-gem',
|
11
|
+
'wiki' => 'fab fa-wikipedia-w',
|
12
|
+
'linux' => 'fab fa-linux',
|
13
|
+
'dell' => 'fas fa-laptop-code' }
|
14
|
+
def initialize(tagName, input, tokens)
|
15
|
+
super
|
16
|
+
@input = input
|
17
|
+
end
|
18
|
+
|
19
|
+
def render(context)
|
20
|
+
icon = ""
|
21
|
+
# Github is the most used icon for me
|
22
|
+
if @input.nil? || @input.empty?
|
23
|
+
icon = DEFAULT_ICONS['gh']
|
24
|
+
else
|
25
|
+
# Font Awesome codes are always 2 words (e.g <i class="fab fa-500px"></i>)
|
26
|
+
if @input.split.length < 2
|
27
|
+
icon = DEFAULT_ICONS["#{@input.strip}"] #be sure to remove trailing spaces
|
28
|
+
else
|
29
|
+
icon = @input
|
30
|
+
end
|
31
|
+
end
|
32
|
+
%(<i class="#{icon}"></i>)
|
33
|
+
end
|
34
|
+
Liquid::Template.register_tag('fai', self)
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-fa-icons
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- bauagonzo
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-11-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: jekyll
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.10'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.10'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
description: jekyll plugin to generate html snippets for embedding fa-icons
|
56
|
+
email:
|
57
|
+
- baua.gonzo@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- jekyll-fa-icons.gemspec
|
68
|
+
- lib/jekyll-fa-icons.rb
|
69
|
+
- lib/jekyll-fa-icons/version.rb
|
70
|
+
homepage: https://github.com/coulof/jekyll-fa-icons
|
71
|
+
licenses:
|
72
|
+
- MIT
|
73
|
+
metadata: {}
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
requirements: []
|
89
|
+
rubygems_version: 3.1.2
|
90
|
+
signing_key:
|
91
|
+
specification_version: 4
|
92
|
+
summary: jekyll plugin to easily display FontAwesome icons
|
93
|
+
test_files: []
|