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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f0fec7cfa3ac45d704dcce4f97edc9e71311df06174f99dd24c3231d1675589
4
- data.tar.gz: edc7920b2ff080b42728ead47fee4fcec02d9892979156127c85fba3661844d2
3
+ metadata.gz: ba5ecfc504a10dfd094946e47dc0062ef2c200a4650aa35694b27e389ad1dc15
4
+ data.tar.gz: 65e33707b09dbafeb8fbd5cc9d6f2dbced647e403e9ef78d84a0201466d39cb6
5
5
  SHA512:
6
- metadata.gz: 06b2ed4d1aa33f8f4a978e7679688daf25ffdc31fd4d0f8ca3f09eb79aa121920ee76a017750b5e2eda9d5ed5d5970e3106fd7dc1620e8e818960c012227d2f9
7
- data.tar.gz: 837a87b1c64202fe40cd163081e9c03ee36c9289796b6c3bd90a9694e42d19c8408ce666401860c729cf5b942512ad5b2695f595b15f57c2530a2002c70906e2
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
- Jekyll.logger.info "AutoThumbnails:", "Generated #{url_map.size} thumbnails"
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
- Jekyll.logger.info "AutoThumbnails:", "All thumbnails copied"
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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllAutoThumbnails
4
- VERSION = "2.1.0"
4
+ VERSION = "2.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-auto-thumbnails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Texarkanine