jekyll-imgproxy-tag 0.1.0 → 0.4.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/.gitignore +1 -0
- data/CHANGELOG +32 -0
- data/Gemfile.lock +1 -1
- data/lib/jekyll/imgproxy/tag/errors.rb +4 -0
- data/lib/jekyll/imgproxy/tag/imgproxy_config.rb +6 -2
- data/lib/jekyll/imgproxy/tag/path_builder.rb +4 -2
- data/lib/jekyll/imgproxy/tag.rb +3 -3
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: acbe39a4ae228887043a40c257606c034bd8a90a9d0c33c2c4db48262dfd8806
|
|
4
|
+
data.tar.gz: f7f38a3f4380808ed81c2e7799271b0913cd1e0254e374ff96dec3164e9a9838
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 24f9d88c21c0b98cbd95cea884b7102cbb545a95f0feb5aa9b82d4279a6692497a1d65e1c56d0ce1c84d84d56689db9ee3ffe9582c4cec7db1779f2ac7884144
|
|
7
|
+
data.tar.gz: 6b138902223e9a28c909eb5c62a1f42e37f955d1192360ca361f039e2c3226b59cdf36fe4dcf6a0211793e60cde3f771461e22f68c1347f171e571503634f91a
|
data/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pkg
|
data/CHANGELOG
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.4.0] - 2022-06-27
|
|
11
|
+
|
|
12
|
+
- Use passed in page context to access Jekyll's config instead of accessing
|
|
13
|
+
`Jekyll.configuration`.
|
|
14
|
+
|
|
15
|
+
## [0.3.0] - 2022-06-18
|
|
16
|
+
|
|
17
|
+
- Refactored the config class to access the Jekyll configuration object only
|
|
18
|
+
once so that we're not repeatedly logging to STDOUT about its being accessed.
|
|
19
|
+
|
|
20
|
+
## [0.2.0] - 2022-06-12
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Refactored the `PathBuilder` to check that there's a path to an image passed
|
|
25
|
+
to it, otherwise, raise an error. Without a image path, this would be useless.
|
|
26
|
+
|
|
27
|
+
## [0.1.0] - 2022-06-07
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- Everything
|
|
32
|
+
|
data/Gemfile.lock
CHANGED
|
@@ -4,13 +4,17 @@ module Jekyll
|
|
|
4
4
|
module Imgproxy
|
|
5
5
|
class Tag
|
|
6
6
|
class ImgproxyConfig
|
|
7
|
+
extend Forwardable
|
|
8
|
+
|
|
7
9
|
attr_reader \
|
|
10
|
+
:context,
|
|
8
11
|
:base_url,
|
|
9
12
|
:key,
|
|
10
13
|
:salt,
|
|
11
14
|
:aws_bucket
|
|
12
15
|
|
|
13
|
-
def initialize
|
|
16
|
+
def initialize(context)
|
|
17
|
+
@context = context
|
|
14
18
|
@base_url = fetch_config(:base_url)
|
|
15
19
|
@key = fetch_config(:key)
|
|
16
20
|
@salt = fetch_config(:salt)
|
|
@@ -36,7 +40,7 @@ module Jekyll
|
|
|
36
40
|
end
|
|
37
41
|
|
|
38
42
|
def imgproxy_config
|
|
39
|
-
|
|
43
|
+
context['site']['imgproxy']
|
|
40
44
|
end
|
|
41
45
|
end
|
|
42
46
|
end
|
|
@@ -9,7 +9,6 @@ module Jekyll
|
|
|
9
9
|
def initialize(config, options)
|
|
10
10
|
@config = config
|
|
11
11
|
@options = options
|
|
12
|
-
@path = @options.delete('path')
|
|
13
12
|
|
|
14
13
|
@resizing_type = 'rs:fit'
|
|
15
14
|
@width = ':'
|
|
@@ -20,15 +19,18 @@ module Jekyll
|
|
|
20
19
|
def build
|
|
21
20
|
options.each { |key, value| send("#{key}=".to_sym, value) }
|
|
22
21
|
|
|
22
|
+
raise Jekyll::Imgproxy::Tag::Errors::PathNotSet unless path
|
|
23
|
+
|
|
23
24
|
"/#{resizing_type}#{width}#{height}#{gravity}#{quality}#{max_bytes}#{cache_buster}/#{encoded_url}#{format}"
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
protected
|
|
27
28
|
|
|
29
|
+
attr_accessor :path
|
|
30
|
+
|
|
28
31
|
attr_reader \
|
|
29
32
|
:config,
|
|
30
33
|
:options,
|
|
31
|
-
:path,
|
|
32
34
|
:resizing_type,
|
|
33
35
|
:width,
|
|
34
36
|
:height,
|
data/lib/jekyll/imgproxy/tag.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Jekyll
|
|
4
4
|
module Imgproxy
|
|
5
5
|
class Tag < ::Liquid::Tag
|
|
6
|
-
VERSION = '0.
|
|
6
|
+
VERSION = '0.4.0'
|
|
7
7
|
|
|
8
8
|
def initialize(tag_name, raw_options, tokens)
|
|
9
9
|
super
|
|
@@ -15,8 +15,8 @@ module Jekyll
|
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
def render(
|
|
19
|
-
imgproxy_config = ImgproxyConfig.new
|
|
18
|
+
def render(context)
|
|
19
|
+
imgproxy_config = ImgproxyConfig.new(context)
|
|
20
20
|
UrlGenerator.new(imgproxy_config, options).url
|
|
21
21
|
end
|
|
22
22
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-imgproxy-tag
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joel Oliveira
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-06-
|
|
11
|
+
date: 2022-06-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|
|
@@ -101,7 +101,9 @@ executables: []
|
|
|
101
101
|
extensions: []
|
|
102
102
|
extra_rdoc_files: []
|
|
103
103
|
files:
|
|
104
|
+
- ".gitignore"
|
|
104
105
|
- ".rspec"
|
|
106
|
+
- CHANGELOG
|
|
105
107
|
- Gemfile
|
|
106
108
|
- Gemfile.lock
|
|
107
109
|
- LICENSE.md
|