jekyll_picture_tag 1.11.0 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/Gemfile +4 -2
- data/docs/Gemfile.lock +14 -12
- 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} +24 -14
- data/docs/index.md +43 -27
- 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/lib/jekyll_picture_tag/instructions/preset.rb +5 -1
- data/lib/jekyll_picture_tag/instructions/set.rb +5 -1
- data/lib/jekyll_picture_tag/version.rb +1 -1
- metadata +55 -14
- data/docs/_layouts/directory.html +0 -32
- data/docs/assets/style.css +0 -31
- data/docs/contributing.md +0 -109
- data/docs/example_presets.md +0 -116
- data/docs/global_configuration.md +0 -173
- data/docs/installation.md +0 -45
- data/docs/notes.md +0 -91
- data/docs/output.md +0 -63
- data/docs/presets.md +0 -391
- data/docs/usage.md +0 -157
@@ -0,0 +1,34 @@
|
|
1
|
+
---
|
2
|
+
sort: 7
|
3
|
+
---
|
4
|
+
|
5
|
+
# Width & Height (Anti-Loading-Jank)
|
6
|
+
|
7
|
+
_Format:_
|
8
|
+
|
9
|
+
```yml
|
10
|
+
dimension_attributes: true | false
|
11
|
+
```
|
12
|
+
|
13
|
+
_Example:_
|
14
|
+
|
15
|
+
```yml
|
16
|
+
dimension_attributes: true
|
17
|
+
```
|
18
|
+
|
19
|
+
_Default:_ `false`
|
20
|
+
|
21
|
+
Prevent page reflow (aka jank) while images are loading, by adding `width` and
|
22
|
+
`height` attributes to the `<img>` tag in the correct aspect ratio.
|
23
|
+
|
24
|
+
For an explanation of why and how you want to do this,
|
25
|
+
[here](https://youtu.be/4-d_SoCHeWE) is a great explanation.
|
26
|
+
|
27
|
+
Caveats:
|
28
|
+
* You need either `width: auto;` or `height: auto;` set in CSS on the `<img>`
|
29
|
+
tags, or they will be stretched.
|
30
|
+
* This works on `<img>` tags and `<picture>` tags when offering images in
|
31
|
+
multiple widths and formats, but it does not work if you are using art
|
32
|
+
direction (in other words, if you have multiple source images). This is
|
33
|
+
because these attributes can only be applied to the `<img>` tag, of which
|
34
|
+
there is exactly one.
|
@@ -0,0 +1,85 @@
|
|
1
|
+
---
|
2
|
+
sort: 3
|
3
|
+
---
|
4
|
+
|
5
|
+
# Width Based Srcsets
|
6
|
+
|
7
|
+
A width based srcset looks like this:
|
8
|
+
|
9
|
+
```html
|
10
|
+
srcset="myimage-800.jpg 800w, myimage-1200.jpg 1200w, myimage-2000.jpg 2000w"
|
11
|
+
```
|
12
|
+
|
13
|
+
It's the default; to use it specify a `widths` setting (or don't, for the
|
14
|
+
default set), and optionally the `sizes` and `size` settings.
|
15
|
+
|
16
|
+
## Widths
|
17
|
+
|
18
|
+
_Format:_ `widths: [integer, integer, (...)]`
|
19
|
+
|
20
|
+
_Example:_ `widths: [600, 800, 1200]`
|
21
|
+
|
22
|
+
_Default_: `[400, 600, 800, 1000]`
|
23
|
+
|
24
|
+
Array of image widths to generate, in pixels.
|
25
|
+
|
26
|
+
## Media Widths
|
27
|
+
|
28
|
+
_Format:_
|
29
|
+
|
30
|
+
```yml
|
31
|
+
media_widths:
|
32
|
+
(media_query name): [integer, integer, (...)]
|
33
|
+
```
|
34
|
+
|
35
|
+
_Example:_
|
36
|
+
|
37
|
+
```yml
|
38
|
+
media_widths:
|
39
|
+
mobile: [400, 600, 800]
|
40
|
+
```
|
41
|
+
|
42
|
+
_Default:_ `widths` setting
|
43
|
+
|
44
|
+
If you are using art direction, there is no sense in generating desktop-size
|
45
|
+
files for your mobile image. You can specify sets of widths to associate with
|
46
|
+
given media queries. If not specified, will use `widths` setting.
|
47
|
+
|
48
|
+
## Sizes
|
49
|
+
|
50
|
+
_Format:_
|
51
|
+
|
52
|
+
```yml
|
53
|
+
sizes:
|
54
|
+
(media preset): (CSS dimension)
|
55
|
+
(...)
|
56
|
+
```
|
57
|
+
|
58
|
+
_Example:_
|
59
|
+
|
60
|
+
```yml
|
61
|
+
sizes:
|
62
|
+
mobile: 80vw
|
63
|
+
tablet: 60vw
|
64
|
+
desktop: 900px
|
65
|
+
```
|
66
|
+
|
67
|
+
Conditional sizes, used to construct the `sizes=` HTML attribute telling the
|
68
|
+
browser how wide your image will be (on the screen) when a given media query
|
69
|
+
is true. CSS dimensions can be given in `px`, `em`, or `vw`. To be used along
|
70
|
+
with a width-based srcset.
|
71
|
+
|
72
|
+
Provide these in order of most restrictive to least restrictive. The browser
|
73
|
+
will choose the first one with an applicable media query.
|
74
|
+
|
75
|
+
You don't have to provide a sizes attribute at all. If you don't, the browser
|
76
|
+
will assume the image is 100% the width of the viewport.
|
77
|
+
|
78
|
+
## Size
|
79
|
+
|
80
|
+
_Format:_ `size: (CSS Dimension)`
|
81
|
+
|
82
|
+
_Example:_ `size: 80vw`
|
83
|
+
|
84
|
+
Unconditional `sizes` setting, to be supplied either alone or after all
|
85
|
+
conditional sizes.
|
@@ -81,9 +81,13 @@ module PictureTag
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def grab_data_file
|
84
|
+
search_data('presets') || search_data('markup_presets') || no_preset
|
85
|
+
end
|
86
|
+
|
87
|
+
def search_data(key)
|
84
88
|
PictureTag.site
|
85
89
|
.data
|
86
|
-
.dig('picture',
|
90
|
+
.dig('picture', key, @name)
|
87
91
|
end
|
88
92
|
|
89
93
|
def no_preset
|
@@ -27,7 +27,7 @@ module PictureTag
|
|
27
27
|
# These are our Media Query presets. It's really just a hash, and there
|
28
28
|
# are no default values, so extracting this to its own class is overkill.
|
29
29
|
def media_presets
|
30
|
-
|
30
|
+
search_data('media_queries') || search_data('media_presets') || {}
|
31
31
|
end
|
32
32
|
|
33
33
|
def source_images
|
@@ -52,6 +52,10 @@ module PictureTag
|
|
52
52
|
|
53
53
|
private
|
54
54
|
|
55
|
+
def search_data(key)
|
56
|
+
PictureTag.site.data.dig('picture', key)
|
57
|
+
end
|
58
|
+
|
55
59
|
def build_source_images
|
56
60
|
source_names = params.source_names
|
57
61
|
media_presets = params.media_presets
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_picture_tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Wierzbowski
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-07-
|
13
|
+
date: 2020-07-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -232,19 +232,60 @@ files:
|
|
232
232
|
- docs/Gemfile
|
233
233
|
- docs/Gemfile.lock
|
234
234
|
- docs/_config.yml
|
235
|
-
- docs/
|
236
|
-
- docs/
|
237
|
-
- docs/contributing.md
|
238
|
-
- docs/
|
239
|
-
- docs/
|
235
|
+
- docs/devs/contributing/code.md
|
236
|
+
- docs/devs/contributing/docs.md
|
237
|
+
- docs/devs/contributing/index.md
|
238
|
+
- docs/devs/contributing/setup.md
|
239
|
+
- docs/devs/contributing/testing.md
|
240
|
+
- docs/devs/index.md
|
241
|
+
- docs/devs/releases.md
|
240
242
|
- docs/index.md
|
241
|
-
- docs/
|
242
|
-
- docs/
|
243
|
-
- docs/
|
244
|
-
- docs/
|
245
|
-
- docs/
|
246
|
-
- docs/
|
247
|
-
- docs/
|
243
|
+
- docs/users/configuration/cdn.md
|
244
|
+
- docs/users/configuration/directories.md
|
245
|
+
- docs/users/configuration/disable.md
|
246
|
+
- docs/users/configuration/fast_build.md
|
247
|
+
- docs/users/configuration/ignore_missing.md
|
248
|
+
- docs/users/configuration/index.md
|
249
|
+
- docs/users/configuration/kramdown_fix.md
|
250
|
+
- docs/users/configuration/relative_urls.md
|
251
|
+
- docs/users/configuration/suppress_warnings.md
|
252
|
+
- docs/users/index.md
|
253
|
+
- docs/users/installation.md
|
254
|
+
- docs/users/liquid_tag/argument_reference/alternate_images.md
|
255
|
+
- docs/users/liquid_tag/argument_reference/attributes.md
|
256
|
+
- docs/users/liquid_tag/argument_reference/base_image.md
|
257
|
+
- docs/users/liquid_tag/argument_reference/crop.md
|
258
|
+
- docs/users/liquid_tag/argument_reference/link.md
|
259
|
+
- docs/users/liquid_tag/argument_reference/preset.md
|
260
|
+
- docs/users/liquid_tag/argument_reference/readme.md
|
261
|
+
- docs/users/liquid_tag/examples.md
|
262
|
+
- docs/users/liquid_tag/index.md
|
263
|
+
- docs/users/notes/git_lfs.md
|
264
|
+
- docs/users/notes/github_pages.md
|
265
|
+
- docs/users/notes/html_attributes.md
|
266
|
+
- docs/users/notes/index.md
|
267
|
+
- docs/users/notes/input_checking.md
|
268
|
+
- docs/users/notes/kramdown_bug.md
|
269
|
+
- docs/users/notes/managing_images.md
|
270
|
+
- docs/users/notes/migration.md
|
271
|
+
- docs/users/presets/cropping.md
|
272
|
+
- docs/users/presets/default.md
|
273
|
+
- docs/users/presets/examples.md
|
274
|
+
- docs/users/presets/fallback_image.md
|
275
|
+
- docs/users/presets/html_attributes.md
|
276
|
+
- docs/users/presets/image_formats.md
|
277
|
+
- docs/users/presets/image_quality.md
|
278
|
+
- docs/users/presets/index.md
|
279
|
+
- docs/users/presets/link_source.md
|
280
|
+
- docs/users/presets/markup_formats/fragments.md
|
281
|
+
- docs/users/presets/markup_formats/javascript_friendly.md
|
282
|
+
- docs/users/presets/markup_formats/readme.md
|
283
|
+
- docs/users/presets/markup_formats/standard_html.md
|
284
|
+
- docs/users/presets/media_queries.md
|
285
|
+
- docs/users/presets/nomarkdown_override.md
|
286
|
+
- docs/users/presets/pixel_ratio_srcsets.md
|
287
|
+
- docs/users/presets/width_height_attributes.md
|
288
|
+
- docs/users/presets/width_srcsets.md
|
248
289
|
- jekyll-picture-tag.gemspec
|
249
290
|
- jekyll_picture_tag.gemspec
|
250
291
|
- lib/jekyll-picture-tag.rb
|
@@ -1,32 +0,0 @@
|
|
1
|
-
---
|
2
|
-
layout: default
|
3
|
-
---
|
4
|
-
|
5
|
-
<link href="{{ site.baseurl }}/assets/style.css" rel="stylesheet" type="text/css">
|
6
|
-
|
7
|
-
<ul class="directory">
|
8
|
-
<li><a href="{{ site.baseurl }}/">Quick Start</a></li>
|
9
|
-
<li><a href="{{ site.baseurl }}/installation">Installation</a></li>
|
10
|
-
<li><a href="{{ site.baseurl }}/usage">Usage</a></li>
|
11
|
-
<li><a href="{{ site.baseurl }}/global_configuration">Global Settings</a></li>
|
12
|
-
<li><a href="{{ site.baseurl }}/presets">Writing Presets</a></li>
|
13
|
-
<li><a href="{{ site.baseurl }}/example_presets">Example Presets</a></li>
|
14
|
-
<li><a href="{{ site.baseurl }}/output">Output Formats</a></li>
|
15
|
-
<li><a href="{{ site.baseurl }}/notes">Notes and FAQ</a></li>
|
16
|
-
<li><a href="{{ site.baseurl }}/contributing">Contributing</a></li>
|
17
|
-
<li><a href="{{ site.baseurl }}/releases">Release History</a></li>
|
18
|
-
</ul>
|
19
|
-
|
20
|
-
<hr />
|
21
|
-
|
22
|
-
{{ content }}
|
23
|
-
|
24
|
-
<script>
|
25
|
-
const navItems = Array.from(document.querySelectorAll('ul.directory li'))
|
26
|
-
const currentPath = window.location.toString()
|
27
|
-
const activeItem = navItems.find(function(item) {
|
28
|
-
return item.firstChild.href == currentPath
|
29
|
-
})
|
30
|
-
|
31
|
-
activeItem.classList.add('active')
|
32
|
-
</script>
|
data/docs/assets/style.css
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
@media (max-width: 600px) {
|
2
|
-
ul.directory {
|
3
|
-
flex-direction: column;
|
4
|
-
align-items: center;
|
5
|
-
}
|
6
|
-
}
|
7
|
-
|
8
|
-
ul.directory {
|
9
|
-
display: flex;
|
10
|
-
flex-wrap: wrap;
|
11
|
-
justify-content: center;
|
12
|
-
list-style: none;
|
13
|
-
padding-left: 0;
|
14
|
-
flex-grow: 0;
|
15
|
-
}
|
16
|
-
|
17
|
-
ul.directory li {
|
18
|
-
margin: .3em;
|
19
|
-
}
|
20
|
-
|
21
|
-
ul.directory a {
|
22
|
-
line-height: 2;
|
23
|
-
padding: 8px 20px;
|
24
|
-
}
|
25
|
-
|
26
|
-
li.active a {
|
27
|
-
border-radius: 3px;
|
28
|
-
background-color: #007edf;
|
29
|
-
color: #fff;
|
30
|
-
box-shadow: 2px 2px 3px #999;
|
31
|
-
}
|
data/docs/contributing.md
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
---
|
2
|
-
---
|
3
|
-
# Contributing
|
4
|
-
|
5
|
-
Bug reports, feature requests, and feedback are very welcome, either through github issues or via
|
6
|
-
email: robert@buchberger.cc
|
7
|
-
|
8
|
-
Pull requests are encouraged! I'm happy to answer questions and provide assistance along the way.
|
9
|
-
Don't let any of the recommendations/requests in this guide stop you from submitting one.
|
10
|
-
|
11
|
-
## Setup
|
12
|
-
|
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
|
-
```
|
20
|
-
|
21
|
-
## Testing
|
22
|
-
|
23
|
-
You probably only need to use docker if it's inconvenient to install ImageMagick 7.
|
24
|
-
|
25
|
-
### Bare Metal
|
26
|
-
|
27
|
-
`rake test` runs the test suite (both unit tests and integration tests). Ignore the mini_magick
|
28
|
-
`method redefined` warnings (unless you know how to fix them?)
|
29
|
-
|
30
|
-
`rake unit` runs just the unit tests, while `rake integration` runs the integration tests. The unit
|
31
|
-
test coverage isn't stellar, but both unit and integration tests together hit 100%.
|
32
|
-
|
33
|
-
Speaking of coverage, simplecov is set up -- you'll get a measurement of coverage in the test output
|
34
|
-
and a nice report in the `coverage` directory. I'd like to move to mutation based coverage testing,
|
35
|
-
but that's a project for another day.
|
36
|
-
|
37
|
-
The tests do output a few images to the `/tmp/` directory, which I'm pretty sure means it won't work
|
38
|
-
on Windows. This is fixable if there is a need, so if that gets in your way just ask.
|
39
|
-
|
40
|
-
`rake rubocop` checks code formatting, `rake rubocop:auto_correct` will try to fix any rubocop
|
41
|
-
issues, if possible.
|
42
|
-
|
43
|
-
`rake` will run all tests and rubocop.
|
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
|
-
|
55
|
-
## Docs
|
56
|
-
|
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:
|
61
|
-
|
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/`
|
67
|
-
|
68
|
-
## Code Guidelines
|
69
|
-
|
70
|
-
* Generally, go for straightforward and readable rather than terse and clever. I'm not actually a
|
71
|
-
very good programmer; I need simple code that's easy to understand.
|
72
|
-
|
73
|
-
* Refactoring is welcome, especially in the name of the previous point.
|
74
|
-
|
75
|
-
* I'm very reluctant to introduce breaking changes to configuration settings. This rule isn't
|
76
|
-
absolute, but I'm not going to do it without a good reason.
|
77
|
-
|
78
|
-
* I've been using 80 characters for code and 100 characters for documentation.
|
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
|
-
|
86
|
-
## Hard rules
|
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
|
-
|
92
|
-
* Liquid tag syntax can only be extended; no breaking changes. I'm not willing to force
|
93
|
-
users to dig through their entire site and change every picture tag in order to update to the
|
94
|
-
latest version.
|
95
|
-
|
96
|
-
* Maintain "no configuration required" - a new user must be able to add JPT to their gemfile, bundle
|
97
|
-
install, and start writing picture tags in their site without touching a yml file.
|
98
|
-
|
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
|
105
|
-
|
106
|
-
### Thanks!
|
107
|
-
|
108
|
-
As I said, don't let any of the rules & guidelines scare you away. They're the rules for merging
|
109
|
-
into master, not submitting a pull request. I'm thrilled to receive any help at all.
|
data/docs/example_presets.md
DELETED
@@ -1,116 +0,0 @@
|
|
1
|
-
---
|
2
|
-
---
|
3
|
-
# /_data/picture.yml
|
4
|
-
|
5
|
-
These are example settings- I mostly made them up off the top of my head. You
|
6
|
-
probably don't want to just copy-paste them. The full documentation
|
7
|
-
for these can be found [here]({{ site.baseurl }}/presets).
|
8
|
-
|
9
|
-
```yml
|
10
|
-
|
11
|
-
# Media presets are just named css media queries, used in several places:
|
12
|
-
# - To specify alternate source images (for art direction)
|
13
|
-
# - To build the 'sizes' attribute
|
14
|
-
# - When given alternate source images, specify which sizes to generate.
|
15
|
-
media_presets:
|
16
|
-
wide_desktop: 'min-width: 1801px'
|
17
|
-
desktop: 'max-width: 1800px'
|
18
|
-
wide_tablet: 'max-width: 1200px'
|
19
|
-
tablet: 'max-width: 900px'
|
20
|
-
mobile: 'max-width: 600px'
|
21
|
-
|
22
|
-
# Markup presets allow you to group settings together, and select one of them by
|
23
|
-
# name in your jekyll tag. All settings are optional.
|
24
|
-
markup_presets:
|
25
|
-
|
26
|
-
default:
|
27
|
-
# What form the output markup should take:
|
28
|
-
markup: auto
|
29
|
-
|
30
|
-
# Must be an array, and order matters. Defaults to just 'original', which
|
31
|
-
# does what you'd expect.
|
32
|
-
formats: [webp, original]
|
33
|
-
|
34
|
-
# Must be an array: which image sizes (width in pixels) to generate (unless
|
35
|
-
# directed otherwise below). If not specified, will use sensible default
|
36
|
-
# values.
|
37
|
-
widths: [200, 400, 800, 1600]
|
38
|
-
|
39
|
-
# Alternate source images (for art direction) are associated with media
|
40
|
-
# query presets. Here, you can optionally specify a different set of sizes
|
41
|
-
# to generate for those alternate source images. This is how you avoid
|
42
|
-
# generating a 1600 pixel wide image that's only shown on narrow screens.
|
43
|
-
# Must be arrays.
|
44
|
-
media_widths:
|
45
|
-
mobile: [200, 400, 600]
|
46
|
-
tablet: [400, 600, 800]
|
47
|
-
|
48
|
-
# For building the 'sizes' attribute on img and source tags. specifies how
|
49
|
-
# wide the image will be when a given media query is true. Note that every
|
50
|
-
# source in a given <picture> tag will have the same associated sizes
|
51
|
-
# attribute.
|
52
|
-
sizes:
|
53
|
-
mobile: 100vw
|
54
|
-
tablet: 80vw
|
55
|
-
|
56
|
-
# Specifies an optional, unconditional size attribute. Can be given alone,
|
57
|
-
# or if specified in combination with 'sizes' below, will be given last
|
58
|
-
# (when no media queries apply).
|
59
|
-
size: 800px
|
60
|
-
|
61
|
-
# Specify the properties of the fallback image. If not specified, will
|
62
|
-
# return a 900 pixel wide image in the original format.
|
63
|
-
fallback_width: 800
|
64
|
-
fallback_format: original
|
65
|
-
|
66
|
-
# Add HTML attributes. 'parent' will go to the <picture> tag if it's there,
|
67
|
-
# otherwise the 'img' tag.
|
68
|
-
attributes:
|
69
|
-
parent: 'data-downloadable="true"'
|
70
|
-
picture: 'class="awesome" data-volume="11"'
|
71
|
-
img: 'class="some-other-class"'
|
72
|
-
a: 'class="image-link"'
|
73
|
-
|
74
|
-
# This will wrap images in a link to the original source image. Obviously
|
75
|
-
# your source images will need to be part of the deployed site for this to
|
76
|
-
# work. If you have issues such as mangled HTML or extra {::nomarkdown}
|
77
|
-
# tags floating around, see docs/notes.md
|
78
|
-
link_source: true
|
79
|
-
|
80
|
-
# This is an example of how you would create a 'multiplier' based srcset;
|
81
|
-
# useful when an image will always be the same size on all screens (icons,
|
82
|
-
# graphics, thumbnails, etc), but you'd like to supply higher resolution
|
83
|
-
# images to devices with higher pixel ratios.
|
84
|
-
icon:
|
85
|
-
base_width: 20 # How wide the 1x image should be
|
86
|
-
pixel_ratios: [1, 1.5, 2]
|
87
|
-
fallback_width: 20
|
88
|
-
attributes:
|
89
|
-
img: 'class="icon"'
|
90
|
-
|
91
|
-
# Here's an example of how you'd configure jekyll-picture-tag to work with
|
92
|
-
# something like lazyload:
|
93
|
-
# https://github.com/verlok/lazyload
|
94
|
-
lazy:
|
95
|
-
# data_auto gives you data-src, data-srcset, and data-sizes instead of src,
|
96
|
-
# srcset, and sizes:
|
97
|
-
markup: data_auto
|
98
|
-
formats: [webp, original]
|
99
|
-
widths: [200, 400, 600, 800]
|
100
|
-
noscript: true # add a fallback image inside a <noscript> tag.
|
101
|
-
attributes:
|
102
|
-
img: class="lazy"
|
103
|
-
|
104
|
-
# This is an example of how you'd get generated image and a URL, and nothing
|
105
|
-
# else.
|
106
|
-
direct:
|
107
|
-
markup: direct_url
|
108
|
-
fallback_format: webp # Default original
|
109
|
-
fallback_width: 600 # Default 800
|
110
|
-
|
111
|
-
# Here's a naked srcset. Doesn't even give you the surrounding quotes.
|
112
|
-
srcset:
|
113
|
-
markup: naked_srcset
|
114
|
-
formats: [webp] # must be an array, even if it only has one item
|
115
|
-
|
116
|
-
```
|