jekyll-auto-thumbnails 2.1.0 → 2.2.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/CHANGELOG.md +7 -0
- data/lib/jekyll-auto-thumbnails/hooks.rb +20 -2
- data/lib/jekyll-auto-thumbnails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ba5ecfc504a10dfd094946e47dc0062ef2c200a4650aa35694b27e389ad1dc15
|
|
4
|
+
data.tar.gz: 65e33707b09dbafeb8fbd5cc9d6f2dbced647e403e9ef78d84a0201466d39cb6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ddbcd68c77f775d8932b7e42f101b99d164a29bed79e4c176d5606e0afb7234277353483526aa67e1eb92ce5d3fcf2c5f0ca88d091f58b105b8f4f51eb5f7d5
|
|
7
|
+
data.tar.gz: 4e98ebbe7ea692d0ca7b4b17e2b4c4136db49f026c8d7484ac3a18667503115e08735269df5e933912ad19d9ecddae81fb713c6dea1e9ea14a037360bb8907df
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.2.0](https://github.com/Texarkanine/jekyll-auto-thumbnails/compare/v2.1.0...v2.2.0) (2026-08-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **hooks:** append elapsed time to completion logs ([#54](https://github.com/Texarkanine/jekyll-auto-thumbnails/issues/54)) ([4bb9c6f](https://github.com/Texarkanine/jekyll-auto-thumbnails/commit/4bb9c6fcb9a83802e503d21d108017016c00c543))
|
|
9
|
+
|
|
3
10
|
## [2.1.0](https://github.com/Texarkanine/jekyll-auto-thumbnails/compare/v2.0.1...v2.1.0) (2026-07-19)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -5,6 +5,18 @@ require_relative "html_parser"
|
|
|
5
5
|
module JekyllAutoThumbnails
|
|
6
6
|
# Jekyll hook integration
|
|
7
7
|
module Hooks
|
|
8
|
+
# Format a duration for Jekyll log suffixes.
|
|
9
|
+
#
|
|
10
|
+
# @param seconds [Numeric] elapsed seconds
|
|
11
|
+
# @return [String] `in Xs` under a minute, otherwise `in X m Y s`
|
|
12
|
+
def self.format_elapsed(seconds)
|
|
13
|
+
total = seconds.round
|
|
14
|
+
return "in #{total}s" if total < 60
|
|
15
|
+
|
|
16
|
+
minutes, remainder = total.divmod(60)
|
|
17
|
+
"in #{minutes} m #{remainder} s"
|
|
18
|
+
end
|
|
19
|
+
|
|
8
20
|
# Initialize optimization system
|
|
9
21
|
#
|
|
10
22
|
# @param site [Jekyll::Site] Jekyll site
|
|
@@ -35,6 +47,8 @@ module JekyllAutoThumbnails
|
|
|
35
47
|
return
|
|
36
48
|
end
|
|
37
49
|
|
|
50
|
+
started = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
51
|
+
|
|
38
52
|
# Scan all documents and pages
|
|
39
53
|
(site.documents + site.pages).each do |doc|
|
|
40
54
|
next unless doc.output
|
|
@@ -77,7 +91,8 @@ module JekyllAutoThumbnails
|
|
|
77
91
|
doc.output = replace_urls(doc.output, url_map, parser: config.parser)
|
|
78
92
|
end
|
|
79
93
|
|
|
80
|
-
|
|
94
|
+
elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - started
|
|
95
|
+
Jekyll.logger.info "AutoThumbnails:", "Generated #{url_map.size} thumbnails #{format_elapsed(elapsed)}"
|
|
81
96
|
end
|
|
82
97
|
|
|
83
98
|
# Copy thumbnails from cache to _site
|
|
@@ -92,6 +107,8 @@ module JekyllAutoThumbnails
|
|
|
92
107
|
|
|
93
108
|
Jekyll.logger.info "AutoThumbnails:", "Copying #{url_map.size} thumbnails to _site"
|
|
94
109
|
|
|
110
|
+
started = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
111
|
+
|
|
95
112
|
url_map.each_value do |thumb_url|
|
|
96
113
|
thumb_filename = File.basename(thumb_url)
|
|
97
114
|
cached_path = File.join(config.cache_dir, thumb_filename)
|
|
@@ -104,7 +121,8 @@ module JekyllAutoThumbnails
|
|
|
104
121
|
FileUtils.cp(cached_path, dest_path)
|
|
105
122
|
end
|
|
106
123
|
|
|
107
|
-
|
|
124
|
+
elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - started
|
|
125
|
+
Jekyll.logger.info "AutoThumbnails:", "All thumbnails copied #{format_elapsed(elapsed)}"
|
|
108
126
|
end
|
|
109
127
|
|
|
110
128
|
# Replace image URLs in HTML.
|