jekyll-avatar 0.5.0 → 0.6.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
  SHA1:
3
- metadata.gz: 41753d6b8276409f37b03545caedf501794f95d4
4
- data.tar.gz: 3cf88d6e733c61b0aa266733556b959c93050b5b
3
+ metadata.gz: 006e20723e8e73f4a452c08cc145cdc56aee0a14
4
+ data.tar.gz: dc445c24979eeb27748772ebd0a07720f6f0e3d4
5
5
  SHA512:
6
- metadata.gz: 09067eddb6f28ae052302444952d5931a199cbd5d7cfe0be096cc20b9ce69b19ebad64ca65c6587644000b12ed702364135d53021d9dd04abbb4292e7567b7d2
7
- data.tar.gz: 391e2d65a1213ab51c64c7a8b36911f7dd35575baf1e0ff22ee4e2c4766bbe05f97bf3414c97bd665dbd6e9fb4cb285d6d4f47975a94ca150b893f0b0fe5227b
6
+ metadata.gz: b1a217149b137448b584fc36b9cba53fc1c50d59649b50e6f03a59e94b7e34f7f772d1612f0b7c8e58eece9dca18663cb14c0978b5181934cf3274806859b5a9
7
+ data.tar.gz: 39f9071c7869a4741e7fb5c497230b905f81ae01984693ad5720fa87ed6285bd071333815c77847ccec867e5d59f0b9f0b2ad45e51b9cd91c29d08ec0dd27ef4
@@ -0,0 +1,3 @@
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
@@ -0,0 +1,20 @@
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/behaviorbot-config 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)."
@@ -0,0 +1,13 @@
1
+ # Configuration for probot-no-response - https://github.com/probot/no-response
2
+
3
+ # Number of days of inactivity before an Issue is closed for lack of response
4
+ daysUntilClose: 14
5
+ # Label requiring a response
6
+ responseRequiredLabel: more-information-needed
7
+ # Comment to post when closing an Issue for lack of response. Set to `false` to disable
8
+ closeComment: >
9
+ This issue has been automatically closed because there has been no response
10
+ to our request for more information from the original author. With only the
11
+ information that is currently in the issue, we don't have enough information
12
+ to take action. Please reach out if you have or find the answers we need so
13
+ that we can investigate further.
@@ -0,0 +1,31 @@
1
+ # Repository settings set via https://github.com/probot/settings
2
+
3
+ repository:
4
+ has_issues: true
5
+ has_wiki: false
6
+ has_projects: false
7
+ has_downloads: false
8
+
9
+ labels:
10
+ - name: help wanted
11
+ oldname: help-wanted
12
+ color: 0e8a16
13
+ - name: more-information-needed
14
+ color: d93f0b
15
+ - name: bug
16
+ color: b60205
17
+ - name: feature
18
+ color: 1d76db
19
+ - name: good first issue
20
+ color: "5319e7"
21
+
22
+ # Not currently implemented by probot/settings, but manually implemented in script/deploy
23
+ branch_protection:
24
+ restrictions: null
25
+ enforce_admins: false
26
+ required_status_checks:
27
+ strict: true
28
+ contexts:
29
+ - "continuous-integration/travis-ci"
30
+ required_pull_request_reviews:
31
+ require_code_owner_reviews: true
@@ -0,0 +1,27 @@
1
+ # Configuration for probot-stale - https://github.com/probot/stale
2
+
3
+ # Number of days of inactivity before an Issue or Pull Request becomes stale
4
+ daysUntilStale: 60
5
+
6
+ # Number of days of inactivity before a stale Issue or Pull Request is closed
7
+ daysUntilClose: 7
8
+
9
+ # Issues or Pull Requests with these labels will never be considered stale
10
+ exemptLabels:
11
+ - pinned
12
+ - security
13
+
14
+ # Label to use when marking as stale
15
+ staleLabel: wontfix
16
+
17
+ # Comment to post when marking as stale. Set to `false` to disable
18
+ markComment: >
19
+ This issue has been automatically marked as stale because it has not had
20
+ recent activity. It will be closed if no further activity occurs. Thank you
21
+ for your contributions.
22
+
23
+ # Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable
24
+ closeComment: false
25
+
26
+ # Limit to only `issues` or `pulls`
27
+ # only: issues
data/README.md CHANGED
@@ -73,6 +73,19 @@ Or, if the variable is someplace a bit more complex, like a loop:
73
73
  {% endfor %}
