jekyll_picture_tag 1.9.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) 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 +4 -2
  6. data/docs/Gemfile.lock +186 -89
  7. data/docs/_config.yml +6 -10
  8. data/docs/devs/contributing/code.md +44 -0
  9. data/docs/devs/contributing/docs.md +13 -0
  10. data/docs/devs/contributing/index.md +15 -0
  11. data/docs/devs/contributing/setup.md +13 -0
  12. data/docs/devs/contributing/testing.md +41 -0
  13. data/docs/devs/index.md +7 -0
  14. data/docs/{releases.md → devs/releases.md} +35 -13
  15. data/docs/index.md +58 -36
  16. data/docs/users/configuration/cdn.md +35 -0
  17. data/docs/users/configuration/directories.md +34 -0
  18. data/docs/users/configuration/disable.md +24 -0
  19. data/docs/users/configuration/fast_build.md +28 -0
  20. data/docs/users/configuration/ignore_missing.md +23 -0
  21. data/docs/users/configuration/index.md +29 -0
  22. data/docs/users/configuration/kramdown_fix.md +20 -0
  23. data/docs/users/configuration/relative_urls.md +15 -0
  24. data/docs/users/configuration/suppress_warnings.md +16 -0
  25. data/docs/users/index.md +7 -0
  26. data/docs/users/installation.md +52 -0
  27. data/docs/users/liquid_tag/argument_reference/alternate_images.md +18 -0
  28. data/docs/users/liquid_tag/argument_reference/attributes.md +42 -0
  29. data/docs/users/liquid_tag/argument_reference/base_image.md +12 -0
  30. data/docs/users/liquid_tag/argument_reference/crop.md +48 -0
  31. data/docs/users/liquid_tag/argument_reference/link.md +16 -0
  32. data/docs/users/liquid_tag/argument_reference/preset.md +17 -0
  33. data/docs/users/liquid_tag/argument_reference/readme.md +9 -0
  34. data/docs/users/liquid_tag/examples.md +81 -0
  35. data/docs/users/liquid_tag/index.md +31 -0
  36. data/docs/users/notes/git_lfs.md +7 -0
  37. data/docs/users/notes/github_pages.md +5 -0
  38. data/docs/users/notes/html_attributes.md +5 -0
  39. data/docs/users/notes/index.md +6 -0
  40. data/docs/users/notes/input_checking.md +6 -0
  41. data/docs/users/notes/kramdown_bug.md +41 -0
  42. data/docs/users/notes/managing_images.md +21 -0
  43. data/docs/{migration.md → users/notes/migration.md} +0 -0
  44. data/docs/users/presets/cropping.md +61 -0
  45. data/docs/users/presets/default.md +23 -0
  46. data/docs/users/presets/examples.md +79 -0
  47. data/docs/users/presets/fallback_image.md +28 -0
  48. data/docs/users/presets/html_attributes.md +26 -0
  49. data/docs/users/presets/image_formats.md +21 -0
  50. data/docs/users/presets/image_quality.md +43 -0
  51. data/docs/users/presets/index.md +101 -0
  52. data/docs/users/presets/link_source.md +16 -0
  53. data/docs/users/presets/markup_formats/fragments.md +48 -0
  54. data/docs/users/presets/markup_formats/javascript_friendly.md +57 -0
  55. data/docs/users/presets/markup_formats/readme.md +43 -0
  56. data/docs/users/presets/markup_formats/standard_html.md +25 -0
  57. data/docs/users/presets/media_queries.md +36 -0
  58. data/docs/users/presets/nomarkdown_override.md +17 -0
  59. data/docs/users/presets/pixel_ratio_srcsets.md +32 -0
  60. data/docs/users/presets/width_height_attributes.md +34 -0
  61. data/docs/users/presets/width_srcsets.md +85 -0
  62. data/jekyll_picture_tag.gemspec +1 -1
  63. data/lib/jekyll_picture_tag.rb +1 -0
  64. data/lib/jekyll_picture_tag/cache.rb +3 -0
  65. data/lib/jekyll_picture_tag/cache/base.rb +59 -0
  66. data/lib/jekyll_picture_tag/cache/generated.rb +20 -0
  67. data/lib/jekyll_picture_tag/cache/source.rb +19 -0
  68. data/lib/jekyll_picture_tag/defaults/presets.yml +2 -0
  69. data/lib/jekyll_picture_tag/generated_image.rb +52 -41
  70. data/lib/jekyll_picture_tag/img_uri.rb +1 -0
  71. data/lib/jekyll_picture_tag/instructions.rb +1 -0
  72. data/lib/jekyll_picture_tag/instructions/arg_splitter.rb +69 -0
  73. data/lib/jekyll_picture_tag/instructions/configuration.rb +1 -1
  74. data/lib/jekyll_picture_tag/instructions/preset.rb +40 -15
  75. data/lib/jekyll_picture_tag/instructions/set.rb +23 -9
  76. data/lib/jekyll_picture_tag/instructions/tag_parser.rb +59 -69
  77. data/lib/jekyll_picture_tag/output_formats/basic.rb +34 -15
  78. data/lib/jekyll_picture_tag/output_formats/img.rb +11 -0
  79. data/lib/jekyll_picture_tag/output_formats/picture.rb +22 -0
  80. data/lib/jekyll_picture_tag/router.rb +9 -0
  81. data/lib/jekyll_picture_tag/source_image.rb +60 -44
  82. data/lib/jekyll_picture_tag/srcsets/basic.rb +29 -7
  83. data/lib/jekyll_picture_tag/utils.rb +18 -0
  84. data/lib/jekyll_picture_tag/version.rb +1 -1
  85. data/readme.md +40 -16
  86. metadata +67 -20
  87. data/docs/_layouts/directory.html +0 -32
  88. data/docs/assets/style.css +0 -31
  89. data/docs/contributing.md +0 -75
  90. data/docs/example_presets.md +0 -116
  91. data/docs/global_configuration.md +0 -173
  92. data/docs/installation.md +0 -30
  93. data/docs/notes.md +0 -91
  94. data/docs/output.md +0 -63
  95. data/docs/presets.md +0 -309
  96. data/docs/usage.md +0 -113
