jekyll-avatar 0.7.0 → 0.8.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: 1a22ab2c587db15659207e8bda5a6f1b26f5040516a865023e56e7de08b79564
4
- data.tar.gz: 9e96126073cb90638e4d7222d754a137736117a63af230b50e9f9e778f5e66e3
3
+ metadata.gz: 59a9a3637415d5b08eab35b0c56c43282eb55d0d068ecbcee79e7aefb38af288
4
+ data.tar.gz: ae037ea80d6f45c2443a7cfa560633cd32dd6de06476083e48abf898e41e5cb8
5
5
  SHA512:
6
- metadata.gz: 5627bdf38d43d0c59764fd15d807eae1fdadf27c5b8eaf744adf49f46ab18f47b961c91ada518e02d4344a0e8e39ee79a0f9b457eeeb703549e11f6e00e30172
7
- data.tar.gz: 2ce4d723bec13ff6386d2d773efad6c039f6ab73bfd44f3797184bf53fefad6fd0ab71839a3407e8400e79ab57f1eb51b8ac71265600b8ea07422ac3f2c943d4
6
+ metadata.gz: 3a3d603193c1c92e9b98a78f58899b4c2d6ae39666509a87f4ab43028ae993c4901246a644b45406955b19acbab58072d2e26cf6973b44988c269659a717101e
7
+ data.tar.gz: 7f1a6ca837d81f451acf8a86d4ee6560734978e5b2071163424ad8a9f1ec2babae36678aef9e421eb50245276814b22ece3434e653f8f9f7e43b49e65a5082d6
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  *A Jekyll plugin for rendering GitHub avatars*
4
4
 
