jekyll_picture_tag 1.7.1 → 1.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -7
  3. data/Dockerfile +9 -0
  4. data/docs/Gemfile.lock +183 -88
  5. data/docs/contributing.md +50 -16
  6. data/docs/example_presets.md +1 -1
  7. data/docs/global_configuration.md +55 -2
  8. data/docs/index.md +26 -20
  9. data/docs/installation.md +22 -7
  10. data/docs/notes.md +11 -1
  11. data/docs/output.md +32 -21
  12. data/docs/presets.md +109 -54
  13. data/docs/releases.md +17 -1
  14. data/docs/usage.md +68 -38
  15. data/jekyll_picture_tag.gemspec +2 -1
  16. data/lib/jekyll_picture_tag.rb +27 -10
  17. data/lib/jekyll_picture_tag/defaults/global.yml +2 -0
  18. data/lib/jekyll_picture_tag/defaults/presets.yml +2 -0
  19. data/lib/jekyll_picture_tag/generated_image.rb +105 -19
  20. data/lib/jekyll_picture_tag/instructions.rb +1 -0
  21. data/lib/jekyll_picture_tag/instructions/arg_splitter.rb +68 -0
  22. data/lib/jekyll_picture_tag/instructions/configuration.rb +47 -11
  23. data/lib/jekyll_picture_tag/instructions/preset.rb +34 -14
  24. data/lib/jekyll_picture_tag/instructions/set.rb +18 -8
  25. data/lib/jekyll_picture_tag/instructions/tag_parser.rb +59 -69
  26. data/lib/jekyll_picture_tag/output_formats/basic.rb +36 -7
  27. data/lib/jekyll_picture_tag/output_formats/data_attributes.rb +4 -1
  28. data/lib/jekyll_picture_tag/router.rb +16 -0
  29. data/lib/jekyll_picture_tag/source_image.rb +6 -1
  30. data/lib/jekyll_picture_tag/srcsets/basic.rb +45 -19
  31. data/lib/jekyll_picture_tag/srcsets/pixel_ratio.rb +1 -3
  32. data/lib/jekyll_picture_tag/srcsets/width.rb +1 -1
  33. data/lib/jekyll_picture_tag/utils.rb +18 -0
  34. data/lib/jekyll_picture_tag/version.rb +1 -1
  35. data/readme.md +39 -16
  36. metadata +24 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62e94c65637b912d5e44da1f3d0a9dac3c2ec8a9f8e538ebac99e2560a348356
4
- data.tar.gz: c845a01518248c1f77fbcdb115546627803e7be27516149e717e09edd07dc75e
3
+ metadata.gz: ae8370284d1375ba3f33a17cce5aae2b5aa4a5d51dcc23623ec9e7560b7f789a
4
+ data.tar.gz: 9f0c81c49fcbb700e36cc7e3b3152c8a35857cee2121de3ccfac98e8cf4eaa7c
5
5
  SHA512:
6
- metadata.gz: f322901c3b54fe9a4564ca480be283bdde4a68e1da505fbe309671546f551686a01f9c03dfa5159a14754f53791e342700f35e33cb7a0b71577ea2e86e282a75
7
- data.tar.gz: 251b9ed64c11dd6e4a460151703234c80d1d0f4bbd6c05f8fda412a7404bf7c8193e65761b5aac6633628e9bec49c587b8fd53dee1961b7a82c0f04d68435fb8
6
+ metadata.gz: 76b323add40a8ba56004f7e51371baa5a7b1c5c611cdca526ed0757fb7b746714674ad03f3d598cb5c4532bbbdcebc08a6ae7e531fcfdf52917c5d12d70574d9
7
+ data.tar.gz: 5911cd5b66f9638809ff7296a9a54fad639e5b87a68c892eaed47b54fa1f615eaa2afc15a2266ce59bbd1c05779ef56d0d5e7eb00bcf6e8469673e52ea250542
@@ -1,11 +1,8 @@
1
- language: ruby
2
- cache: bundler
1
+ services:
2
+ - docker
3
3
 
4
4
  before_install:
5
- - sudo apt-get install -y webp
6
- - gem update --system
7
- - gem install bundler
5
+ - docker build . -t jpt
8
6
 
