jekyll_picture_tag 1.7.1 → 1.8.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/docs/notes.md +11 -1
- data/docs/output.md +32 -21
- data/docs/presets.md +3 -0
- data/docs/releases.md +2 -0
- data/lib/jekyll_picture_tag/defaults/presets.yml +1 -0
- data/lib/jekyll_picture_tag/output_formats/data_attributes.rb +4 -1
- data/lib/jekyll_picture_tag/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abfaaaa312c42464c11595294a11c10848f810cb6c1c63ce085b73b557501f8f
|
4
|
+
data.tar.gz: 31c075ac80ee1ee500999b4f54c05d1b0b29b4a13230a3f84914dc4b9a035325
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5372b24c10a7049e20f1e2546a2f20cb2c0714cd4f8f8482e7005f503f9b192fe00ad5b4e07599e715cb280dad366a4477d3dd85ad5fc82743ac24309bf1688b
|
7
|
+
data.tar.gz: 66640daa48af3f8507a0d0675bd0fc6527a77c02401cdc06bc3ce967d946c61e53233a1a51b0e31812e5dbb462fb2cb37a42681e9b6fa1b00e31a9b7ea8763e0
|
data/docs/notes.md
CHANGED
@@ -12,7 +12,17 @@
|
|
12
12
|
|
13
13
|
Jekyll Picture Tag has comprehensive attribute support for all generated HTML. You can add
|
14
14
|
attributes both through the [liquid tag]({{ site.baseurl }}/usage), and the [preset]({{
|
15
|
-
site.baseurl }}/presets) (scroll down a
|
15
|
+
site.baseurl }}/presets) (scroll down a bit).
|
16
|
+
|
17
|
+
* ### Input checking
|
18
|
+
|
19
|
+
Jekyll Picture Tag is very trusting. It doesn't do much checking of your inputs, and it does not
|
20
|
+
fail gracefully if you for example pass it a string when it expects an array. It's on the to-do
|
21
|
+
list, but for now if you get cryptic errors then double-check your settings and tag arguments.
|
22
|
+
|
23
|
+
* ### Git LFS
|
24
|
+
|
25
|
+
I'm Putting this here because it bit me: If you want to use git LFS, make sure that your hosting
|
16
26
|
provider makes those images available during the build process. Netlify, for example, does not.
|
17
27
|
You won't find this out until you have gone through the entire migration process and try to deploy
|
18
28
|
for the first time.
|
data/docs/output.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
This is a listing of the various text arrangements that JPT can give you. Select one by setting
|
7
7
|
`markup:` in the relevant [markup preset]({{ site.baseurl }}/presets).
|
8
8
|
|
9
|
-
Example:
|
9
|
+
Example:
|
10
10
|
|
11
11
|
```yml
|
12
12
|
# /_data/picture.yml
|
@@ -18,35 +18,46 @@ markup_presets:
|
|
18
18
|
|
19
19
|
## Standard HTML:
|
20
20
|
|
21
|
-
|
21
|
+
- **`picture`:** `<picture>` element surrounding a `<source>` tag for each required srcset, and a
|
22
22
|
fallback `<img>`.
|
23
23
|
|
24
|
-
|
24
|
+
- **`img`:** output a single `<img>` tag with a `srcset` entry.
|
25
25
|
|
26
|
-
|
26
|
+
- **`auto`:** Supply an img tag when you have only one srcset, otherwise supply a picture tag.
|
27
27
|
|
28
28
|
## Javascript Friendly:
|
29
29
|
|
30
|
-
|
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
|
-
basic `img` fallback within a `<noscript>` tag by setting `noscript: true` in the preset. This
|
34
|
-
allows you to keep working images for your non-javascript-enabled users.
|
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).
|
35
33
|
|
36
|
-
|
34
|
+
#### Special Options
|
37
35
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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.)
|
45
56
|
|
46
57
|
## Fragments:
|
47
58
|
|
48
|
-
|
49
|
-
and format).
|
59
|
+
- **`direct_url`**: Generates an image and returns only its url. Uses `fallback_` properties (width
|
60
|
+
and format).
|
50
61
|
|
51
|
-
|
52
|
-
(image) `format` setting must still be an array, even if you only give it one value.
|
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.
|
data/docs/presets.md
CHANGED
@@ -9,6 +9,9 @@ this file, and probably the `_data/` directory as well.
|
|
9
9
|
|
10
10
|
Here's an [example data file]({{ site.baseurl }}/example_presets).
|
11
11
|
|
12
|
+
Any settings which are specific to particular output formats are documented on the [output
|
13
|
+
formats]({{site.baseurl}}/output) page.
|
14
|
+
|
12
15
|
## Required Knowledge
|
13
16
|
|
14
17
|
If you don't know the difference between resolution switching and art direction, stop now and read
|
data/docs/releases.md
CHANGED
@@ -18,7 +18,10 @@ module PictureTag
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def add_sizes(element, srcset)
|
21
|
-
|
21
|
+
return unless srcset.sizes
|
22
|
+
|
23
|
+
attribute = PictureTag.preset['data_sizes'] ? 'data-sizes' : 'sizes'
|
24
|
+
element.attributes << { attribute => srcset.sizes }
|
22
25
|
end
|
23
26
|
|
24
27
|
def build_noscript(base_content)
|
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.8.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: 2019-11-
|
13
|
+
date: 2019-11-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|