jekyll-images 0.3.0 → 0.3.1
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/lib/jekyll/filters/height.rb +3 -3
- data/lib/jekyll/filters/thumbnail.rb +2 -2
- data/lib/jekyll/filters/width.rb +3 -3
- data/lib/jekyll-images.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b9b71c35193e6576d44fe7acab6166e90c5e9a55c6b884d3fd63d1bbd9af5e2
|
4
|
+
data.tar.gz: ad1a2f6f0913b44b5e7e0f824ea547fcdb37a940c7b4b5aeb7582407b4638c82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5be91d54ad4e4c410581044f6446040098e8999a845ed5545a68f9c3dfb19a9a9a0bf81de3f9ae84195e9876d4b862a70613ef0b370f2641152bab63211be3c4
|
7
|
+
data.tar.gz: 93dc21ef593b4c334f8288ff93b4a957397ff435003b1621fb1145235c50096ccb0676e8530c66ecdc406f5fa8337d8bf88bf175d753a68dbd8c7d94561c29bb
|
@@ -6,14 +6,14 @@ module Jekyll
|
|
6
6
|
module Height
|
7
7
|
def height(input)
|
8
8
|
return unless input
|
9
|
-
|
9
|
+
path = @context.registers[:site].in_source_dir input
|
10
10
|
|
11
|
-
unless ::File.exist?
|
11
|
+
unless ::File.exist? path
|
12
12
|
Jekyll.logger.warn "File doesn't exist #{input}"
|
13
13
|
return input
|
14
14
|
end
|
15
15
|
|
16
|
-
Jekyll::Images::Cache.cached_image(
|
16
|
+
Jekyll::Images::Cache.cached_image(path).height
|
17
17
|
rescue Vips::Error => e
|
18
18
|
Jekyll.logger.warn "Failed to process #{input}: #{e.message}"
|
19
19
|
nil
|
@@ -7,14 +7,14 @@ module Jekyll
|
|
7
7
|
# Generates a thumbnail and returns its alternate destination
|
8
8
|
def thumbnail(input, width = nil, height = nil, crop = nil, auto_rotate = nil)
|
9
9
|
return unless input
|
10
|
-
|
10
|
+
path = @context.registers[:site].in_source_dir input
|
11
11
|
|
12
12
|
unless ::File.exist? input
|
13
13
|
Jekyll.logger.warn "File doesn't exist #{input}"
|
14
14
|
return input
|
15
15
|
end
|
16
16
|
|
17
|
-
image = Jekyll::Images::Cache.cached_image
|
17
|
+
image = Jekyll::Images::Cache.cached_image path
|
18
18
|
thumb = image.thumbnail(width: width,
|
19
19
|
height: height,
|
20
20
|
crop: crop,
|
data/lib/jekyll/filters/width.rb
CHANGED
@@ -6,14 +6,14 @@ module Jekyll
|
|
6
6
|
module Width
|
7
7
|
def width(input)
|
8
8
|
return unless input
|
9
|
-
|
9
|
+
path = @context.registers[:site].in_source_dir input
|
10
10
|
|
11
|
-
unless ::File.exist?
|
11
|
+
unless ::File.exist? path
|
12
12
|
Jekyll.logger.warn "File doesn't exist #{input}"
|
13
13
|
return input
|
14
14
|
end
|
15
15
|
|
16
|
-
Jekyll::Images::Cache.cached_image(
|
16
|
+
Jekyll::Images::Cache.cached_image(path).width
|
17
17
|
rescue Vips::Error => e
|
18
18
|
Jekyll.logger.warn "Failed to process #{input}: #{e.message}"
|
19
19
|
nil
|
data/lib/jekyll-images.rb
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
require_relative 'jekyll/images/cache'
|
4
4
|
|
5
|
-
Jekyll::
|
5
|
+
Jekyll::Hooks.register :site, :after_reset do |site|
|
6
|
+
Jekyll::Images::Cache.site = site
|
7
|
+
end
|
6
8
|
|
7
9
|
require_relative 'jekyll/images/image'
|
8
10
|
require_relative 'jekyll/images/thumbnail'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.1.
|
106
|
+
rubygems_version: 3.1.6
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Optimizes images for Jekyll
|