jekyll-srcset 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -2
- data/jekyll-srcset.gemspec +1 -1
- data/lib/jekyll/srcset/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae4b06042ffab7e4ffeb4848224eae527a0a5a47
|
4
|
+
data.tar.gz: ec04ef409edcd2377d8363b22ef77cef32ee1d59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbec4494a16ffbdd9761b7f4b8f7ed93e73ca1bce9db2766cfa8a27cae54f71deb8727d97796f8ed3bbb4ba0734c6a9297a240ffa78cf862d9838db5d99076f4
|
7
|
+
data.tar.gz: cf0062c05384140e9b36f79c31dbfbd6be1f3d775851a88e687ec04eea7399287ad575d23a38aebaf9e9b722dd98b6da070ac6bb6ecd88c39db10857cf0eb9b7
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ This Jekyll plugin makes it very easy to send larger images to devices with high
|
|
4
4
|
|
5
5
|
The plugin adds an `image_tag` Liquid tag that can be used like this:
|
6
6
|
|
7
|
-
```
|
7
|
+
```html
|
8
8
|
{% image_tag src="/image.png" width="100" %}
|
9
9
|
```
|
10
10
|
|
@@ -45,12 +45,18 @@ Use it like this in any Liquid template:
|
|
45
45
|
{% image_tag src="/image.png" width="100" %}
|
46
46
|
```
|
47
47
|
|
48
|
-
You must specify either a `width` or a `height`, but never both. The width or height will be used to determine the smallest version of the image to use. Based on this minimum size, the plugin will generate up to 3 versions of the image, one that matches the dimension specified, one that's twice the size and one that's 3 times the size.
|
48
|
+
You must specify either a `width` or a `height`, but never both. The width or height will be used to determine the smallest version of the image to use (for 1x pixel density devices). Based on this minimum size, the plugin will generate up to 3 versions of the image, one that matches the dimension specified, one that's twice the size and one that's 3 times the size. The plugin never upscales an image.
|
49
49
|
|
50
50
|
The plugin sets these as a srcset attribute on the final image tag, and modern browsers will then use this information to determine which version of the image to load based on the pixel density of the device (and in the future, potentially based on bandwidth or user settings).
|
51
51
|
|
52
52
|
This makes it a really straight forward way to serve the right size of image in all modern browsers and in works fine in older browsers without any polyfill (there's not a lot of high pixel density devices out there that runs old browsers, so simply serving the smallest version to the ones that don't understand srcset is fine).
|
53
53
|
|
54
|
+
To use variables for the image or the dimensions, simply leave out the quotes:
|
55
|
+
|
56
|
+
```html
|
57
|
+
{% image_tag src=page.cover_image height=page.cover_image_height %}
|
58
|
+
```
|
59
|
+
|
54
60
|
## Optipng
|
55
61
|
|
56
62
|
If you have `optipng` installed and in your PATH, the plugin wil automatically run it on all generated png images.
|
data/jekyll-srcset.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-srcset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathias Biilmann Christensen
|
@@ -89,7 +89,7 @@ files:
|
|
89
89
|
- lib/jekyll/srcset.rb
|
90
90
|
- lib/jekyll/srcset/tag.rb
|
91
91
|
- lib/jekyll/srcset/version.rb
|
92
|
-
homepage:
|
92
|
+
homepage: https://github.com/netlify/jekyll-srcset
|
93
93
|
licenses:
|
94
94
|
- MIT
|
95
95
|
metadata: {}
|