74
74
  ```
75
75
 
76
+ ### Lazy loading images
77
+
78
+ For pages showing a large number of avatars, you may want to load the images lazily.
79
+
80
+ ```liquid
81
+ {% avatar hubot lazy=true %}
82
+ ```
83
+
84
+ This will set the `data-src` and `data-srcset` attributes on the `<img>` tag, which is compatible with many lazy load JavaScript plugins, such as:
85
+
86
+ * https://www.andreaverlicchi.eu/lazyload/
87
+ * https://appelsiini.net/projects/lazyload/
88
+
76
89
  ### Using with GitHub Enterprise
77
90
 
78
91
  To use Jekyll Avatars with GitHub Enterprise, you must set the `PAGES_AVATARS_URL` environmental variable.
@@ -80,4 +93,4 @@ To use Jekyll Avatars with GitHub Enterprise, you must set the `PAGES_AVATARS_UR
80
93
  This should be the full URL to the avatars subdomain or subpath. For example:
81
94
 
82
95
  * With subdomain isolation: `PAGES_AVATARS_URL="https://avatars.github.example.com"`
83
- * Without subdomain isolation: `PAGES_AVATARS_URL="https://github.example.com/avatars"`
96
+ * Without subdomain isolation: `PAGES_AVATARS_URL="https://github.example.com/avatars"`
@@ -0,0 +1,46 @@
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/
@@ -0,0 +1,85 @@
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)
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  lib = File.expand_path("../lib", __FILE__)
@@ -25,5 +24,6 @@ Gem::Specification.new do |spec|
25
24
  spec.add_development_dependency "bundler", "~> 1.11"
26
25
  spec.add_development_dependency "rake", "~> 10.0"
27
26
  spec.add_development_dependency "rspec", "~> 3.0"
28
- spec.add_development_dependency "rubocop"
27
+ spec.add_development_dependency "rspec-html-matchers", "~> 0.9"
28
+ spec.add_development_dependency "rubocop", "~> 0.50", "< 0.53"
29
29
  end
@@ -25,15 +25,28 @@ module Jekyll
25
25
  private
26
26
 
27
27
  def attributes
28
- {
28
+ result = {
29
29
  :class => classes,
30
- :src => url,
31
30
  :alt => username,
32
- :srcset => srcset,
33
31
  :width => size,
34
32
  :height => size,
35
33
  "data-proofer-ignore" => true,
36
34
  }
35
+
36
+ if lazy_load?
37
+ result[:src] = ""
38
+ result["data-src"] = url
39
+ result["data-srcset"] = srcset
40
+ else
41
+ result[:src] = url
42
+ result[:srcset] = srcset
43
+ end
44
+
45
+ result
46
+ end
47
+
48
+ def lazy_load?
49
+ @text.include?("lazy=true")
37
50
  end
38
51
 
39
52
  def username
@@ -69,7 +82,8 @@ module Jekyll
69
82
  def url(scale = 1)
70
83
  uri = Addressable::URI.parse host
71
84
  uri.path << "/" unless uri.path.end_with?("/")
72
- uri.join path(scale)
85
+ uri = uri.join path(scale)
86
+ uri.to_s
73
87
  end
74
88
 
75
89
  def srcset
@@ -3,6 +3,6 @@
3
3
  module Liquid; class Tag; end; end
4
4
  module Jekyll
5
5
  class Avatar < Liquid::Tag
6
- VERSION = "0.5.0".freeze
6
+ VERSION = "0.6.0".freeze
7
7
  end
8
8
  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.5.0
4
+ version: 0.6.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: 2017-09-05 00:00:00.000000000 Z
11
+ date: 2018-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -66,20 +66,40 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec-html-matchers
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.9'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.9'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rubocop
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - ">="
87
+ - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: '0'
89
+ version: '0.50'
90
+ - - "<"
91
+ - !ruby/object:Gem::Version
92
+ version: '0.53'
76
93
  type: :development
77
94
  prerelease: false
78
95
  version_requirements: !ruby/object:Gem::Requirement
79
96
  requirements:
80
- - - ">="
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '0.50'
100
+ - - "<"
81
101
  - !ruby/object:Gem::Version
82
- version: '0'
102
+ version: '0.53'
83
103
  description:
84
104
  email:
85
105
  - ben.balter@github.com
@@ -87,6 +107,11 @@ executables: []
87
107
  extensions: []
88
108
  extra_rdoc_files: []
89
109
  files:
110
+ - ".github/CODEOWNERS"
111
+ - ".github/config.yml"
112
+ - ".github/no-response.yml"
113
+ - ".github/settings.yml"
114
+ - ".github/stale.yml"
90
115
  - ".gitignore"
91
116
  - ".rspec"
92
117
  - ".rubocop.yml"
@@ -96,6 +121,8 @@ files:
96
121
  - LICENSE.txt
97
122
  - README.md
98
123
  - Rakefile
124
+ - docs/CODE_OF_CONDUCT.md
125
+ - docs/CONTRIBUTING.md
99
126
  - jekyll-avatar.gemspec
100
127
  - lib/jekyll-avatar.rb
101
128
  - lib/jekyll-avatar/version.rb