jekyll_picture_tag 1.7.0 → 1.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/.solargraph.yml +15 -0
  4. data/.travis.yml +4 -7
  5. data/Dockerfile +9 -0
  6. data/docs/Gemfile +4 -0
  7. data/docs/Gemfile.lock +249 -0
  8. data/docs/_config.yml +13 -0
  9. data/docs/_layouts/directory.html +32 -0
  10. data/docs/assets/style.css +31 -0
  11. data/{contributing.md → docs/contributing.md} +57 -15
  12. data/docs/{examples/_data/picture.yml → example_presets.md} +36 -25
  13. data/docs/global_configuration.md +61 -3
  14. data/docs/index.md +114 -0
  15. data/docs/installation.md +36 -21
  16. data/docs/migration.md +4 -0
  17. data/docs/notes.md +64 -58
  18. data/docs/output.md +63 -0
  19. data/docs/presets.md +175 -221
  20. data/docs/releases.md +64 -0
  21. data/docs/usage.md +91 -79
  22. data/jekyll_picture_tag.gemspec +3 -1
  23. data/lib/jekyll_picture_tag.rb +27 -10
  24. data/lib/jekyll_picture_tag/defaults/global.yml +2 -0
  25. data/lib/jekyll_picture_tag/defaults/presets.yml +2 -0
  26. data/lib/jekyll_picture_tag/generated_image.rb +105 -19
  27. data/lib/jekyll_picture_tag/instructions.rb +1 -0
  28. data/lib/jekyll_picture_tag/instructions/arg_splitter.rb +68 -0
  29. data/lib/jekyll_picture_tag/instructions/configuration.rb +47 -11
  30. data/lib/jekyll_picture_tag/instructions/html_attributes.rb +14 -8
  31. data/lib/jekyll_picture_tag/instructions/preset.rb +34 -14
  32. data/lib/jekyll_picture_tag/instructions/set.rb +18 -8
  33. data/lib/jekyll_picture_tag/instructions/tag_parser.rb +59 -69
  34. data/lib/jekyll_picture_tag/output_formats/basic.rb +35 -6
  35. data/lib/jekyll_picture_tag/output_formats/data_attributes.rb +4 -1
  36. data/lib/jekyll_picture_tag/router.rb +16 -0
  37. data/lib/jekyll_picture_tag/source_image.rb +6 -1
  38. data/lib/jekyll_picture_tag/srcsets/basic.rb +45 -19
  39. data/lib/jekyll_picture_tag/srcsets/pixel_ratio.rb +1 -3
  40. data/lib/jekyll_picture_tag/srcsets/width.rb +1 -1
  41. data/lib/jekyll_picture_tag/utils.rb +18 -0
  42. data/lib/jekyll_picture_tag/version.rb +1 -1
  43. data/readme.md +43 -200
  44. metadata +49 -13
  45. data/docs/examples/_config.yml +0 -10
  46. data/docs/examples/post.md +0 -46
  47. data/docs/readme.md +0 -23
