jekyll_picture_tag 1.2.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Rakefile +5 -1
- data/jekyll-picture-tag.gemspec +44 -0
- data/jekyll_picture_tag.gemspec +9 -8
- data/lib/jekyll-picture-tag.rb +23 -0
- data/lib/jekyll_picture_tag/defaults/global.yml +1 -0
- data/lib/jekyll_picture_tag/generated_image.rb +6 -16
- data/lib/jekyll_picture_tag/instructions/configuration.rb +42 -7
- data/lib/jekyll_picture_tag/instructions/html_attributes.rb +1 -1
- data/lib/jekyll_picture_tag/output_formats.rb +1 -0
- data/lib/jekyll_picture_tag/output_formats/basics.rb +1 -0
- data/lib/jekyll_picture_tag/output_formats/naked_srcset.rb +12 -0
- data/lib/jekyll_picture_tag/output_formats/readme.md +48 -0
- data/lib/jekyll_picture_tag/srcsets/basics.rb +2 -12
- data/lib/jekyll_picture_tag/version.rb +1 -1
- data/readme.md +68 -654
- metadata +29 -13
- data/migration.md +0 -178
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.4.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-
|
13
|
+
date: 2019-06-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -68,6 +68,20 @@ dependencies:
|
|
68
68
|
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '2'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: mime-types
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '3'
|
78
|
+
type: :runtime
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - "~>"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '3'
|
71
85
|
- !ruby/object:Gem::Dependency
|
72
86
|
name: mini_magick
|
73
87
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,22 +116,21 @@ dependencies:
|
|
102
116
|
requirements:
|
103
117
|
- - "<"
|
104
118
|
- !ruby/object:Gem::Version
|
105
|
-
version: '
|
119
|
+
version: '5'
|
106
120
|
type: :runtime
|
107
121
|
prerelease: false
|
108
122
|
version_requirements: !ruby/object:Gem::Requirement
|
109
123
|
requirements:
|
110
124
|
- - "<"
|
111
125
|
- !ruby/object:Gem::Version
|
112
|
-
version: '
|
126
|
+
version: '5'
|
113
127
|
description: |2
|
114
|
-
Jekyll Picture Tag is a liquid tag that adds responsive images to your
|
115
|
-
|
116
|
-
|
117
|
-
with a little YAML configuration and a
|
128
|
+
Jekyll Picture Tag is a liquid tag that adds responsive images to your
|
129
|
+
Jekyll static site.Jekyll Picture Tag automatically creates resized source
|
130
|
+
images, is fully configurable, and covers all use cases — including art
|
131
|
+
direction and resolution switching — with a little YAML configuration and a
|
132
|
+
simple template tag.
|
118
133
|
email:
|
119
|
-
- hello@robwierzbowski.com
|
120
|
-
- brendan@tobolaski.com
|
121
134
|
- robert@buchberger.cc
|
122
135
|
executables: []
|
123
136
|
extensions: []
|
@@ -133,7 +146,9 @@ files:
|
|
133
146
|
- examples/_config.yml
|
134
147
|
- examples/_data/picture.yml
|
135
148
|
- examples/post.md
|
149
|
+
- jekyll-picture-tag.gemspec
|
136
150
|
- jekyll_picture_tag.gemspec
|
151
|
+
- lib/jekyll-picture-tag.rb
|
137
152
|
- lib/jekyll_picture_tag.rb
|
138
153
|
- lib/jekyll_picture_tag/defaults/global.yml
|
139
154
|
- lib/jekyll_picture_tag/defaults/presets.yml
|
@@ -152,7 +167,9 @@ files:
|
|
152
167
|
- lib/jekyll_picture_tag/output_formats/data_picture.rb
|
153
168
|
- lib/jekyll_picture_tag/output_formats/direct_url.rb
|
154
169
|
- lib/jekyll_picture_tag/output_formats/img.rb
|
170
|
+
- lib/jekyll_picture_tag/output_formats/naked_srcset.rb
|
155
171
|
- lib/jekyll_picture_tag/output_formats/picture.rb
|
172
|
+
- lib/jekyll_picture_tag/output_formats/readme.md
|
156
173
|
- lib/jekyll_picture_tag/source_image.rb
|
157
174
|
- lib/jekyll_picture_tag/srcsets.rb
|
158
175
|
- lib/jekyll_picture_tag/srcsets/basics.rb
|
@@ -160,9 +177,8 @@ files:
|
|
160
177
|
- lib/jekyll_picture_tag/srcsets/width.rb
|
161
178
|
- lib/jekyll_picture_tag/utils.rb
|
162
179
|
- lib/jekyll_picture_tag/version.rb
|
163
|
-
- migration.md
|
164
180
|
- readme.md
|
165
|
-
homepage: https://github.com/
|
181
|
+
homepage: https://github.com/rbuchberger/jekyll-picture-tag
|
166
182
|
licenses:
|
167
183
|
- BSD-3-Clause
|
168
184
|
metadata: {}
|
@@ -184,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
200
|
- !ruby/object:Gem::Version
|
185
201
|
version: '0'
|
186
202
|
requirements: []
|
187
|
-
rubygems_version: 3.0.
|
203
|
+
rubygems_version: 3.0.3
|
188
204
|
signing_key:
|
189
205
|
specification_version: 4
|
190
206
|
summary: Easy responsive images for Jekyll.
|
data/migration.md
DELETED
@@ -1,178 +0,0 @@
|
|
1
|
-
# Update and Migration guide
|
2
|
-
|
3
|
-
This document details the changes from previous versions (Everything before 1.0), and how to migrate
|
4
|
-
an existing site to the new version. For now it's a markdown document, once this branch is merged
|
5
|
-
into master it'll be a wiki page.
|
6
|
-
|
7
|
-
## Changes from previous versions:
|
8
|
-
|
9
|
-
- The default output formats are bone-stock HTML. Picturefill, as of version 3, no longer requires
|
10
|
-
special markup, so it remains compatible. Other javascript image solutions are supported with
|
11
|
-
the `data_` selection of markup formats. Interchange support is removed, though adding it again
|
12
|
-
is not difficult if there is demand for it.
|
13
|
-
- There are now 2 basic markup formats to choose from: `<source>` tags within a `<picture>`, and a
|
14
|
-
single `<img>` tag. If markup is set to 'auto', or if it is not set at all, the plugin will
|
15
|
-
automatically determine which is most appropriate. These formats also have `data_` counterparts
|
16
|
-
(i.e. `data_auto`), which accomplish the same thing except setting respective data-attributes
|
17
|
-
to allow for lazy loading and such.
|
18
|
-
- There are also 2 srcset formats: one which supplies image width, and another which supplies
|
19
|
-
multiples (pixel ratios) of the base size.
|
20
|
-
- Source Keys are replaced by media query presets, which can also be used to create the 'sizes'
|
21
|
-
attribute.
|
22
|
-
- Jekyll Picture Tag no longer accepts height arguments, and will no longer crop images for you.
|
23
|
-
Aspect ratio will always be maintained.
|
24
|
-
- Multiple image widths are now supported, which will be used to create a corresponding srcset.
|
25
|
-
- Multiple image formats are now possible, including webp.
|
26
|
-
- PictureTag can now generate sizes attributes.
|
27
|
-
- Configuration takes a very different format. It should be simpler to write your config than the
|
28
|
-
old version, and migrating to it should not be difficult. Instead of creating individual source
|
29
|
-
keys, you supply an array of widths you'd like to construct. You can also supply an array (yaml
|
30
|
-
sequence) of formats, including 'original'.
|
31
|
-
- Only global settings are placed in `_config.yml`. Presets are moved to `_data/picture.yml`.
|
32
|
-
|
33
|
-
## Migration
|
34
|
-
|
35
|
-
### Liquid Tags
|
36
|
-
|
37
|
-
Previous tag syntax has been extended, but backwards compatibility (and behaviour of previous
|
38
|
-
versions) is maintained.
|
39
|
-
|
40
|
-
`{% picture img.jpg (implicit attributes) --(argument) (explicit attributes) %}`
|
41
|
-
|
42
|
-
Implicit attributes are the old way. They are specified after the last source image, and before any
|
43
|
-
explicit attributes (if they are included). These attributes are applied to the `<img>` tag, as in
|
44
|
-
previous versions.
|
45
|
-
|
46
|
-
Explicit attributes are the new way, documented in the readme. It is possible to use a mix of both,
|
47
|
-
though I'm not sure why you would want to.
|
48
|
-
|
49
|
-
There is one instance I can think of where you will have to change your tags:
|
50
|
-
|
51
|
-
- You use art direction with more than one different preset.
|
52
|
-
- These presets have source keys of the same name.
|
53
|
-
- These source keys have different associated media queries.
|
54
|
-
|
55
|
-
If all of the above are true, you will either have to pick one media query which works for both, or
|
56
|
-
rename one of them and change it everywhere it's used.
|
57
|
-
|
58
|
-
Another trouble spot will be CSS; your output markup may change, meaning your CSS selectors may stop
|
59
|
-
working.
|
60
|
-
|
61
|
-
Outside of those situations, and provided you have created media_presets to match your old source
|
62
|
-
keys, your existing tags should keep working. If they don't, it's a bug. Please report it.
|
63
|
-
|
64
|
-
### Configuration
|
65
|
-
|
66
|
-
The new configuration is described in the readme so I won't document it here, but I will show an old
|
67
|
-
config alongside an equivalent new one.
|
68
|
-
|
69
|
-
Example old configuration:
|
70
|
-
|
71
|
-
```yml
|
72
|
-
# _config.yml
|
73
|
-
|
74
|
-
picture:
|
75
|
-
source: assets/images/_fullsize
|
76
|
-
output: generated
|
77
|
-
markup: picture
|
78
|
-
presets:
|
79
|
-
# Full width pictures
|
80
|
-
default:
|
81
|
-
ppi: [1, 1.5]
|
82
|
-
attr:
|
83
|
-
class: blog-full
|
84
|
-
itemprop: image
|
85
|
-
source_lrg:
|
86
|
-
media: "(min-width: 40em)"
|
87
|
-
width: 700
|
88
|
-
source_med:
|
89
|
-
media: "(min-width: 30em)"
|
90
|
-
width: 450
|
91
|
-
source_default:
|
92
|
-
width: 350
|
93
|
-
height: 200
|
94
|
-
# Half width pictures
|
95
|
-
half:
|
96
|
-
ppi: [1, 1.5]
|
97
|
-
attr:
|
98
|
-
data-location: "{{location}}"
|
99
|
-
data-active: nil
|
100
|
-
source_lrg:
|
101
|
-
media: "(min-width: 40em)"
|
102
|
-
width: 400
|
103
|
-
source_med:
|
104
|
-
media: "(min-width: 30em)"
|
105
|
-
width: 250
|
106
|
-
source_default:
|
107
|
-
width: 350
|
108
|
-
# Self-set resolution sources. Useful if you don't want a 1:1 image size to dppx ratio.
|
109
|
-
gallery:
|
110
|
-
source_wide_hi:
|
111
|
-
media: "(min-width: 40em) and (min-resolution: 1.5dppx)"
|
112
|
-
width: 900
|
113
|
-
height: 600
|
114
|
-
source_wide:
|
115
|
-
media: "(min-width: 40em)"
|
116
|
-
width: 600
|
117
|
-
height: 400
|
118
|
-
source_default:
|
119
|
-
width: 250
|
120
|
-
height: 250
|
121
|
-
```
|
122
|
-
|
123
|
-
Equivalent new configuration:
|
124
|
-
|
125
|
-
```yml
|
126
|
-
# _config.yml
|
127
|
-
|
128
|
-
picture:
|
129
|
-
source: assets/images/_fullsize
|
130
|
-
output: generated
|
131
|
-
```
|
132
|
-
|
133
|
-
```yml
|
134
|
-
# _data/picture.yml
|
135
|
-
|
136
|
-
# Media presets are named media queries. To maintain compatibility with your tags, you need to
|
137
|
-
# create presets of the same name as your old source keys. There is no limit to how many of them you
|
138
|
-
# can have, so you're free to create additional new ones with better names to use going forward.
|
139
|
-
media_presets:
|
140
|
-
source_lrg: '(min-width: 40em)'
|
141
|
-
source_med: '(min-width: 30em)'
|
142
|
-
source_wide_hi: "(min-width: 40em) and (min-resolution: 1.5dppx)"
|
143
|
-
source_wide: "(min-width: 40em)"
|
144
|
-
|
145
|
-
markup_presets:
|
146
|
-
# You can't specify both widths and pixel ratios anymore. Choose one.
|
147
|
-
# Full width pictures, width-based srcset
|
148
|
-
default:
|
149
|
-
markup: picture
|
150
|
-
widths: [350, 450, 700]
|
151
|
-
attributes:
|
152
|
-
picture: 'class="blog-full" itemprop="image"'
|
153
|
-
|
154
|
-
# Full width pictures, multiplier based srcset
|
155
|
-
default-ppi:
|
156
|
-
markup: picture
|
157
|
-
base_width: 350
|
158
|
-
pixel_ratios: [1, 1.5]
|
159
|
-
attributes:
|
160
|
-
picture: 'class="blog-full" itemprop="image"'
|
161
|
-
|
162
|
-
# Half width pictures
|
163
|
-
half:
|
164
|
-
widths: [250, 350, 400]
|
165
|
-
attributes:
|
166
|
-
picture: 'data-location="{{location}}" data-active="nil"'
|
167
|
-
|
168
|
-
# Note you can't set heights anymore. You'll have to crop your images either ahead of time, or
|
169
|
-
# do it with CSS.
|
170
|
-
#
|
171
|
-
# You have to use arrays for widths, even if only specifying a single value. There's no reason you
|
172
|
-
# can't add more.
|
173
|
-
gallery:
|
174
|
-
widths: [250]
|
175
|
-
media_widths:
|
176
|
-
source_wide_hi: [900]
|
177
|
-
source_wide: [600]
|
178
|
-
```
|