jekyll_picture_tag 1.8.0 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -0
  3. data/.travis.yml +4 -7
  4. data/Dockerfile +9 -0
  5. data/docs/Gemfile.lock +183 -88
  6. data/docs/contributing.md +50 -16
  7. data/docs/example_presets.md +1 -1
  8. data/docs/global_configuration.md +55 -2
  9. data/docs/index.md +27 -21
  10. data/docs/installation.md +22 -7
  11. data/docs/presets.md +137 -55
  12. data/docs/releases.md +20 -1
  13. data/docs/usage.md +83 -39
  14. data/jekyll_picture_tag.gemspec +1 -1
  15. data/lib/jekyll_picture_tag.rb +28 -10
  16. data/lib/jekyll_picture_tag/cache.rb +3 -0
  17. data/lib/jekyll_picture_tag/cache/base.rb +59 -0
  18. data/lib/jekyll_picture_tag/cache/generated.rb +20 -0
  19. data/lib/jekyll_picture_tag/cache/source.rb +19 -0
  20. data/lib/jekyll_picture_tag/defaults/global.yml +2 -0
  21. data/lib/jekyll_picture_tag/defaults/presets.yml +2 -0
  22. data/lib/jekyll_picture_tag/generated_image.rb +85 -20
  23. data/lib/jekyll_picture_tag/img_uri.rb +1 -0
  24. data/lib/jekyll_picture_tag/instructions.rb +1 -0
  25. data/lib/jekyll_picture_tag/instructions/arg_splitter.rb +69 -0
  26. data/lib/jekyll_picture_tag/instructions/configuration.rb +47 -11
  27. data/lib/jekyll_picture_tag/instructions/preset.rb +35 -14
  28. data/lib/jekyll_picture_tag/instructions/set.rb +18 -8
  29. data/lib/jekyll_picture_tag/instructions/tag_parser.rb +59 -69
  30. data/lib/jekyll_picture_tag/output_formats/basic.rb +42 -11
  31. data/lib/jekyll_picture_tag/output_formats/img.rb +11 -0
  32. data/lib/jekyll_picture_tag/output_formats/picture.rb +22 -0
  33. data/lib/jekyll_picture_tag/router.rb +17 -0
  34. data/lib/jekyll_picture_tag/source_image.rb +60 -39
  35. data/lib/jekyll_picture_tag/srcsets/basic.rb +54 -19
  36. data/lib/jekyll_picture_tag/srcsets/pixel_ratio.rb +1 -3
  37. data/lib/jekyll_picture_tag/srcsets/width.rb +1 -1
  38. data/lib/jekyll_picture_tag/utils.rb +18 -0
  39. data/lib/jekyll_picture_tag/version.rb +1 -1
  40. data/readme.md +40 -16
  41. metadata +14 -8
@@ -2,6 +2,24 @@ module PictureTag
2
2
  # This is a little module to hold logic that doesn't fit other places. If it
3
3
  # starts getting big, refactor.
4
4
  module Utils
5
+ # These are valid ImageMagick gravity arguments (relevant to our use
6
+ # case):
7
+ GRAVITIES =
8
+ %w[center
9
+ north
10
+ northeast
11
+ east
12
+ southeast
13
+ south
14
+ southwest
15
+ west
16
+ northwest].freeze
17
+
18
+ # This is an attempt to recognize valid imagemagick geometry arguments
19
+ # with regex. It only tries to match values which don't preserve aspect
20
+ # ratio, as they're the ones people might actually need here.
21
+ GEOMETRY_REGEX = /\A\d*%?[x:]?\d*[%!]?([+-]\d+){,2}\Z/i.freeze
22
+
5
23
  class << self
6
24
  # Configure Jekyll to keep our generated files
7
25
  def keep_files
@@ -1,3 +1,3 @@
1
1
  module PictureTag
2
- VERSION = '1.8.0'.freeze
2
+ VERSION = '1.11.0'.freeze
3
3
  end
data/readme.md CHANGED
@@ -1,21 +1,20 @@
1
1
  # Jekyll Picture Tag
2
2
 
3
- **Easy responsive images for Jekyll.**
3
+ **Responsive Images done correctly.**
4
4
 
5
- It's easy to throw an image on a webpage and call it a day. Doing justice to your users by serving
6
- it efficiently on all browsers and screen sizes is tedious and tricky. Tedious, tricky things should be
7
- automated.
5
+ It's simple to throw a photo on a page and call it a day, but doing justice to users on all
6
+ different browsers and devices is tedious and tricky. Tedious, tricky things should be automated.
8
7
 
