jekyll-material-icon-tag 1.0.4 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gempush.yml +96 -98
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/README.md +14 -3
- data/Rakefile +49 -2
- data/lib/jekyll-material-icon-tag.rb +12 -1
- data/lib/jekyll-material-icon-tag/version.rb +3 -2
- 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: 7392131aff9012f46817af3453da5d0065cb842b822ad5f9c396d6d49f78057e
|
4
|
+
data.tar.gz: 63a8d7b7d7a51c74a93923e4cd3c279144d5761a99df61f2f851a52fde42fd73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8075ddb27637dc3bb4254c76242cd0fca4fb2efe39bb13df332cecb261674b5cf10c3b09f3bf6b8840f385f45e2a242bd5fca54c005f7149c283009826d220e5
|
7
|
+
data.tar.gz: 97d0cdfc669055a9109ca11e040a70b52f02ae78fa7fbc1a48004decaa32809ccead1931453f9ed13867292983d44eca4b3c765bbb6c7e0a2ddacff1ed697be2
|
@@ -1,12 +1,6 @@
|
|
1
1
|
name: Ruby Gem
|
2
2
|
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches: [ master ]
|
6
|
-
tags:
|
7
|
-
- '*'
|
8
|
-
pull_request:
|
9
|
-
branches: [ master ]
|
3
|
+
on: [pull_request, push]
|
10
4
|
|
11
5
|
jobs:
|
12
6
|
build:
|
@@ -14,94 +8,98 @@ jobs:
|
|
14
8
|
runs-on: ubuntu-latest
|
15
9
|
|
16
10
|
steps:
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
11
|
+
- uses: actions/checkout@v2
|
12
|
+
|
13
|
+
- name: Fetch all history for all tags and branches
|
14
|
+
run: |
|
15
|
+
git fetch --prune --unshallow --tags
|
16
|
+
echo "REF: ${{ github.ref }}"
|
17
|
+
|
18
|
+
- name: Install GitVersion
|
19
|
+
uses: gittools/actions/gitversion/setup@v0.9.2
|
20
|
+
with:
|
21
|
+
versionSpec: "5.2.x"
|
22
|
+
|
23
|
+
- name: Execute GitVersion
|
24
|
+
id: gitversion
|
25
|
+
uses: gittools/actions/gitversion/execute@v0.9.2
|
26
|
+
|
27
|
+
- name: Version variables for unstable builds
|
28
|
+
id: unstable
|
29
|
+
if: startsWith(github.ref, 'refs/tags/') != true
|
30
|
+
env:
|
31
|
+
LABEL: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}.${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}
|
32
|
+
run: |
|
33
|
+
echo "Pre-release: ${LABEL}"
|
34
|
+
echo "::set-output name=label::${LABEL}"
|
35
|
+
|
36
|
+
- name: Create gem version number
|
37
|
+
id: gemversion
|
38
|
+
env:
|
39
|
+
GEM_VERSION: "${{ steps.gitversion.outputs.majorMinorPatch }}${{ steps.unstable.outputs.label }}"
|
40
|
+
run: |
|
41
|
+
echo "Gem version: ${GEM_VERSION}"
|
42
|
+
echo "::set-output name=version::${GEM_VERSION}"
|
43
|
+
|
44
|
+
- name: Set up Ruby 2.6
|
45
|
+
uses: actions/setup-ruby@v1
|
46
|
+
with:
|
47
|
+
ruby-version: 2.6.x
|
48
|
+
|
49
|
+
- name: Cache dependencies
|
50
|
+
uses: actions/cache@v1
|
51
|
+
with:
|
52
|
+
path: vendor/bundle
|
53
|
+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
54
|
+
restore-keys: ${{ runner.os }}-gems-
|
55
|
+
|
56
|
+
- name: Bundle install
|
57
|
+
run: |
|
58
|
+
gem install bundler
|
59
|
+
bundle config path vendor/bundle
|
60
|
+
bundle install --jobs 4 --retry 3
|
61
|
+
|
62
|
+
- name: Build gem
|
63
|
+
id: gem
|
64
|
+
env:
|
65
|
+
GEM_VERSION: ${{ steps.gemversion.outputs.version }}
|
66
|
+
run: |
|
67
|
+
GEM_BUILD_NAME=$(gem build jekyll-material-icon-tag.gemspec | awk '/File/ {print $2}')
|
68
|
+
echo "Gem filename: '${GEM_BUILD_NAME}'"
|
69
|
+
echo "::set-output name=name::${GEM_BUILD_NAME}"
|
70
|
+
|
71
|
+
- name: Test gem
|
72
|
+
run: |
|
73
|
+
bundle exec rake test
|
74
|
+
|
75
|
+
- name: Upload artifact
|
76
|
+
uses: actions/upload-artifact@v2-preview
|
77
|
+
with:
|
78
|
+
name: ${{ steps.gem.outputs.name }}
|
79
|
+
path: ${{ steps.gem.outputs.name }}
|
80
|
+
|
81
|
+
- name: Publish to GPR
|
82
|
+
env:
|
83
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
84
|
+
OWNER: SwedbankPay
|
85
|
+
run: |
|
86
|
+
mkdir -p $HOME/.gem
|
87
|
+
touch $HOME/.gem/credentials
|
88
|
+
chmod 0600 $HOME/.gem/credentials
|
89
|
+
printf -- "---\n:github: Bearer ${GITHUB_TOKEN}\n" > $HOME/.gem/credentials
|
90
|
+
set -e
|
91
|
+
gem push --KEY github \
|
92
|
+
--host https://rubygems.pkg.github.com/${OWNER} \
|
93
|
+
${{ steps.gem.outputs.name }} \
|
94
|
+
|| echo "push failed ($?) probably due to version '${{ steps.gemversion.outputs.version }}' already existing in GPR."
|
95
|
+
|
96
|
+
- name: Publish to RubyGems
|
97
|
+
if: startsWith(github.ref, 'refs/tags/') # Only publish tagged commits
|
98
|
+
env:
|
99
|
+
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
100
|
+
run: |
|
101
|
+
mkdir -p $HOME/.gem
|
102
|
+
touch $HOME/.gem/credentials
|
103
|
+
chmod 0600 $HOME/.gem/credentials
|
104
|
+
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
|
105
|
+
gem push ${{ steps.gem.outputs.name }}
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -7,12 +7,15 @@ gem 'jekyll-material-icon-tag'
|
|
7
7
|
```
|
8
8
|
|
9
9
|
And then execute:
|
10
|
+
|
10
11
|
```shell
|
11
|
-
|
12
|
+
bundle install
|
12
13
|
```
|
14
|
+
|
13
15
|
Or install it yourself as:
|
16
|
+
|
14
17
|
```shell
|
15
|
-
|
18
|
+
gem install jekyll-material-icon-tag
|
16
19
|
```
|
17
20
|
|
18
21
|
## Usage
|
@@ -25,9 +28,17 @@ To render a Material Design Icon use as follows:
|
|
25
28
|
{% icon name_of_icon_you_want %}
|
26
29
|
```
|
27
30
|
|
31
|
+
You can also add style if you want a different material icon style:
|
32
|
+
|
33
|
+
```liquid
|
34
|
+
{% icon name_of_icon_you_want two-tone %}
|
35
|
+
{% icon another_icon_perhaps round %}
|
36
|
+
{% icon the_outlined_one outlined %}
|
37
|
+
```
|
38
|
+
|
28
39
|
## Contributing
|
29
40
|
|
30
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
41
|
+
Bug reports and pull requests are welcome on GitHub at <https://github.com/SwedbankPay/jekyll-material-icon-tag. 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/SwedbankPay/jekyll-material-icon-tag/blob/master/CODE_OF_CONDUCT.md).
|
31
42
|
|
32
43
|
## License
|
33
44
|
|
data/Rakefile
CHANGED
@@ -1,2 +1,49 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
require 'jekyll'
|
3
|
+
|
4
|
+
# Extend string to allow for bold text.
|
5
|
+
class String
|
6
|
+
def bold
|
7
|
+
"\033[1m#{self}\033[0m"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
# Rake Jekyll tasks
|
12
|
+
task :build do
|
13
|
+
conf = Jekyll.configuration({
|
14
|
+
'source' => 'test/jekyll-material-icon-tag',
|
15
|
+
'destination' => './_site/',
|
16
|
+
'verbose' => false,
|
17
|
+
'quiet' => true
|
18
|
+
})
|
19
|
+
puts 'Building site...'.bold
|
20
|
+
Jekyll::Commands::Build.process(conf)
|
21
|
+
end
|
22
|
+
|
23
|
+
task :clean do
|
24
|
+
puts 'Cleaning up _site...'.bold
|
25
|
+
Jekyll::Commands::Clean.process({})
|
26
|
+
end
|
27
|
+
|
28
|
+
# Test generated output has valid HTML and links.
|
29
|
+
task :test => :build do
|
30
|
+
File.open("_site/index.html") do |file|
|
31
|
+
content = file.read
|
32
|
+
|
33
|
+
if content.include? "{% icon"
|
34
|
+
raise "Hell"
|
35
|
+
end
|
36
|
+
|
37
|
+
unless content.include? "material-icons-two-tone"
|
38
|
+
raise "Hell of two tones"
|
39
|
+
end
|
40
|
+
|
41
|
+
unless content.include? "material-icons-two-tone"
|
42
|
+
raise "Hell of two tones"
|
43
|
+
end
|
44
|
+
|
45
|
+
file.close
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
task :default => ["build"]
|
@@ -8,7 +8,18 @@ class IconTag < Liquid::Tag
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def render(_)
|
11
|
-
|
11
|
+
iconname, type = parse_parameters @text
|
12
|
+
|
13
|
+
if type.nil?
|
14
|
+
"<i class=\"material-icons\">#{iconname.strip}</i>"
|
15
|
+
else
|
16
|
+
"<i class=\"material-icons-#{type.strip}\">#{iconname.strip}</i>"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def parse_parameters(text)
|
21
|
+
text.strip!
|
22
|
+
text.split(/\s+/)
|
12
23
|
end
|
13
24
|
|
14
25
|
Liquid::Template.register_tag "icon", self
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-material-icon-tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nullint
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|