jekyll-thumb 0.1.2 → 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 +4 -2
- data/lib/jekyll/thumb/tag.rb +4 -1
- data/lib/jekyll/thumb/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 861c049f460eadcc03e55cac062b4a420dae382a37bda263e89c5208d5bce138
|
4
|
+
data.tar.gz: 630f43935f173fbc31f4cf86ffdc397982e22cf6e1d27d18f253c2b5c8aa5d1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0456a9e83e49e728aefb854d9790e75dabe72202bd9261161604d59b77cb700b3ec9563e1ee31f7752be6671abf720c9b3334a5a61b67f214cf843437deb300
|
7
|
+
data.tar.gz: a5b87996b706a2221e0fa31a80e97d23996640a114a4762b143c2ecfe1f62008267f1bd759e952b32afd414d7e96f09151db7de0b309523f449f9d1b4351d626
|
data/README.md
CHANGED
@@ -34,7 +34,7 @@ Then bundle:
|
|
34
34
|
|
35
35
|
$ bundle
|
36
36
|
|
37
|
-
Or install it yourself
|
37
|
+
Or install it yourself with:
|
38
38
|
|
39
39
|
$ gem install jekyll-thumb
|
40
40
|
|
@@ -58,6 +58,8 @@ To use variables for the image or the dimensions, simply leave out the quotes:
|
|
58
58
|
{% thumb src=page.cover_image height=page.cover_image_height %}
|
59
59
|
```
|
60
60
|
|
61
|
+
By default this will wrap the resized `img` in a link to the original, with a `target="_blank"` attribute. To supress this, pass a `link=false` option to the `thumb` tag.
|
62
|
+
|
61
63
|
## Optipng
|
62
64
|
|
63
65
|
If you have `optipng` installed and in your PATH, you can tell the plugin to run it on all generated png images.
|
@@ -69,7 +71,7 @@ thumb:
|
|
69
71
|
optipng: true
|
70
72
|
```
|
71
73
|
|
72
|
-
To your
|
74
|
+
To your `_config.yml`
|
73
75
|
|
74
76
|
Currently the plugin doesn't optimize other image formats, except for stripping color palettes.
|
75
77
|
|
data/lib/jekyll/thumb/tag.rb
CHANGED
@@ -23,7 +23,10 @@ module Jekyll
|
|
23
23
|
site = context.registers[:site]
|
24
24
|
img_attrs = generate_image(site, options["src"], options)
|
25
25
|
|
26
|
-
%Q{<
|
26
|
+
img = %Q{<img #{options.merge(img_attrs).map {|k,v| "#{k}=\"#{v}\""}.join(" ")}>}
|
27
|
+
return img if options['link'] == false
|
28
|
+
|
29
|
+
%Q{<a href="#{options['src']}" target="_blank" class="thumb">#{img}</a>}
|
27
30
|
end
|
28
31
|
|
29
32
|
def parse_options(markup, context)
|
data/lib/jekyll/thumb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-thumb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Davies
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-vips
|
@@ -102,8 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
|
-
|
106
|
-
rubygems_version: 2.7.6
|
105
|
+
rubygems_version: 3.0.3
|
107
106
|
signing_key:
|
108
107
|
specification_version: 4
|
109
108
|
summary: This Jekyll plugin adds a thumb tag which will autogenerate image thumbnails
|