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.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.travis.yml +4 -7
- data/Dockerfile +9 -0
- data/docs/Gemfile +4 -2
- data/docs/Gemfile.lock +186 -89
- data/docs/_config.yml +6 -10
- data/docs/devs/contributing/code.md +44 -0
- data/docs/devs/contributing/docs.md +13 -0
- data/docs/devs/contributing/index.md +15 -0
- data/docs/devs/contributing/setup.md +13 -0
- data/docs/devs/contributing/testing.md +41 -0
- data/docs/devs/index.md +7 -0
- data/docs/{releases.md → devs/releases.md} +35 -13
- data/docs/index.md +58 -36
- data/docs/users/configuration/cdn.md +35 -0
- data/docs/users/configuration/directories.md +34 -0
- data/docs/users/configuration/disable.md +24 -0
- data/docs/users/configuration/fast_build.md +28 -0
- data/docs/users/configuration/ignore_missing.md +23 -0
- data/docs/users/configuration/index.md +29 -0
- data/docs/users/configuration/kramdown_fix.md +20 -0
- data/docs/users/configuration/relative_urls.md +15 -0
- data/docs/users/configuration/suppress_warnings.md +16 -0
- data/docs/users/index.md +7 -0
- data/docs/users/installation.md +52 -0
- data/docs/users/liquid_tag/argument_reference/alternate_images.md +18 -0
- data/docs/users/liquid_tag/argument_reference/attributes.md +42 -0
- data/docs/users/liquid_tag/argument_reference/base_image.md +12 -0
- data/docs/users/liquid_tag/argument_reference/crop.md +48 -0
- data/docs/users/liquid_tag/argument_reference/link.md +16 -0
- data/docs/users/liquid_tag/argument_reference/preset.md +17 -0
- data/docs/users/liquid_tag/argument_reference/readme.md +9 -0
- data/docs/users/liquid_tag/examples.md +81 -0
- data/docs/users/liquid_tag/index.md +31 -0
- data/docs/users/notes/git_lfs.md +7 -0
- data/docs/users/notes/github_pages.md +5 -0
- data/docs/users/notes/html_attributes.md +5 -0
- data/docs/users/notes/index.md +6 -0
- data/docs/users/notes/input_checking.md +6 -0
- data/docs/users/notes/kramdown_bug.md +41 -0
- data/docs/users/notes/managing_images.md +21 -0
- data/docs/{migration.md → users/notes/migration.md} +0 -0
- data/docs/users/presets/cropping.md +61 -0
- data/docs/users/presets/default.md +23 -0
- data/docs/users/presets/examples.md +79 -0
- data/docs/users/presets/fallback_image.md +28 -0
- data/docs/users/presets/html_attributes.md +26 -0
- data/docs/users/presets/image_formats.md +21 -0
- data/docs/users/presets/image_quality.md +43 -0
- data/docs/users/presets/index.md +101 -0
- data/docs/users/presets/link_source.md +16 -0
- data/docs/users/presets/markup_formats/fragments.md +48 -0
- data/docs/users/presets/markup_formats/javascript_friendly.md +57 -0
- data/docs/users/presets/markup_formats/readme.md +43 -0
- data/docs/users/presets/markup_formats/standard_html.md +25 -0
- data/docs/users/presets/media_queries.md +36 -0
- data/docs/users/presets/nomarkdown_override.md +17 -0
- data/docs/users/presets/pixel_ratio_srcsets.md +32 -0
- data/docs/users/presets/width_height_attributes.md +34 -0
- data/docs/users/presets/width_srcsets.md +85 -0
- data/jekyll_picture_tag.gemspec +1 -1
- data/lib/jekyll_picture_tag.rb +1 -0
- data/lib/jekyll_picture_tag/cache.rb +3 -0
- data/lib/jekyll_picture_tag/cache/base.rb +59 -0
- data/lib/jekyll_picture_tag/cache/generated.rb +20 -0
- data/lib/jekyll_picture_tag/cache/source.rb +19 -0
- data/lib/jekyll_picture_tag/defaults/presets.yml +2 -0
- data/lib/jekyll_picture_tag/generated_image.rb +52 -41
- data/lib/jekyll_picture_tag/img_uri.rb +1 -0
- data/lib/jekyll_picture_tag/instructions.rb +1 -0
- data/lib/jekyll_picture_tag/instructions/arg_splitter.rb +69 -0
- data/lib/jekyll_picture_tag/instructions/configuration.rb +1 -1
- data/lib/jekyll_picture_tag/instructions/preset.rb +40 -15
- data/lib/jekyll_picture_tag/instructions/set.rb +23 -9
- data/lib/jekyll_picture_tag/instructions/tag_parser.rb +59 -69
- data/lib/jekyll_picture_tag/output_formats/basic.rb +34 -15
- data/lib/jekyll_picture_tag/output_formats/img.rb +11 -0
- data/lib/jekyll_picture_tag/output_formats/picture.rb +22 -0
- data/lib/jekyll_picture_tag/router.rb +9 -0
- data/lib/jekyll_picture_tag/source_image.rb +60 -44
- data/lib/jekyll_picture_tag/srcsets/basic.rb +29 -7
- data/lib/jekyll_picture_tag/utils.rb +18 -0
- data/lib/jekyll_picture_tag/version.rb +1 -1
- data/readme.md +40 -16
- metadata +67 -20
- data/docs/_layouts/directory.html +0 -32
- data/docs/assets/style.css +0 -31
- data/docs/contributing.md +0 -75
- data/docs/example_presets.md +0 -116
- data/docs/global_configuration.md +0 -173
- data/docs/installation.md +0 -30
- data/docs/notes.md +0 -91
- data/docs/output.md +0 -63
- data/docs/presets.md +0 -309
- data/docs/usage.md +0 -113
data/docs/usage.md
DELETED
@@ -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.
|