@@ -1,113 +0,0 @@
1
- ---
2
- ---
3
- # How to use the Liquid Tag:
4
-
5
- ## Format:
6
-
7
- {% raw %}
8
- `{% picture [preset] (base image) [alternate images] [attributes] %}`
9
- {% endraw %}
10
-
11
- The only required argument is the base image. Line breaks and extra spaces are fine, and you can
12
- use liquid variables anywhere.
13
-
14
- ## Examples:
15
-
16
- {% raw %}
17
- `{% picture example.jpg %}`
18
-
19
- `{% picture thumbnail example.jpg --alt Example Image %}`
20
-
21
- `{% picture example.jpg --picture class="attribute-demo" %}`
22
-
23
- `{% picture blog_index {{ post.image }} --link {{ post.url }} %}`
24
-
25
- `{% picture "some example.jpg" mobile: other\ example.jpg %}`
26
-
27
- ```md
28
- {% picture
29
- hero
30
- example.jpg
31
- tablet: example_cropped.jpg
32
- mobile: example_cropped_more.jpg
33
- --alt Happy Puppy
34
- --picture class="hero"
35
- --link /
36
- %}
37
- ```
38
- {% endraw %}
39
-
40
- ## Argument reference
41
-
42
- Given in order:
43
-
44
- * **Preset**
45
-
46
- Select a [markup preset]({{ site.baseurl }}/presets#markup-presets), or omit to use the `default` preset. Presets
47
- are collections of settings that determine nearly everything about JPT's output, from the image
48
- formats used to the exact format your markup will take.
49
-
50
- * **Base Image** (Required)
51
-
52
- Can be any raster image (as long as you have the required ImageMagick delegate). Relative to
53
- jekyll's root directory, or the `source` [setting]({{ site.baseurl }}/global_configuration) if you've configured it.
54
-
55
- For filenames with spaces, either use double quotes (`"my image.jpg"`) or a backslash (`my\
56
- image.jpg`).
57
-
58
- * **Alternate images**
59
-
60
- *Format:* `(media query preset): (filename) (...)`
61
-
62
- *Example:* `tablet: img_cropped.jpg mobile: img_cropped_more.jpg`
63
-
64
- Optionally specify any number of alternate base images for given [screen
65
- sizes]({{ site.baseurl }}/presets/#media-presets) (specified in `_data/picture.yml`). This is called [art
66
- direction](http://usecases.responsiveimages.org/#art-direction), and is one of JPT's strongest
67
- features.
68
-
69
- Give your images in order of ascending specificity (The first image is the most general). They will
70
- be provided to the browser in reverse order, and it will select the first one with an applicable
71
- media query.
72
-
73
- * **Attributes**
74
-
75
- Optionally specify any number of HTML attributes, or an href target. These will be added to any
76
- attributes you've set in a preset.
77
-
78
- * **`--link`**
79
-
80
- *Format:* `--link (some url)`
81
-
82
- *Examples*: `--link https://example.com`, `--link /blog/some_post/`
83
-
84
- Wrap the image in an anchor tag, with the `href` attribute set to whatever value you give it.
85
- This will override automatic source image linking, if you have enabled it.
86
-
87
- **Note**: If you get either mangled HTML or extra {::nomarkdown} tags when using this, read
88
- [here]({{ site.baseurl }}/notes).
89
-
90
- * **`--alt`**
91
-
92
- *Format:* `--alt (alt text)`
93
-
94
- *Example:* `--alt Here is my alt text!`
95
-
96
- Convenience shortcut for `--img alt="..."`
97
-
98
- * **`--(element)`**
99
-
100
- *Format:* `--(picture|img|source|a|parent) (Standard HTML attributes)`
101
-
102
- *Example:* `--img class="awesome-fade-in" id="coolio" --a data-awesomeness="11"`
103
-
104
- Apply attributes to a given HTML element. Your options are:
105
-
106
- * `picture`
107
- * `img`
108
- * `source`
109
- * `a` (anchor tag)
110
- * `parent`
111
-
112
- `--parent` will be applied to the `<picture>` if present, otherwise the `<img>`; useful when
113
- using an `auto` output format.