@@ -0,0 +1,63 @@
1
+ ---
2
+ ---
3
+
4
+ # Output Formats
5
+
6
+ This is a listing of the various text arrangements that JPT can give you. Select one by setting
7
+ `markup:` in the relevant [markup preset]({{ site.baseurl }}/presets).
8
+
9
+ Example:
10
+
11
+ ```yml
12
+ # /_data/picture.yml
13
+
14
+ markup_presets:
15
+ my_preset:
16
+ markup: data_auto
17
+ ```
18
+
19
+ ## Standard HTML:
20
+
21
+ - **`picture`:** `<picture>` element surrounding a `<source>` tag for each required srcset, and a
22
+ fallback `<img>`.
23
+
24
+ - **`img`:** output a single `<img>` tag with a `srcset` entry.
25
+
26
+ - **`auto`:** Supply an img tag when you have only one srcset, otherwise supply a picture tag.
27
+
28
+ ## Javascript Friendly:
29
+
30
+ - **`data_picture`, `data_img`, `data_auto`:** Analogous to their counterparts above, but instead of
31
+ `src`, `srcset`, and `sizes`, you get `data-src`, `data-srcset`, and `data-sizes`. This allows you
32
+ to use javascript for things like [lazy loading](https://github.com/verlok/lazyload).
33
+
34
+ #### Special Options
35
+
36
+ The following preset configuration settings only apply to the `data_` output formats.
37
+
38
+ - **noscript**
39
+
40
+ _Format:_ `noscript: true|false`
41
+
42
+ _Default:_ `false`
43
+
44
+ Include a basic `img` fallback within a `<noscript>` tag, giving your javascript-disabled users
45
+ something to look at.
46
+
47
+ - **data_sizes**
48
+
49
+ _Format:_ `data_sizes: true|false`
50
+
51
+ _Default:_ `true`
52
+
53
+ This option sets whether you would like JPT's auto-generated sizes to be returned as a
54
+ `data-sizes` attribute or a normal `sizes` attribute. (Useful for interfacing nicely with all the
55
+ various JS image libraries out there.)
56
+
57
+ ## Fragments:
58
+
59
+ - **`direct_url`**: Generates an image and returns only its url. Uses `fallback_` properties (width
60
+ and format).
61
+
62
+ - **`naked_srcset`**: Builds a srcset and nothing else (not even the surrounding quotes). Note that the
63
+ (image) `format` setting must still be an array, even if you only give it one value.
@@ -1,110 +1,62 @@
1
+ ---
2
+ ---
3
+
1
4
  # Writing Presets
2
5
 
3
- Presets are stored in `_data/picture.yml`, to avoid cluttering `_config.yml`. You will have to
4
- create this file, and probably the `_data/` directory as well.
6
+ Presets are named collections of settings that determine basically everything about JPT's output.
7
+ They are stored in `_data/picture.yml`, to avoid cluttering `_config.yml`. You will have to create
8
+ this file, and probably the `_data/` directory as well.
5
9
 
6
- All settings are optional, moderately sensible defaults have been implemented.
10
+ Here's an [example data file]({{ site.baseurl }}/example_presets).
7
11
 
8
- ## Required Knowledge
12
+ Any settings which are specific to particular output formats are documented on the [output
13
+ formats]({{site.baseurl}}/output) page.
9
14
 
10
- If you don't understand responsive images, you won't know what to do with these settings. Jekyll
11
- Picture tag is basically a programmatic implementation of the [MDN Responsive Images
12
- guide](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images).
15
+ ## Required Knowledge
13
16
 
14
- If you don't know the difference between resolution switching and art direction, stop now and read it
17
+ If you don't know the difference between resolution switching and art direction, stop now and read
18
+ the [MDN Responsive Images
19
+ guide](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images)
15
20
  in detail. Ideally, play around with a basic HTML file, a few test images, and a few different
16
21
  browser widths until you understand it.
17
22
 
18
- ## Example settings
19
-
20
- A more thorough example can be found under `docs/examples/_data/picture.yml`.
21
-
22
- ```yml
23
-
24
- # _data/picture.yml
25
-
26
- media_presets:
27
- wide_desktop: 'min-width: 1801px'
28
- desktop: 'max-width: 1800px'
29
- wide_tablet: 'max-width: 1200px'
30
- tablet: 'max-width: 900px'
31
- mobile: 'max-width: 600px'
32
-
33
- markup_presets:
34
- default:
35
- formats: [webp, original]
36
- widths: [200, 400, 800, 1600]
37
- media_widths:
38
- mobile: [200, 400, 600]
39
- tablet: [400, 600, 800]
40
- size: 800px
41
- sizes:
42
- mobile: 100vw
43
- desktop: 60vw
44
- attributes:
45
- picture: 'class="awesome" data-volume="11"'
46
- img: 'class="some-other-class"'
47
-
48
- icon:
49
- base-width: 20
50
- pixel_ratios: [1, 1.5, 2]
51
-
52
- lazy:
53
- markup: data_auto
54
- formats: [webp, original]
55
- widths: [200, 400, 600, 800]
56
- noscript: true
57
- attributes:
58
- img: class="lazy"
59
-
60
- ```
61
-
62
23
  ## Media Presets
63
24
 
64
- *Format:*
25
+ _Format:_
65
26
 
66
27
  ```yml
67
28
  media_presets:
68
- (name): (css media query)
69
29
  (name): (css media query)
70
30
  (name): (css media query)
71
31
  (...)
72
32
 
73
33
  ```
74
34
 
75
- *Example:*
35
+ _Example:_
76
36
 
77
37
  ```yml
78
38
  media_presets:
79
- desktop: 'min-width: 1200px'
39
+ desktop: "min-width: 1200px"
80
40
  ```
81
41
 
82
- These are named media queries for use in a few different places.
83
-
84
- Keys are names by which you can refer to the media queries supplied as their respective values.
85
- These are used for specifying alternate source images in your liquid tag, and for building the
86
- 'sizes' attribute within your presets. Quotes are required around the media
87
- queries, because yml gets confused by free colons.
42
+ These are named media queries for use in a few different places: specifying alternate source images
43
+ in your liquid tag, building the 'sizes' attribute within your presets, and in a few configuration
44
+ settings. Quotes are recommended around the media queries, because yml gets confused by colons.
88
45
 
89
46
  ## Markup Presets
90
47
 
91
- *Format:*
48
+ _Format:_
92
49
 
93
50
  ```yml
94
51
  markup_presets:
95
52
  (name):
96
- (option): (setting)
97
- (option): (setting)
98
- (option): (setting)
99
- (...)
100
- (another name):
101
- (option): (setting)
102
53
  (option): (setting)
103
54
  (option): (setting)
104
55
  (...)
56
+ (...)
105
57
  ```
106
58
 
107
- *Example:*
59
+ _Example:_
108
60
 
109
61
  ```yml
110
62
  markup_presets:
@@ -119,73 +71,41 @@ markup_presets:
119
71
  noscript: true
120
72
  ```
121
73
 
122
- These are the 'presets' from previous versions, with different structure. Each entry is a
123
- pre-defined collection of settings to build a given chunk of HTML and its respective images. You
124
- can select one as the first argument given to the tag:
74
+ Each entry is a pre-defined collection of settings to build a given chunk of text (usually HTML) and
75
+ its respective images. You can select one as the first argument given to the tag:
125
76
 
77
+ {% raw %}
126
78
  `{% picture my-preset image.jpg %}`
79
+ {% endraw %}
127
80
 
128
- The `default` preset will be used if none is specified. A preset name can't contain the `.`, `:`,
129
- or `/` characters.
81
+ The `default` preset will be used if none is specified. A preset name can't contain a `.` (period).
130
82
 
131
- #### A Note on srcsets, for the bad kids who didn't do the required reading.
83
+ #### A Note on srcsets
132
84
 
133
- There are 2 srcset formats, one based on providing widths, the other based on providing multipliers.
85
+ For images that are different sizes on different screens (most images), use a width-based srcset
86
+ (which is the default). Specify a `widths` setting (or don't, for the default set), and optionally
87
+ the `sizes` and `size` settings.
134
88
 
135
- Width based srcsets look like this: `srcset="img.jpg 600w, img2.jpg 800w, img3.jpg 1000w"`. The
136
- `(number)w` tells the browser how wide that image file is. Browsers are smart, they know their
137
- device's pixel ratio, so in combination with the sizes attribute (if given, otherwise it assumes the
138
- image will be 100vw) they can select the best-fitting image for the space it will fill on the screen. This is generally the one you want to use.
89
+ Use a multiplier-based srcset when the image will always be the same size, regardless of screen
90
+ width (thumbnails and icons). To use a multiplier-based srcset, set `pixel_ratios` and `base_width`.
139
91
 
140
- Multiplier based srcsets look like this: `srcset="img.jpg 1x, img2.jpg 1.5x, img3.jpg 3x"`. The
141
- browser is less smart here; it looks at its own device's pixel ratio, compares it to the given
142
- multiplier, and picks the closest one. It doesn't consider anything else at all. Multiplier based
143
- srcsets are best used when the image will always be the same size, on all screen sizes.
92
+ ### Settings reference
144
93
 
145
- To use a width based srcset in a preset, specify a `widths` setting (or don't, for the default), and
146
- optionally the `sizes` and `size` settings.
94
+ - **Markup format**
147
95
 
148
- To use a multiplier based srcset, set `pixel_ratios` and `base_width`.
96
+ _Format:_ `markup: (setting)`
149
97
 
150
- ### Markup preset settings
98
+ _Default_: `auto`
151
99
 
152
- * **Markup format**
100
+ Defines what format the generated text will take. They are documented [here]({{ site.baseurl }}/output).
153
101
 
154
- *Format:* `markup: (setting)`
155
-
156
- *Default*: `auto`
157
-
158
- Defines what format the generated HTML will take. Here are your options:
159
-
160
- * `picture`: `<picture>` element surrounding a `<source>` tag for each required srcset, and a
161
- fallback `<img>`.
162
- * `img`: output a single `<img>` tag with a `srcset` entry.
163
- * `auto`: Supply an img tag when you have only one srcset, otherwise supply a picture tag.
164
- * `data_picture`, `data_img`, `data_auto`: Analogous to their counterparts,
165
- but instead of `src`, `srcset`, and `sizes`, you get `data-src`, `data-srcset`, and
166
- `data-sizes`. This allows you to use javascript for things like [lazy loading](https://github.com/verlok/lazyload)
167
- * `direct_url`: Generates an image and returns only its url. Uses `fallback_` properties (width
168
- and format)
169
- * `naked_srcset`: Builds a srcset and nothing else (not even the surrounding quotes). Useful with
170
- libraries requiring more complex or customized markup. Note that the (image) `format` setting
171
- must still be an array, even if you can only give it one value.
172
-
173
102
  * **Image Formats**
174
103
 
175
- *Format:* `format: [format1, format2, (...)]`
104
+ _Format:_ `format: [format1, format2, (...)]`
176
105
 
177
- *Example:* `format: [webp, original]`
106
+ _Example:_ `format: [webp, original]`
178
107
 
179
- *Default*: `original`
180
-
181
- *Supported formats are anything which imagemagick supports, including the
182
- following:*
183
- * jpg/jpeg
184
- * png
185
- * gif
186
- * webp
187
- * jxr
188
- * jp2
108
+ _Default_: `original`
189
109
 
190
110
  Array (yml sequence) of the image formats you'd like to generate, in decreasing order of
191
111
  preference. Browsers will render the first format they find and understand, so **If you put jpg
@@ -193,106 +113,84 @@ To use a multiplier based srcset, set `pixel_ratios` and `base_width`.
193
113
  webp, you must have an imagemagick webp delegate installed. (Most package managers just name it
194
114
  'webp')
195
115
 
196
- * **widths**
116
+ _Supported formats are anything which imagemagick supports, and has an installed delegate. See a
117
+ list by running `$ convert --version`_
118
+
119
+ * **Widths**
197
120
 
198
- *Format:* `widths: [integer, integer, (...)]`
121
+ _Format:_ `widths: [integer, integer, (...)]`
199
122
 
200
- *Example:* `widths: [600, 800, 1200]`
123
+ _Example:_ `widths: [600, 800, 1200]`
201
124
 
202
- *Default*: `[400, 600, 800, 1000]`
125
+ _Default_: `[400, 600, 800, 1000]`
203
126
 
204
- Array of image widths to generate, in pixels. For use when you want a size-based srcset
127
+ Array of image widths to generate, in pixels. For use when you want a width-based srcset
205
128
  (`srcset="img.jpg 800w, img2.jpg 1600w"`).
206
129
 
207
- * **media_widths**
130
+ * **Media_widths**
208
131
 
209
- *Format:*
132
+ _Format:_
210
133
 
211
- ```yml
212
- media_widths:
213
- (media preset name): [integer, integer, (...)]
214
- ```
134
+ ```yml
135
+ media_widths:
136
+ (media preset name): [integer, integer, (...)]
137
+ ```
215
138
 
216
- *Example:*
139
+ _Example:_
217
140
 
218
- ```yml
219
- media_widths:
220
- mobile: [400, 600, 800]
221
- ```
141
+ ```yml
142
+ media_widths:
143
+ mobile: [400, 600, 800]
144
+ ```
222
145
 
223
- *Default:* Widths setting
146
+ _Default:_ Widths setting
224
147
 
225
148
  If you are using art direction, there is no sense in generating desktop-size files for your mobile
226
149
  image. You can specify sets of widths to associate with given media queries. If not specified,
227
150
  will use `widths` setting.
228
151
 
229
- * **Fallback Width**
230
-
231
- *Format:* `fallback_width: (integer)`
232
-
233
- *Example:* `fallback_width: 800`
234
-
235
- *Default*: `800`
236
-
237
- Width of the fallback image.
238
-
239
- * **Fallback Image**
240
-
241
- *Format:* `fallback_format: (format)`
242
-
243
- *Example:* `fallback_format: jpg`
152
+ * **Sizes**
244
153
 
245
- *Default*: `original`
154
+ _Format:_
246
155
 
247
- Format of the fallback image
156
+ ```yml
157
+ sizes:
158
+ (media preset): (CSS dimension)
159
+ (...)
160
+ ```
248
161
 
249
- * **Sizes**
162
+ _Example:_
250
163
 
251
- *Format:*
252
- ```yml
253
- sizes:
254
- (media preset): (CSS dimension)
255
- (media preset): (CSS dimension)
256
- (media preset): (CSS dimension)
257
- (...)
258
- ```
259
-
260
- *Example:*
261
- ```yml
262
- sizes:
263
- mobile: 80vw
264
- tablet: 60vw
265
- desktop: 900px
266
- ```
164
+ ```yml
165
+ sizes:
166
+ mobile: 80vw
167
+ tablet: 60vw
168
+ desktop: 900px
169
+ ```
267
170
 
268
171
  Conditional sizes, used to construct the `sizes=` HTML attribute telling the browser how wide your
269
172
  image will be (on the screen) when a given media query is true. CSS dimensions can be given in
270
- `px`, `em`, or `vw`. To be used along with a width based srcset.
173
+ `px`, `em`, or `vw`. To be used along with a width-based srcset.
271
174
 
272
- Provide these in order of most restrictive to least restrictive. The browser will choose the
175
+ Provide these in order of most restrictive to least restrictive. The browser will choose the
273
176
  first one with an applicable media query.
274
177
 
275
178
  You don't have to provide a sizes attribute at all. If you don't, the browser will assume the
276
179
  image is 100% the width of the viewport.
277
180
 
278
- The same sizes attribute is used for every source tag in a given picture tag. This causes some
279
- redundant markup, specifying sizes for situations when an image will never be rendered, but it
280
- keeps things a bit simpler.
281
-
282
181
  * **Size**
283
182
 
284
- *Format:* `size: (CSS Dimension)`
183
+ _Format:_ `size: (CSS Dimension)`
285
184
 
286
- *Example:* `size: 80vw`
185
+ _Example:_ `size: 80vw`
287
186
 
288
- Unconditional image width to give the browser (by way of the html sizes attribute), to be supplied
289
- either alone or after all conditional sizes.
187
+ Unconditional `sizes` setting, to be supplied either alone or after all conditional sizes.
290
188
 
291
189
  * **Pixel Ratios**
292
190
 
293
- *Format:* `pixel_ratios: [number, number, number (...)]`
191
+ _Format:_ `pixel_ratios: [number, number, number (...)]`
294
192
 
295
- *Example:* `pixel_ratios: [1, 1.5, 2]`
193
+ _Example:_ `pixel_ratios: [1, 1.5, 2]`
296
194
 
297
195
  Array of images to construct, given in multiples of the base width. If you set this, you must also
298
196
  give a `base_width`.
@@ -301,36 +199,87 @@ To use a multiplier based srcset, set `pixel_ratios` and `base_width`.
301
199
 
302
200
  * **Base Width**
303
201
 
304
- *Format:* `base_width: integer`
202
+ _Format:_ `base_width: integer`
305
203
 
306
- *Example:* `base_width: 100`
204
+ _Example:_ `base_width: 100`
307
205
 
308
206
  When using pixel ratios, you must supply a base width. This sets how wide the 1x image should be.
309
207
 
208
+ * **Crop & Media Crop**
209
+
210
+ _Format:_
211
+
212
+ ```yml
213
+ crop: (geometery)
214
+ media_crop:
215
+ (media_preset): (geometry)
216
+ (media_preset): (geometry)
217
+ (...)
218
+ ```
219
+
220
+ _Example:_
221
+
222
+ ```yml
223
+ crop: 16:9
224
+ media_crop:
225
+ tablet: 3:2
226
+ mobile: 1:1
227
+ ```
228
+
229
+ **Check the [ installation guide ](installation) before using this feature.**
230
+
231
+ Crop geometry, given either generally or for specific media presets. The hierarchy is:
232
+ `tag argument` > `media_crop:` > `crop:`.
233
+
234
+ This setting accepts the same arguments as the `crop geometry` [tag parameter](usage).
235
+
236
+
237
+ * **Gravity & Media_gravity**
238
+
239
+ ```yml
240
+ crop: (gravity)
241
+ media_crop:
242
+ (media_preset): (gravity)
243
+ (media_preset): (gravity)
244
+ (...)
245
+ ```
246
+
247
+ _Example:_
248
+
249
+ ```yml
250
+ crop: north
251
+ media_crop:
252
+ tablet: east
253
+ mobile: southwest
254
+ ```
255
+
256
+ Crop gravity, given either generally or for specific media presets. The hierarchy is:
257
+ `tag argument` > `media_crop:` > `crop:` > `center` (default).
258
+
259
+ This setting accepts the same arguments as the `crop gravity` [tag parameter](usage).
260
+
310
261
  * **Quality**
311
262
 
312
- *Format:* `quality: integer <= 100`
263
+ _Format:_ `quality: 0 <= integer <= 100`
313
264
 
314
- *Example:* `quality: 80`
265
+ _Example:_ `quality: 80`
315
266
 
316
- *Default:* `75`
267
+ _Default:_ `75`
317
268
 
318
269
  This allows you to specify an image compression level for all image formats (where it makes sense,
319
270
  anyway). The next option allows you to set them per format.
320
271
 
321
272
  * **Format Quality**
322
273
 
323
- *Format:*
274
+ _Format:_
324
275
 
325
276
  ```yml
326
277
  format_quality:
327
- (format): integer <= 100
328
- (format): integer <= 100
329
- (format): integer <= 100
278
+ (format): 0 <= integer <= 100
330
279
  (...)
331
280
  ```
332
281
 
333
- *Example:*
282
+ _Example:_
334
283
 
335
284
  ```
336
285
  format_quality:
@@ -339,26 +288,24 @@ To use a multiplier based srcset, set `pixel_ratios` and `base_width`.
339
288
  webp: 55
340
289
  ```
341
290
 
342
- *Default:* quality setting (above)
291
+ _Default:_ quality setting (above)
343
292
 
344
293
  This allows you to specify quality settings for various image formats, allowing you to take
345
294
  advantage of webp's better compression algorithm without trashing your jpg images (for example).
346
295
  If you don't give a setting for a particular format it'll fall back to the `quality` setting
347
- above, and if you don't set *that* it'll default to 75.
296
+ above, and if you don't set _that_ it'll default to 75.
348
297
 
349
298
  * **HTML Attributes**
350
299
 
351
- *Format:*
300
+ _Format:_
352
301
 
353
302
  ```yml
354
303
  attributes:
355
- (element): '(attributes)'
356
- (element): '(attributes)'
357
304
  (element): '(attributes)'
358
305
  (...)
359
306
  ```
360
307
 
361
- *Example:*
308
+ _Example:_
362
309
 
363
310
  ```yml
364
311
  attributes:
@@ -366,42 +313,49 @@ To use a multiplier based srcset, set `pixel_ratios` and `base_width`.
366
313
  picture: 'class="even-cooler"'
367
314
  ```
368
315
 
369
- HTML attributes you would like to add. The same arguments are available here as in the liquid
370
- tag; element names, `alt:`, `url:`, and `parent:`. Unescaped double quotes cause problems with
371
- yml, so it's recommended to surround them with single quotes.
316
+ HTML attributes you would like to add. The same arguments are available here as in the liquid
317
+ tag: HTML element names, `alt:`, `link:`, and `parent:`. Unescaped double quotes cause problems
318
+ with yml, so it's recommended to surround them with single quotes.
319
+
320
+ * **Fallback Width**
321
+
322
+ _Format:_ `fallback_width: (integer)`
372
323
 
373
- * **Noscript**
324
+ _Example:_ `fallback_width: 800`
374
325
 
375
- *Format:* `noscript: (true|false)`
326
+ _Default_: `800`
376
327
 
377
- *Example:* `noscript: true`
328
+ Width of the fallback image.
378
329
 
379
- *Default:* `false`
330
+ * **Fallback Format**
380
331
 
381
- For use with the `data_` output formats. When true, will include a basic `img` fallback within a
382
- `<noscript>` tag after the standard html. This allows you to use lazy loading or other javascript
383
- image tools, without breaking all of your images for non-javascript-enabled users.
332
+ _Format:_ `fallback_format: (format)`
384
333
 
385
- * **Source Image Linking**
334
+ _Example:_ `fallback_format: jpg`
386
335
 
387
- *Format:* `link_source: (true|false)`
336
+ _Default_: `original`
388
337
 
389
- *Example:* `link_source: true`
338
+ Format of the fallback image
390
339
 
391
- *Default:* `false`
340
+ * **Source Image Link**
341
+
342
+ _Format:_ `link_source: (true|false)`
343
+
344
+ _Example:_ `link_source: true`
345
+
346
+ _Default:_ `false`
392
347
 
393
348
  Surround image with a link to the original source file. Your source image directory must be
394
349
  published as part of the compiled site. If you run into weird issues with the output, see
395
- [notes](notes.md).
350
+ the [notes]({{ site.baseurl }}/notes).
396
351
 
397
352
  * **Nomarkdown override**
398
-
399
- *Format:* `nomarkdown: (true|false)`
400
353
 
401
- *Example:* `nomarkdown: false`
354
+ _Format:_ `nomarkdown: (true|false)`
402
355
 
403
- *Default:* `nil`
356
+ _Example:_ `nomarkdown: false`
404
357
 
405
- Hard setting for `{::nomarkdown}` tags, overrides both autodetection and the global setting in
406
- `_config.yml`. See [notes](notes.md) for a detailed explanation.
358
+ _Default:_ `nil`
407
359
 
360
+ Hard setting for `{::nomarkdown}` tags, overrides both autodetection and the global setting in
361
+ `_config.yml`. See the [notes]({{ site.baseurl }}/notes) for a detailed explanation.