9
7
  script:
10
- - bundle exec rake test
11
- - bundle exec rake rubocop
8
+ - docker run -t jpt
@@ -0,0 +1,9 @@
1
+ FROM ruby:alpine
2
+ WORKDIR /root/jekyll_picture_tag
3
+ # Dependencies for nokogiri, eventmachine, and JPT
4
+ RUN apk add git imagemagick g++ musl-dev make libstdc++ zlib build-base
5
+ COPY Gemfile* jekyll_picture_tag.gemspec ./
6
+ COPY lib/jekyll_picture_tag/version.rb ./lib/jekyll_picture_tag/version.rb
7
+ RUN bundle install
8
+ COPY . .
9
+ CMD rake
@@ -1,130 +1,224 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- activesupport (4.2.7)
5
- i18n (~> 0.7)
6
- json (~> 1.7, >= 1.7.7)
4
+ activesupport (6.0.3)
5
+ concurrent-ruby (~> 1.0, >= 1.0.2)
6
+ i18n (>= 0.7, < 2)
7
7
  minitest (~> 5.1)
8
- thread_safe (~> 0.3, >= 0.3.4)
9
8
  tzinfo (~> 1.1)
10
- addressable (2.4.0)
9
+ zeitwerk (~> 2.2, >= 2.2.2)
10
+ addressable (2.7.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
11
12
  coffee-script (2.4.1)
12
13
  coffee-script-source
13
14
  execjs
14
- coffee-script-source (1.12.2)
15
+ coffee-script-source (1.11.1)
15
16
  colorator (1.1.0)
16
- concurrent-ruby (1.1.5)
17
+ commonmarker (0.17.13)
18
+ ruby-enum (~> 0.5)
19
+ concurrent-ruby (1.1.6)
20
+ dnsruby (1.61.3)
21
+ addressable (~> 2.5)
22
+ em-websocket (0.5.1)
23
+ eventmachine (>= 0.12.9)
24
+ http_parser.rb (~> 0.6.0)
17
25
  ethon (0.12.0)
18
26
  ffi (>= 1.3.0)
27
+ eventmachine (1.2.7)
19
28
  execjs (2.7.0)
20
- faraday (0.15.4)
29
+ faraday (1.0.1)
21
30
  multipart-post (>= 1.2, < 3)
22
- ffi (1.11.1)
31
+ ffi (1.12.2)
23
32
  forwardable-extended (2.6.0)
24
- gemoji (2.1.0)
25
- github-pages (104)
26
- activesupport (= 4.2.7)
27
- github-pages-health-check (= 1.2.0)
28
- jekyll (= 3.3.0)
29
- jekyll-avatar (= 0.4.2)
30
- jekyll-coffeescript (= 1.0.1)
31
- jekyll-feed (= 0.8.0)
32
- jekyll-gist (= 1.4.0)
33
- jekyll-github-metadata (= 2.2.0)
34
- jekyll-mentions (= 1.2.0)
33
+ gemoji (3.0.1)
34
+ github-pages (204)
35
+ github-pages-health-check (= 1.16.1)
36
+ jekyll (= 3.8.5)
37
+ jekyll-avatar (= 0.7.0)
38
+ jekyll-coffeescript (= 1.1.1)
39
+ jekyll-commonmark-ghpages (= 0.1.6)
40
+ jekyll-default-layout (= 0.1.4)
41
+ jekyll-feed (= 0.13.0)
42
+ jekyll-gist (= 1.5.0)
43
+ jekyll-github-metadata (= 2.13.0)
44
+ jekyll-mentions (= 1.5.1)
45
+ jekyll-optional-front-matter (= 0.3.2)
35
46
  jekyll-paginate (= 1.1.0)
36
- jekyll-redirect-from (= 0.11.0)
37
- jekyll-sass-converter (= 1.3.0)
38
- jekyll-seo-tag (= 2.1.0)
39
- jekyll-sitemap (= 0.12.0)
40
- jekyll-swiss (= 0.4.0)
41
- jemoji (= 0.7.0)
42
- kramdown (= 1.11.1)
43
- liquid (= 3.0.6)
44
- listen (= 3.0.6)
47
+ jekyll-readme-index (= 0.3.0)
48
+ jekyll-redirect-from (= 0.15.0)
49
+ jekyll-relative-links (= 0.6.1)
50
+ jekyll-remote-theme (= 0.4.1)
51
+ jekyll-sass-converter (= 1.5.2)
52
+ jekyll-seo-tag (= 2.6.1)
53
+ jekyll-sitemap (= 1.4.0)
54
+ jekyll-swiss (= 1.0.0)
55
+ jekyll-theme-architect (= 0.1.1)
56
+ jekyll-theme-cayman (= 0.1.1)
57
+ jekyll-theme-dinky (= 0.1.1)
58
+ jekyll-theme-hacker (= 0.1.1)
59
+ jekyll-theme-leap-day (= 0.1.1)
60
+ jekyll-theme-merlot (= 0.1.1)
61
+ jekyll-theme-midnight (= 0.1.1)
62
+ jekyll-theme-minimal (= 0.1.1)
63
+ jekyll-theme-modernist (= 0.1.1)
64
+ jekyll-theme-primer (= 0.5.4)
65
+ jekyll-theme-slate (= 0.1.1)
66
+ jekyll-theme-tactile (= 0.1.1)
67
+ jekyll-theme-time-machine (= 0.1.1)
68
+ jekyll-titles-from-headings (= 0.5.3)
69
+ jemoji (= 0.11.1)
70
+ kramdown (= 1.17.0)
71
+ liquid (= 4.0.3)
45
72
  mercenary (~> 0.3)
46
- minima (= 2.0.0)
47
- rouge (= 1.11.1)
73
+ minima (= 2.5.1)
74
+ nokogiri (>= 1.10.4, < 2.0)
75
+ rouge (= 3.13.0)
48
76
  terminal-table (~> 1.4)
49
- github-pages-health-check (1.2.0)
77
+ github-pages-health-check (1.16.1)
50
78
  addressable (~> 2.3)
51
- net-dns (~> 0.8)
79
+ dnsruby (~> 1.60)
52
80
  octokit (~> 4.0)
53
- public_suffix (~> 1.4)
54
- typhoeus (~> 0.7)
55
- html-pipeline (2.12.0)
81
+ public_suffix (~> 3.0)
82
+ typhoeus (~> 1.3)
83
+ html-pipeline (2.12.3)
56
84
  activesupport (>= 2)
57
85
  nokogiri (>= 1.4)
86
+ http_parser.rb (0.6.0)
58
87
  i18n (0.9.5)
59
88
  concurrent-ruby (~> 1.0)
60
- jekyll (3.3.0)
89
+ jekyll (3.8.5)
61
90
  addressable (~> 2.4)
62
91
  colorator (~> 1.0)
92
+ em-websocket (~> 0.5)
93
+ i18n (~> 0.7)
63
94
  jekyll-sass-converter (~> 1.0)
64
- jekyll-watch (~> 1.1)
65
- kramdown (~> 1.3)
66
- liquid (~> 3.0)
95
+ jekyll-watch (~> 2.0)
96
+ kramdown (~> 1.14)
97
+ liquid (~> 4.0)
67
98
  mercenary (~> 0.3.3)
68
99
  pathutil (~> 0.9)
69
- rouge (~> 1.7)
100
+ rouge (>= 1.7, < 4)
70
101
  safe_yaml (~> 1.0)
71
- jekyll-avatar (0.4.2)
72
- jekyll (~> 3.0)
73
- jekyll-coffeescript (1.0.1)
102
+ jekyll-avatar (0.7.0)
103
+ jekyll (>= 3.0, < 5.0)
104
+ jekyll-coffeescript (1.1.1)
74
105
  coffee-script (~> 2.2)
75
- jekyll-feed (0.8.0)
76
- jekyll (~> 3.3)
77
- jekyll-gist (1.4.0)
106
+ coffee-script-source (~> 1.11.1)
107
+ jekyll-commonmark (1.3.1)
108
+ commonmarker (~> 0.14)
109
+ jekyll (>= 3.7, < 5.0)
110
+ jekyll-commonmark-ghpages (0.1.6)
111
+ commonmarker (~> 0.17.6)
112
+ jekyll-commonmark (~> 1.2)
113
+ rouge (>= 2.0, < 4.0)
114
+ jekyll-default-layout (0.1.4)
115
+ jekyll (~> 3.0)
116
+ jekyll-feed (0.13.0)
117
+ jekyll (>= 3.7, < 5.0)
118
+ jekyll-gist (1.5.0)
78
119
  octokit (~> 4.2)
79
- jekyll-github-metadata (2.2.0)
80
- jekyll (~> 3.1)
120
+ jekyll-github-metadata (2.13.0)
121
+ jekyll (>= 3.4, < 5.0)
81
122
  octokit (~> 4.0, != 4.4.0)
82
- jekyll-mentions (1.2.0)
83
- activesupport (~> 4.0)
123
+ jekyll-mentions (1.5.1)
84
124
  html-pipeline (~> 2.3)
85
- jekyll (~> 3.0)
125
+ jekyll (>= 3.7, < 5.0)
126
+ jekyll-optional-front-matter (0.3.2)
127
+ jekyll (>= 3.0, < 5.0)
86
128
  jekyll-paginate (1.1.0)
87
- jekyll-redirect-from (0.11.0)
88
- jekyll (>= 2.0)
89
- jekyll-sass-converter (1.3.0)
90
- sass (~> 3.2)
91
- jekyll-seo-tag (2.1.0)
92
- jekyll (~> 3.3)
93
- jekyll-sitemap (0.12.0)
94
- jekyll (~> 3.3)
95
- jekyll-swiss (0.4.0)
96
- jekyll-theme-slate (0.0.4)
97
- jekyll (~> 3.3)
98
- jekyll-watch (1.5.1)
129
+ jekyll-readme-index (0.3.0)
130
+ jekyll (>= 3.0, < 5.0)
131
+ jekyll-redirect-from (0.15.0)
132
+ jekyll (>= 3.3, < 5.0)
133
+ jekyll-relative-links (0.6.1)
134
+ jekyll (>= 3.3, < 5.0)
135
+ jekyll-remote-theme (0.4.1)
136
+ addressable (~> 2.0)
137
+ jekyll (>= 3.5, < 5.0)
138
+ rubyzip (>= 1.3.0)
139
+ jekyll-sass-converter (1.5.2)
140
+ sass (~> 3.4)
141
+ jekyll-seo-tag (2.6.1)
142
+ jekyll (>= 3.3, < 5.0)
143
+ jekyll-sitemap (1.4.0)
144
+ jekyll (>= 3.7, < 5.0)
145
+ jekyll-swiss (1.0.0)
146
+ jekyll-theme-architect (0.1.1)
147
+ jekyll (~> 3.5)
148
+ jekyll-seo-tag (~> 2.0)
149
+ jekyll-theme-cayman (0.1.1)
150
+ jekyll (~> 3.5)
151
+ jekyll-seo-tag (~> 2.0)
152
+ jekyll-theme-dinky (0.1.1)
153
+ jekyll (~> 3.5)
154
+ jekyll-seo-tag (~> 2.0)
155
+ jekyll-theme-hacker (0.1.1)
156
+ jekyll (~> 3.5)
157
+ jekyll-seo-tag (~> 2.0)
158
+ jekyll-theme-leap-day (0.1.1)
159
+ jekyll (~> 3.5)
160
+ jekyll-seo-tag (~> 2.0)
161
+ jekyll-theme-merlot (0.1.1)
162
+ jekyll (~> 3.5)
163
+ jekyll-seo-tag (~> 2.0)
164
+ jekyll-theme-midnight (0.1.1)
165
+ jekyll (~> 3.5)
166
+ jekyll-seo-tag (~> 2.0)
167
+ jekyll-theme-minimal (0.1.1)
168
+ jekyll (~> 3.5)
169
+ jekyll-seo-tag (~> 2.0)
170
+ jekyll-theme-modernist (0.1.1)
171
+ jekyll (~> 3.5)
172
+ jekyll-seo-tag (~> 2.0)
173
+ jekyll-theme-primer (0.5.4)
174
+ jekyll (> 3.5, < 5.0)
175
+ jekyll-github-metadata (~> 2.9)
176
+ jekyll-seo-tag (~> 2.0)
177
+ jekyll-theme-slate (0.1.1)
178
+ jekyll (~> 3.5)
179
+ jekyll-seo-tag (~> 2.0)
180
+ jekyll-theme-tactile (0.1.1)
181
+ jekyll (~> 3.5)
182
+ jekyll-seo-tag (~> 2.0)
183
+ jekyll-theme-time-machine (0.1.1)
184
+ jekyll (~> 3.5)
185
+ jekyll-seo-tag (~> 2.0)
186
+ jekyll-titles-from-headings (0.5.3)
187
+ jekyll (>= 3.3, < 5.0)
188
+ jekyll-watch (2.2.1)
99
189
  listen (~> 3.0)
100
- jemoji (0.7.0)
101
- activesupport (~> 4.0)
102
- gemoji (~> 2.0)
190
+ jemoji (0.11.1)
191
+ gemoji (~> 3.0)
103
192
  html-pipeline (~> 2.2)
104
- jekyll (>= 3.0)
105
- json (1.8.6)
106
- kramdown (1.11.1)
107
- liquid (3.0.6)
108
- listen (3.0.6)
109
- rb-fsevent (>= 0.9.3)
110
- rb-inotify (>= 0.9.7)
193
+ jekyll (>= 3.0, < 5.0)
194
+ kramdown (1.17.0)
195
+ liquid (4.0.3)
196
+ listen (3.2.1)
197
+ rb-fsevent (~> 0.10, >= 0.10.3)
198
+ rb-inotify (~> 0.9, >= 0.9.10)
111
199
  mercenary (0.3.6)
112
200
  mini_portile2 (2.4.0)
113
- minima (2.0.0)
114
- minitest (5.11.3)
201
+ minima (2.5.1)
202
+ jekyll (>= 3.5, < 5.0)
203
+ jekyll-feed (~> 0.9)
204
+ jekyll-seo-tag (~> 2.1)
205
+ minitest (5.14.0)
115
206
  multipart-post (2.1.1)
116
- net-dns (0.9.0)
117
- nokogiri (1.10.4)
207
+ nokogiri (1.10.9)
118
208
  mini_portile2 (~> 2.4.0)
119
- octokit (4.14.0)
209
+ octokit (4.18.0)
210
+ faraday (>= 0.9)
120
211
  sawyer (~> 0.8.0, >= 0.5.3)
121
212
  pathutil (0.16.2)
122
213
  forwardable-extended (~> 2.6)
123
- public_suffix (1.5.3)
124
- rb-fsevent (0.10.3)
125
- rb-inotify (0.10.0)
214
+ public_suffix (3.1.1)
215
+ rb-fsevent (0.10.4)
216
+ rb-inotify (0.10.1)
126
217
  ffi (~> 1.0)
127
- rouge (1.11.1)
218
+ rouge (3.13.0)
219
+ ruby-enum (0.8.0)
220
+ i18n
221
+ rubyzip (2.3.0)
128
222
  safe_yaml (1.0.5)
129
223
  sass (3.7.4)
130
224
  sass-listen (~> 4.0.0)
@@ -137,11 +231,12 @@ GEM
137
231
  terminal-table (1.8.0)
138
232
  unicode-display_width (~> 1.1, >= 1.1.1)
139
233
  thread_safe (0.3.6)
140
- typhoeus (0.8.0)
141
- ethon (>= 0.8.0)
142
- tzinfo (1.2.5)
234
+ typhoeus (1.4.0)
235
+ ethon (>= 0.9.0)
236
+ tzinfo (1.2.7)
143
237
  thread_safe (~> 0.1)
144
- unicode-display_width (1.6.0)
238
+ unicode-display_width (1.7.0)
239
+ zeitwerk (2.3.0)
145
240
 
146
241
  PLATFORMS
147
242
  ruby
@@ -151,4 +246,4 @@ DEPENDENCIES
151
246
  jekyll-theme-slate
152
247
 
153
248
  BUNDLED WITH
154
- 2.0.2
249
+ 2.1.4
@@ -10,11 +10,20 @@ Don't let any of the recommendations/requests in this guide stop you from submit
10
10
 
11
11
  ## Setup
12
12
 
13
- Getting up and running is pretty standard-- `git clone`, `cd` into the directory and `bundle
14
- install`.
13
+ It's pretty standard:
14
+
15
+ ```
16
+ $ git clone git@github.com:rbuchberger/jekyll_picture_tag.git
17
+ $ cd jekyll_picture_tag
18
+ $ bundle install
19
+ ```
15
20
 
16
21
  ## Testing
17
22
 
23
+ You probably only need to use docker if it's inconvenient to install ImageMagick 7.
24
+
25
+ ### Bare Metal
26
+
18
27
  `rake test` runs the test suite (both unit tests and integration tests). Ignore the mini_magick
19
28
  `method redefined` warnings (unless you know how to fix them?)
20
29
 
@@ -33,41 +42,66 @@ issues, if possible.
33
42
 
34
43
  `rake` will run all tests and rubocop.
35
44
 
45
+ ### Docker
46
+
47
+ The following commands will build and run the tests inside a docker image. This is useful if it's
48
+ inconvenient to install ImageMagick 7, or to ensure the Travis CI build will succeed:
49
+
50
+ ```
51
+ $ docker build . -t jpt
52
+ $ docker run -t jpt
53
+ ```
54
+
36
55
  ## Docs
37
56
 
38
- The docs are set up for github pages, which is based on jekyll. You can preview them locally as you
39
- edit:
57
+ I think one of the biggest opportunities for improvement in this plugin is its documentation. I'd
58
+ really love help here, and all you need to know is markdown.
59
+
60
+ It runs on github pages, which is based on jekyll. You can preview as you edit:
40
61
 
41
- 1. `cd docs`
42
- 2. `bundle install`
43
- 3. `bundle exec jekyll serve`
62
+ 0. Follow setup instructions above
63
+ 1. `$ cd docs`
64
+ 2. `$ bundle install`
65
+ 3. `$ bundle exec jekyll serve`
66
+ 4. In a web browser, navigate to `localhost:4000/jekyll_picture_tag/`
44
67
 
45
- ## Guidelines
68
+ ## Code Guidelines
46
69
 
47
- * Generally, go for straightforward and readable rather than terse and clever. I'm not actually a
70
+ * Generally, go for straightforward and readable rather than terse and clever. I'm not actually a
48
71
  very good programmer; I need simple code that's easy to understand.
49
72
 
50
- * Internal refactoring is welcome, especially in the name of the previous point.
73
+ * Refactoring is welcome, especially in the name of the previous point.
51
74
 
52
75
  * I'm very reluctant to introduce breaking changes to configuration settings. This rule isn't
53
76
  absolute, but I'm not going to do it without a good reason.
54
77
 
55
- * The addition of new test cases whenever relevant is certainly appreciated. This project went for
56
- awhile without any proper tests, but now that we're at 100% coverage it would be nice to keep it
57
- that way.
58
-
59
78
  * I've been using 80 characters for code and 100 characters for documentation.
60
79
 
80
+ * Don't disable cops without strong justification.
81
+
82
+ * I generally try to write tests before writing code, especially when fixing bugs. This
83
+ gives us some confidence that what we think we're testing and what we're actually testing aren't
84
+ too different.
85
+
61
86
  ## Hard rules
62
87
 
88
+ These aren't the rules for submitting a pull request, these are the rules for merging into master.
89
+ I'm thrilled to receive any help at all, and I'm more than happy to help with meeting these
90
+ criteria:
91
+
63
92
  * Liquid tag syntax can only be extended; no breaking changes. I'm not willing to force
64
93
  users to dig through their entire site and change every picture tag in order to update to the
65
94
  latest version.
66
95
 
67
- * Maintain "no configuration required" - a new user must be able to add jpt to their gemfile, bundle
96
+ * Maintain "no configuration required" - a new user must be able to add JPT to their gemfile, bundle
68
97
  install, and start writing picture tags in their site without touching a yml file.
69
98
 
70
- * All tests pass, and all rubocop warnings are addressed.
99
+ * 100% test coverage (Meaning that when running the unit and integration tests together, every line
100
+ of code in the `lib` folder must run at least once.)
101
+
102
+ * No failing tests
103
+
104
+ * No rubocop warnings
71
105
 
72
106
  ### Thanks!
73
107