9
- Jekyll Picture Tag adds responsive images to your [Jekyll](http://jekyllrb.com) static site. It
10
- automatically creates resized, reformatted source images, is fully configurable, implements sensible
11
- defaults, and solves both the art direction and resolution switching problems with a little YAML
12
- configuration and a simple template tag.
8
+ Jekyll Picture Tag automatically builds cropped, resized, and reformatted images, builds several
9
+ kinds of markup, offers extensive configuration while requiring none, and solves both the art
10
+ direction and resolution switching problems with a little YAML configuration and a simple template
11
+ tag.
13
12
 
14
13
  ## Why use Responsive Images?
15
14
 
16
- **Performance:** The fastest sites are static sites, but when you plonk a 2mb picture of your dog at
17
- the top of a blog post you're throwing it all away. Responsive images allow you to keep your site
18
- fast, without compromising image quality.
15
+ **Performance:** The fastest sites are static sites, but if you plonk a 2mb picture of your dog at
16
+ the top of a blog post you throw it all away. Responsive images allow you to keep your site fast,
17
+ without compromising image quality.
19
18
 
20
19
  **Design:** Your desktop image may not work well on mobile, regardless of its resolution. We often
21
20
  want to do more than just resize images for different screen sizes, we want to crop them or use a
@@ -24,15 +23,40 @@ different image entirely.
24
23
  ## Why use Jekyll Picture Tag?
25
24
 
26
25
  **Developer Sanity:** If you want to serve multiple images in multiple formats and resolutions, you
27
- have a litany of markup to write and a big pile of images to generate. Jekyll Picture Tag is your
28
- responsive images minion - give it simple instructions and it'll handle the rest.
26
+ have a litany of markup to write and a big pile of images to generate and organize. Jekyll Picture
27
+ Tag is your responsive images minion - give it simple instructions and it'll handle the rest.
29
28
 
30
29
  ## Features
31
30
 
32
- * Automatic generation and organization of resized image files in basically any format(s).
33
- * Automatic generation of complex markup in several different formats.
34
- * No configuration required, extensive configuration available.
31
+ * Generate piles of cropped, resized, and converted image files.
32
+ * Generate corresponding markup in several different formats.
33
+ * Configure it easily, or not at all.
34
+ * Make Lighthouse happy.
35
35
 
36
36
  ## Documentation:
37
37
 
38
38
  https://rbuchberger.github.io/jekyll_picture_tag/
39
+
40
+ ## Changelog:
41
+
42
+ https://rbuchberger.github.io/jekyll_picture_tag/releases
43
+
44
+ Latest versions:
45
+
46
+ * 1.10.1 July 2, 2020
47
+ * Bugfix for erroneously regenerated images
48
+ * 1.10.2 July 6, 2020
49
+ * Bugfix for fallback image files not actually getting generated
50
+ * 1.11.0 July 27, 2020
51
+ * **Width and height attribute support!** Begone, page reflow.
52
+ * Cache image information between builds
53
+ * Change image naming format. This update will trigger all images to be regenerated, so you may
54
+ want to delete your generated images folder beforehand.
55
+
56
+ ## Help Wanted
57
+
58
+ Writing code is only part of the job; often the harder part is knowing what needs to be changed. Any
59
+ and all feedback is greatly appreciated, especially in regards to documentation. What are your pain
60
+ points? See the [contributing
61
+ guidelines](https://rbuchberger.github.io/jekyll_picture_tag/contributing), or the
62
+ [issues](https://github.com/rbuchberger/jekyll_picture_tag/issues) page for more.
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_picture_tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Wierzbowski
8
8
  - Brendan Tobolaski
9
9
  - Robert Buchberger
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-11-25 00:00:00.000000000 Z
13
+ date: 2020-07-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -186,14 +186,14 @@ dependencies:
186
186
  requirements:
187
187
  - - "~>"
188
188
  - !ruby/object:Gem::Version
189
- version: 1.1.1
189
+ version: 1.1.2
190
190
  type: :runtime
191
191
  prerelease: false
192
192
  version_requirements: !ruby/object:Gem::Requirement
193
193
  requirements:
194
194
  - - "~>"
195
195
  - !ruby/object:Gem::Version
196
- version: 1.1.1
196
+ version: 1.1.2
197
197
  - !ruby/object:Gem::Dependency
198
198
  name: jekyll
199
199
  requirement: !ruby/object:Gem::Requirement
@@ -225,6 +225,7 @@ files:
225
225
  - ".ruby-version"
226
226
  - ".solargraph.yml"
227
227
  - ".travis.yml"
228
+ - Dockerfile
228
229
  - Gemfile
229
230
  - LICENSE.txt
230
231
  - Rakefile
@@ -248,11 +249,16 @@ files:
248
249
  - jekyll_picture_tag.gemspec
249
250
  - lib/jekyll-picture-tag.rb
250
251
  - lib/jekyll_picture_tag.rb
252
+ - lib/jekyll_picture_tag/cache.rb
253
+ - lib/jekyll_picture_tag/cache/base.rb
254
+ - lib/jekyll_picture_tag/cache/generated.rb
255
+ - lib/jekyll_picture_tag/cache/source.rb
251
256
  - lib/jekyll_picture_tag/defaults/global.yml
252
257
  - lib/jekyll_picture_tag/defaults/presets.yml
253
258
  - lib/jekyll_picture_tag/generated_image.rb
254
259
  - lib/jekyll_picture_tag/img_uri.rb
255
260
  - lib/jekyll_picture_tag/instructions.rb
261
+ - lib/jekyll_picture_tag/instructions/arg_splitter.rb
256
262
  - lib/jekyll_picture_tag/instructions/configuration.rb
257
263
  - lib/jekyll_picture_tag/instructions/html_attributes.rb
258
264
  - lib/jekyll_picture_tag/instructions/preset.rb
@@ -283,7 +289,7 @@ homepage: https://github.com/rbuchberger/jekyll_picture_tag
283
289
  licenses:
284
290
  - BSD-3-Clause
285
291
  metadata: {}
286
- post_install_message:
292
+ post_install_message:
287
293
  rdoc_options: []
288
294
  require_paths:
289
295
  - lib
@@ -301,8 +307,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
301
307
  - !ruby/object:Gem::Version
302
308
  version: '0'
303
309
  requirements: []
304
- rubygems_version: 3.0.4
305
- signing_key:
310
+ rubygems_version: 3.1.4
311
+ signing_key:
306
312
  specification_version: 4
307
313
  summary: Easy responsive images for Jekyll.
308
314
  test_files: []