5
- [![Build Status](https://travis-ci.org/benbalter/jekyll-avatar.svg)](https://travis-ci.org/benbalter/jekyll-avatar)
5
+ [![CI](https://github.com/jekyll/jekyll-avatar/actions/workflows/ci.yml/badge.svg)](https://github.com/jekyll/jekyll-avatar/actions/workflows/ci.yml)
6
6
 
7
7
  Jekyll Avatar makes it easy to add GitHub avatars to your Jekyll site by specifying a username. If performance is a concern, Jekyll Avatar is deeply integrated with the GitHub avatar API, ensuring avatars are cached and load in parallel. It even automatically upgrades users to Retina images, when supported.
8
8
 
@@ -62,7 +62,7 @@ You can also pass the username as a variable, like this:
62
62
 
63
63
  ```
64
64
  {% assign user="hubot" %}
65
- {% avatar {{ username }} %}
65
+ {% avatar {{ user }} %}
66
66
  ```
67
67
 
68
68
  Or, if the variable is someplace a bit more complex, like a loop:
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Liquid; class Tag; end; end
4
+
4
5
  module Jekyll
5
6
  class Avatar < Liquid::Tag
6
- VERSION = "0.7.0".freeze
7
+ VERSION = "0.8.0"
7
8
  end
8
9
  end
data/lib/jekyll-avatar.rb CHANGED
@@ -4,39 +4,61 @@ require "zlib"
4
4
 
5
5
  module Jekyll
6
6
  class Avatar < Liquid::Tag
7
- include Jekyll::LiquidExtensions
7
+ def self.generate_template_with(keys)
8
+ attrs = (BASE_ATTRIBUTES + keys).map! { |key| %(#{key}="%<#{key}>s") }.join(" ")
9
+ "<img #{attrs} />"
10
+ end
11
+ private_class_method :generate_template_with
12
+
13
+ #
8
14
 
9
15
  SERVERS = 4
10
- DEFAULT_SIZE = 40
11
- API_VERSION = 3
16
+ DEFAULT_SIZE = "40"
17
+ API_VERSION = "3"
18
+
19
+ BASE_ATTRIBUTES = %w(
20
+ class alt width height data-proofer-ignore src
21
+ ).freeze
22
+
23
+ BASE_TEMPLATE = generate_template_with %w(srcset)
24
+ LAZY_TEMPLATE = generate_template_with %w(data-src data-srcset)
25
+
26
+ private_constant :BASE_ATTRIBUTES, :BASE_TEMPLATE, :LAZY_TEMPLATE
12
27
 
13
28
  def initialize(_tag_name, text, _tokens)
14
29
  super
15
- @text = text
30
+ @text = text.strip
31
+ @markup = Liquid::Template.parse(@text)
32
+
33
+ @size = compute_size
34
+ @user_variable = extract_user_variable
35
+
36
+ @custom_host = ENV["PAGES_AVATARS_URL"]
37
+ @custom_host = "" unless @custom_host.is_a?(String)
16
38
  end
17
39
 
18
40
  def render(context)
19
41
  @context = context
20
- @text = Liquid::Template.parse(@text).render(@context)
21
- attrs = attributes.map { |k, v| "#{k}=\"#{v}\"" }.join(" ")
22
- "<img #{attrs} />"
42
+ @text = @markup.render(@context)
43
+ template = lazy_load? ? LAZY_TEMPLATE : BASE_TEMPLATE
44
+ format(template, attributes)
23
45
  end
24
46
 
25
47
  private
26
48
 
27
49
  def attributes
28
50
  result = {
29
- :class => classes,
30
- :alt => username,
31
- :width => size,
32
- :height => size,
33
- "data-proofer-ignore" => true
51
+ :class => classes,
52
+ :alt => username,
53
+ :width => size,
54
+ :height => size,
55
+ :"data-proofer-ignore" => "true",
34
56
  }
35
57
 
36
58
  if lazy_load?
37
59
  result[:src] = ""
38
- result["data-src"] = url
39
- result["data-srcset"] = srcset
60
+ result[:"data-src"] = url
61
+ result[:"data-srcset"] = srcset
40
62
  else
41
63
  result[:src] = url
42
64
  result[:srcset] = srcset
@@ -49,22 +71,45 @@ module Jekyll
49
71
  @text.include?("lazy=true")
50
72
  end
51
73
 
74
+ def extract_user_variable
75
+ matches = @text.match(%r!\buser=([\w.]+)\b!)
76
+ matches[1] if matches
77
+ end
78
+
52
79
  def username
53
- matches = @text.match(%r!\buser=([\w\.]+)\b!)
54
- if matches
55
- lookup_variable(@context, matches[1])
80
+ return lookup_variable(@user_variable) if @user_variable
81
+
82
+ result = @text.include?(" ") ? @text.split(" ")[0] : @text
83
+ result.start_with?("@") ? result.sub("@", "") : result
84
+ end
85
+
86
+ # Lookup a Liquid variable in the current context.
87
+ #
88
+ # variable - the variable name, as a string.
89
+ #
90
+ # Returns the value of the variable in the context or the variable name if not found.
91
+ def lookup_variable(variable)
92
+ lookup = @context
93
+ if variable.include?(".")
94
+ variable.split(".").each do |value|
95
+ lookup = lookup[value]
96
+ end
56
97
  else
57
- @text.split(" ").first.sub("@", "")
98
+ lookup = lookup[variable]
58
99
  end
100
+
101
+ lookup || variable
59
102
  end
60
103
 
61
- def size
104
+ # Returns a string value
105
+ def compute_size
62
106
  matches = @text.match(%r!\bsize=(\d+)\b!i)
63
- matches ? matches[1].to_i : DEFAULT_SIZE
107
+ matches ? matches[1] : DEFAULT_SIZE
64
108
  end
109
+ attr_reader :size
65
110
 
66
111
  def path(scale = 1)
67
- "#{username}?v=#{API_VERSION}&s=#{size * scale}"
112
+ "#{username}?v=#{API_VERSION}&s=#{scale == 1 ? size : (size.to_i * scale)}"
68
113
  end
69
114
 
70
115
  def server_number
@@ -72,10 +117,10 @@ module Jekyll
72
117
  end
73
118
 
74
119
  def host
75
- if ENV["PAGES_AVATARS_URL"].is_a?(String) && !ENV["PAGES_AVATARS_URL"].empty?
76
- ENV["PAGES_AVATARS_URL"]
77
- else
120
+ if @custom_host.empty?
78
121
  "https://avatars#{server_number}.githubusercontent.com"
122
+ else
123
+ @custom_host
79
124
  end
80
125
  end
81
126
 
@@ -84,20 +129,29 @@ module Jekyll
84
129
  @parsed_host[host] ||= Addressable::URI.parse(host)
85
130
  end
86
131
 
87
- def url(scale = 1)
132
+ def url_with_custom_host(scale = 1)
88
133
  uri = parsed_host
89
134
  uri.path << "/" unless uri.path.end_with?("/")
90
135
  uri = uri.join path(scale)
91
136
  uri.to_s
92
137
  end
93
138
 
139
+ def url(scale = 1)
140
+ return url_with_custom_host(scale) unless @custom_host.empty?
141
+
142
+ "#{host}/#{path(scale)}"
143
+ end
144
+
145
+ SCALES = %w(1 2 3 4).freeze
146
+ private_constant :SCALES
147
+
94
148
  def srcset
95
- (1..4).map { |scale| "#{url(scale)} #{scale}x" }.join(", ")
149
+ SCALES.map { |scale| "#{url(scale.to_i)} #{scale}x" }.join(", ")
96
150
  end
97
151
 
98
152
  # See http://primercss.io/avatars/#small-avatars
99
153
  def classes
100
- size < 48 ? "avatar avatar-small" : "avatar"
154
+ size.to_i < 48 ? "avatar avatar-small" : "avatar"
101
155
  end
102
156
  end
103
157
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-avatar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-12 00:00:00.000000000 Z
11
+ date: 2022-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -51,19 +51,19 @@ dependencies:
51
51
  - !ruby/object:Gem::Version
52
52
  version: '3.0'
53
53
  - !ruby/object:Gem::Dependency
54
- name: rake
54
+ name: kramdown-parser-gfm
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '12.3'
59
+ version: '1.0'
60
60
  type: :development
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: '12.3'
66
+ version: '1.0'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: rspec
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -98,14 +98,28 @@ dependencies:
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: 0.10.0
101
+ version: 0.12.0
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - "~>"
107
+ - !ruby/object:Gem::Version
108
+ version: 0.12.0
109
+ - !ruby/object:Gem::Dependency
110
+ name: rubocop-rspec
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: '2.0'
102
116
  type: :development
103
117
  prerelease: false
104
118
  version_requirements: !ruby/object:Gem::Requirement
105
119
  requirements:
106
120
  - - "~>"
107
121
  - !ruby/object:Gem::Version
108
- version: 0.10.0
122
+ version: '2.0'
109
123
  description:
110
124
  email:
111
125
  - ben.balter@github.com
@@ -113,34 +127,11 @@ executables: []
113
127
  extensions: []
114
128
  extra_rdoc_files: []
115
129
  files:
116
- - ".github/CODEOWNERS"
117
- - ".github/ISSUE_TEMPLATE/bug_report.md"
118
- - ".github/ISSUE_TEMPLATE/feature_request.md"
119
- - ".github/config.yml"
120
- - ".github/funding.yml"
121
- - ".github/no-response.yml"
122
- - ".github/release-drafter.yml"
123
- - ".github/settings.yml"
124
- - ".github/stale.yml"
125
- - ".gitignore"
126
- - ".rspec"
127
- - ".rubocop.yml"
128
- - ".rubocop_todo.yml"
129
- - ".ruby-version"
130
- - ".travis.yml"
131
- - Gemfile
132
130
  - LICENSE.txt
133
131
  - README.md
134
- - Rakefile
135
- - docs/CODE_OF_CONDUCT.md
136
- - docs/CONTRIBUTING.md
137
- - docs/SECURITY.md
138
- - jekyll-avatar.gemspec
139
132
  - lib/jekyll-avatar.rb
140
133
  - lib/jekyll-avatar/version.rb
141
- - script/bootstrap
142
- - script/cibuild
143
- homepage: https://github.com/benbalter/jekyll-avatar
134
+ homepage: https://github.com/jekyll/jekyll-avatar
144
135
  licenses:
145
136
  - MIT
146
137
  metadata: {}
@@ -152,14 +143,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
152
143
  requirements:
153
144
  - - ">="
154
145
  - !ruby/object:Gem::Version
155
- version: '0'
146
+ version: 2.5.0
156
147
  required_rubygems_version: !ruby/object:Gem::Requirement
157
148
  requirements:
158
149
  - - ">="
159
150
  - !ruby/object:Gem::Version
160
151
  version: '0'
161
152
  requirements: []
162
- rubygems_version: 3.0.4
153
+ rubygems_version: 3.1.6
163
154
  signing_key:
164
155
  specification_version: 4
165
156
  summary: A Jekyll plugin for rendering GitHub avatars
data/.github/CODEOWNERS DELETED
@@ -1,3 +0,0 @@
1
- # Require @benbalter's :+1: for changes to the .github repo-config files
2
- # mainly due to https://github.com/probot/settings privilege escalation
3
- .github/* @benbalter
@@ -1,28 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Create a report to help us improve
4
-
5
- ---
6
-
7
- ### Describe the bug
8
-
9
- A clear and concise description of what the bug is.
10
-
11
- ### Steps to reproduce the behavior
12
-
13
- 1. Go to '...'
14
- 2. Click on '....'
15
- 3. Scroll down to '....'
16
- 4. See error
17
-
18
- ### Expected behavior
19
-
20
- A clear and concise description of what you expected to happen.
21
-
22
- ### Screenshots
23
-
24
- If applicable, add screenshots to help explain your problem.
25
-
26
- ### Additional context
27
-
28
- Add any other context about the problem here.
@@ -1,21 +0,0 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for this project
4
-
5
- ---
6
-
7
- ### Is your feature request related to a problem? Please describe the problem you're trying to solve.
8
-
9
- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
10
-
11
- ### Describe the solution you'd like
12
-
13
- A clear and concise description of what you want to happen.
14
-
15
- ### Describe alternatives you've considered
16
-
17
- A clear and concise description of any alternative solutions or features you've considered.
18
-
19
- ### Additional context
20
-
21
- Add any other context or screenshots about the feature request here.
data/.github/config.yml DELETED
@@ -1,23 +0,0 @@
1
- # Behaviorbot config. See https://github.com/behaviorbot/ for more information.
2
- # Note: Please Don't edit this file directly.
3
- # Edit https://github.com/benbalter/shared-community-files instead.
4
-
5
- # Configuration for update-docs - https://github.com/behaviorbot/update-docs
6
- updateDocsComment: "Thanks for the pull request! If you are making any changes to the user-facing functionality, please be sure to update the documentation in the `README` or `docs/` folder alongside your change. :heart:"
7
-
8
- # Configuration for request-info - https://github.com/behaviorbot/request-info
9
- requestInfoReplyComment: Thanks for this. Do you mind providing a bit more information about what problem you're trying to solve?
10
- requestInfoLabelToAdd: more-information-needed
11
-
12
- # Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
13
- #newIssueWelcomeComment: >
14
- # Welcome!
15
-
16
- # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
17
- newPRWelcomeComment: Welcome! Congrats on your first pull request to Jekyll Avatar. If you haven't already, please be sure to check out [the contributing guidelines](https://github.com/benbalter/jekyll-avatar/blob/master/docs/CONTRIBUTING.md).
18
-
19
- # Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
20
- firstPRMergeComment: "Congrats on getting your first pull request to Jekyll Avatar merged! Without amazing humans like you submitting pull requests, we couldn’t run this project. You rock! :tada:<br /><br />If you're interested in tackling another bug or feature, take a look at [the open issues](https://github.com/benbalter/jekyll-avatar/issues), especially those [labeled `help wanted`](https://github.com/benbalter/jekyll-avatar/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)."
21
-
22
- # Bug workaround
23
- contact_links: []
data/.github/funding.yml DELETED
@@ -1 +0,0 @@
1
- patreon: benbalter
@@ -1,15 +0,0 @@
1
- # Configuration for probot-no-response - https://github.com/probot/no-response
2
- # Note: Please Don't edit this file directly.
3
- # Edit https://github.com/benbalter/shared-community-files instead.
4
-
5
- # Number of days of inactivity before an Issue is closed for lack of response
6
- daysUntilClose: 14
7
- # Label requiring a response
8
- responseRequiredLabel: more-information-needed
9
- # Comment to post when closing an Issue for lack of response. Set to `false` to disable
10
- closeComment: >
11
- This issue has been automatically closed because there has been no response
12
- to our request for more information from the original author. With only the
13
- information that is currently in the issue, we don't have enough information
14
- to take action. Please reach out if you have or find the answers we need so
15
- that we can investigate further.
@@ -1,4 +0,0 @@
1
- template: |
2
- ## What's Changed
3
-
4
- $CHANGES
data/.github/settings.yml DELETED
@@ -1,33 +0,0 @@
1
- # Repository settings set via https://github.com/probot/settings
2
- # Note: Please Don't edit this file directly.
3
- # Edit https://github.com/benbalter/shared-community-files instead.
4
-
5
- repository:
6
- has_issues: true
7
- has_wiki: false
8
- has_projects: false
9
- has_downloads: false
10
-
11
- labels:
12
- - name: help wanted
13
- oldname: help-wanted
14
- color: 0e8a16
15
- - name: more-information-needed
16
- color: d93f0b
17
- - name: bug
18
- color: b60205
19
- - name: feature
20
- color: 1d76db
21
- - name: good first issue
22
- color: "5319e7"
23
-
24
- # Not currently implemented by probot/settings, but manually implemented in script/deploy
25
- branch_protection:
26
- restrictions: null
27
- enforce_admins: false
28
- required_status_checks:
29
- strict: true
30
- contexts:
31
- - "continuous-integration/travis-ci"
32
- required_pull_request_reviews:
33
- require_code_owner_reviews: true
data/.github/stale.yml DELETED
@@ -1,29 +0,0 @@
1
- # Configuration for probot-stale - https://github.com/probot/stale
2
- # Note: Please Don't edit this file directly.
3
- # Edit https://github.com/benbalter/shared-community-files instead.
4
-
5
- # Number of days of inactivity before an Issue or Pull Request becomes stale
6
- daysUntilStale: 60
7
-
8
- # Number of days of inactivity before a stale Issue or Pull Request is closed
9
- daysUntilClose: 7
10
-
11
- # Issues or Pull Requests with these labels will never be considered stale
12
- exemptLabels:
13
- - pinned
14
- - security
15
-
16
- # Label to use when marking as stale
17
- staleLabel: wontfix
18
-
19
- # Comment to post when marking as stale. Set to `false` to disable
20
- markComment: >
21
- This issue has been automatically marked as stale because it has not had
22
- recent activity. It will be closed if no further activity occurs. Thank you
23
- for your contributions.
24
-
25
- # Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable
26
- closeComment: false
27
-
28
- # Limit to only `issues` or `pulls`
29
- # only: issues
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- *.gem
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
data/.rubocop.yml DELETED
@@ -1,19 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- require: rubocop-jekyll
4
- inherit_gem:
5
- rubocop-jekyll: .rubocop.yml
6
-
7
- Naming/FileName:
8
- Enabled: false
9
-
10
- Metrics/LineLength:
11
- Exclude:
12
- - spec/*/**
13
-
14
- Metrics/BlockLength:
15
- Enabled: false
16
-
17
- AllCops:
18
- Exclude:
19
- - vendor/**/*
data/.rubocop_todo.yml DELETED
@@ -1,46 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2019-04-18 23:25:25 +0530 using RuboCop version 0.66.0.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 1
10
- # Cop supports --auto-correct.
11
- # Configuration parameters: EnforcedStyle.
12
- # SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
13
- Layout/IndentHeredoc:
14
- Exclude:
15
- - 'spec/jekyll/avatar_spec.rb'
16
-
17
- # Offense count: 2
18
- # Cop supports --auto-correct.
19
- # Configuration parameters: EnforcedStyle.
20
- # SupportedStyles: braces, no_braces, context_dependent
21
- Style/BracesAroundHashParameters:
22
- Exclude:
23
- - 'spec/jekyll/avatar_spec.rb'
24
- - 'spec/spec_helper.rb'
25
-
26
- # Offense count: 2
27
- # Cop supports --auto-correct.
28
- Style/ExpandPathArguments:
29
- Exclude:
30
- - 'jekyll-avatar.gemspec'
31
- - 'spec/spec_helper.rb'
32
-
33
- # Offense count: 1
34
- # Cop supports --auto-correct.
35
- Style/RedundantFreeze:
36
- Exclude:
37
- - 'lib/jekyll-avatar/version.rb'
38
-
39
- # Offense count: 6
40
- # Cop supports --auto-correct.
41
- # Configuration parameters: EnforcedStyleForMultiline.
42
- # SupportedStylesForMultiline: comma, consistent_comma, no_comma
43
- Style/TrailingCommaInHashLiteral:
44
- Exclude:
45
- - 'lib/jekyll-avatar.rb'
46
- - 'spec/jekyll/avatar_spec.rb'
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.5.3
data/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.4
4
- cache: bundler
5
- script: script/cibuild
6
- env:
7
- matrix:
8
- - JEKYLL_VERSION="~> 3.0"
9
- - JEKYLL_VERSION=">= 4.0.0.pre.alpha1"
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec
6
-
7
- gem "jekyll", ENV["JEKYLL_VERSION"] if ENV["JEKYLL_VERSION"]
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task :default => :spec
@@ -1,46 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- ## Our Standards
8
-
9
- Examples of behavior that contributes to creating a positive environment include:
10
-
11
- * Using welcoming and inclusive language
12
- * Being respectful of differing viewpoints and experiences
13
- * Gracefully accepting constructive criticism
14
- * Focusing on what is best for the community
15
- * Showing empathy towards other community members
16
-
17
- Examples of unacceptable behavior by participants include:
18
-
19
- * The use of sexualized language or imagery and unwelcome sexual attention or advances
20
- * Trolling, insulting/derogatory comments, and personal or political attacks
21
- * Public or private harassment
22
- * Publishing others' private information, such as a physical or electronic address, without explicit permission
23
- * Other conduct which could reasonably be considered inappropriate in a professional setting
24
-
25
- ## Our Responsibilities
26
-
27
- Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
-
29
- Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
-
31
- ## Scope
32
-
33
- This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
-
35
- ## Enforcement
36
-
37
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at ben@balter.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
-
39
- Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
-
41
- ## Attribution
42
-
43
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44
-
45
- [homepage]: http://contributor-covenant.org
46
- [version]: http://contributor-covenant.org/version/1/4/
data/docs/CONTRIBUTING.md DELETED
@@ -1,85 +0,0 @@
1
- # Contributing to Jekyll Avatar
2
-
3
- Hi there! We're thrilled that you'd like to contribute to Jekyll Avatar. Your help is essential for keeping it great.
4
-
5
- Jekyll Avatar is an open source project supported by the efforts of an entire community and built one contribution at a time by users like you. We'd love for you to get involved. Whatever your level of skill or however much time you can give, your contribution is greatly appreciated. There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests, helping other users by commenting on issues, or writing code which can be incorporated into Jekyll Avatar itself.
6
-
7
- Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests.
8
-
9
-
10
-
11
- ## How to report a bug
12
-
13
- Think you found a bug? Please check [the list of open issues](https://github.com/benbalter/jekyll-avatar/issues) to see if your bug has already been reported. If it hasn't please [submit a new issue](https://github.com/benbalter/jekyll-avatar/issues/new).
14
-
15
- Here are a few tips for writing *great* bug reports:
16
-
17
- * Describe the specific problem (e.g., "widget doesn't turn clockwise" versus "getting an error")
18
- * Include the steps to reproduce the bug, what you expected to happen, and what happened instead
19
- * Check that you are using the latest version of the project and its dependencies
20
- * Include what version of the project your using, as well as any relevant dependencies
21
- * Only include one bug per issue. If you have discovered two bugs, please file two issues
22
- * Include screenshots or screencasts whenever possible
23
- * Even if you don't know how to fix the bug, including a failing test may help others track it down
24
-
25
- **If you find a security vulnerability, do not open an issue. Please email ben@balter.com instead.**
26
-
27
- ## How to suggest a feature or enhancement
28
-
29
- If you find yourself wishing for a feature that doesn't exist in Jekyll Avatar, you are probably not alone. There are bound to be others out there with similar needs. Many of the features that Jekyll Avatar has today have been added because our users saw the need.
30
-
31
- Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and goals of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible, including describing the problem you're trying to solve.
32
-
33
- [Open an issue](https://github.com/benbalter/jekyll-avatar/issues/new) which describes the feature you would like to see, why you want it, how it should work, etc.
34
-
35
-
36
-
37
- ## Your first contribution
38
-
39
- We'd love for you to contribute to the project. Unsure where to begin contributing to Jekyll Avatar? You can start by looking through these "good first issue" and "help wanted" issues:
40
-
41
- * [Good first issues](https://github.com/benbalter/jekyll-avatar/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) - issues which should only require a few lines of code and a test or two
42
- * [Help wanted issues](https://github.com/benbalter/jekyll-avatar/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) - issues which may be a bit more involved, but are specifically seeking community contributions
43
-
44
- *p.s. Feel free to ask for help; everyone is a beginner at first* :smiley_cat:
45
-
46
- ## How to propose changes
47
-
48
- Here's a few general guidelines for proposing changes:
49
-
50
- * If you are changing any user-facing functionality, please be sure to update the documentation
51
- * If you are adding a new behavior or changing an existing behavior, please be sure to update the corresponding test(s)
52
- * Each pull request should implement **one** feature or bug fix. If you want to add or fix more than one thing, submit more than one pull request
53
- * Do not commit changes to files that are irrelevant to your feature or bug fix
54
- * Don't bump the version number in your pull request (it will be bumped prior to release)
55
- * Write [a good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
56
-
57
- At a high level, [the process for proposing changes](https://guides.github.com/introduction/flow/) is:
58
-
59
- 1. [Fork](https://github.com/benbalter/jekyll-avatar/fork) and clone the project
60
- 2. Configure and install the dependencies: `script/bootstrap`
61
- 3. Make sure the tests pass on your machine: `script/cibuild`
62
- 4. Create a descriptively named branch: `git checkout -b my-branch-name`
63
- 5. Make your change, add tests and documentation, and make sure the tests still pass
64
- 6. Push to your fork and [submit a pull request](https://github.com/benbalter/jekyll-avatar/compare) describing your change
65
- 7. Pat your self on the back and wait for your pull request to be reviewed and merged
66
-
67
- **Interesting in submitting your first Pull Request?** It's easy! You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
68
-
69
- ## Bootstrapping your local development environment
70
-
71
- `script/bootstrap`
72
-
73
- ## Running tests
74
-
75
- `script/cibuild`
76
-
77
- ## Code of conduct
78
-
79
- This project is governed by [the Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
80
-
81
- ## Additional Resources
82
-
83
- * [Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/)
84
- * [Using Pull Requests](https://help.github.com/articles/using-pull-requests/)
85
- * [GitHub Help](https://help.github.com)
data/docs/SECURITY.md DELETED
@@ -1,3 +0,0 @@
1
- # Security Policy
2
-
3
- To report a security vulnerability, please email [ben@balter.com](mailto:ben@balter.com).
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path("../lib", __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require "jekyll-avatar/version"
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = "jekyll-avatar"
9
- spec.version = Jekyll::Avatar::VERSION
10
- spec.authors = ["Ben Balter"]
11
- spec.email = ["ben.balter@github.com"]
12
-
13
- spec.summary = "A Jekyll plugin for rendering GitHub avatars"
14
- spec.homepage = "https://github.com/benbalter/jekyll-avatar"
15
- spec.license = "MIT"
16
-
17
- spec.files = `git ls-files -z`.split("\x0").reject do |file|
18
- file.match(%r!^(test|spec|features)/!)
19
- end
20
-
21
- spec.require_paths = ["lib"]
22
-
23
- spec.add_dependency "jekyll", ">= 3.0", "< 5.0"
24
- spec.add_development_dependency "bundler", "> 1.0", "< 3.0"
25
- spec.add_development_dependency "rake", "~> 12.3"
26
- spec.add_development_dependency "rspec", "~> 3.0"
27
- spec.add_development_dependency "rspec-html-matchers", "~> 0.9"
28
- spec.add_development_dependency "rubocop-jekyll", "~> 0.10.0"
29
- end
data/script/bootstrap DELETED
@@ -1,5 +0,0 @@
1
- #!/bin/sh
2
-
3
- set -ex
4
-
5
- bundle install
data/script/cibuild DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/sh
2
-
3
- set -ex
4
-
5
- bundle exec rake spec
6
- bundle exec rubocop