jekyll-uj-powertools 1.6.13 → 1.6.14

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: '02549cb967cbd7824079ec66c7b3efc58bfbd8900541807199e4999472e4f637'
4
- data.tar.gz: 4b8f38b4f5a17787d3edd32b00f3a011682b2fd276dc561e9a1fb37349e2ddde
3
+ metadata.gz: 18477ab3973e5e57e8219050d534de95931357c22447f6ee3ad189c78af1303f
4
+ data.tar.gz: ee42cd7804794b12971d8480ca7f4571d7ca1229587d0d6c11e90685eb143a1a
5
5
  SHA512:
6
- metadata.gz: 572aee2b9a5c50dc70061d1d4b6b49773b0297a9e786c6e897fb767166600de697285570a245ee10e1b40f1a24dad018fff7adcf2ac3efa03380a07b8fd4fb0d
7
- data.tar.gz: bdc0de0cb663b2f4de284ceefa13c094384b4d6cea72e90a7fd05fc48e3d1d3d56be2a29d6bf413aeb89295a448c7f4102397a742a99c0bed32fa4157fd71572
6
+ metadata.gz: 9d898ebfb5c473390ddeb41fc125a4cb2e11dfbc8880d48c7b24313538c30311dd62ac917b2bf6d5b87c1c19461cfa10ff205ab308fe72f74490d0aa39295145
7
+ data.tar.gz: 14126d4f4e0fbdb967a3792a3949ed18a4d02160b57c146d24ad58993a9a62dad1f87dfe9f72fbb8046d9d060dab54b4477cd6dc90b349dc806f4e60bffb270c
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  Gem::Specification.new do |spec|
6
6
  # Gem info
7
7
  spec.name = "jekyll-uj-powertools"
8
- spec.version = "1.6.13"
8
+ spec.version = "1.6.14"
9
9
 
10
10
  # Author info
11
11
  spec.authors = ["ITW Creative Works"]
data/lib/tags/readtime.rb CHANGED
@@ -5,7 +5,7 @@ require_relative '../helpers/variable_resolver'
5
5
  module Jekyll
6
6
  class UJReadtimeTag < Liquid::Tag
7
7
  include UJPowertools::VariableResolver
8
-
8
+
9
9
  def initialize(tag_name, markup, tokens)
10
10
  super
11
11
  @markup = markup.strip
@@ -15,22 +15,22 @@ module Jekyll
15
15
  # Get the content to analyze
16
16
  content = resolve_content(context)
17
17
  return '1' unless content
18
-
18
+
19
19
  # Strip HTML tags
20
20
  stripped_content = strip_html(content)
21
-
21
+
22
22
  # Count words
23
23
  words = count_words(stripped_content)
24
-
25
- # Calculate readtime (200 words per minute, minimum 1 minute)
26
- readtime = (words / 200.0).ceil
24
+
25
+ # Calculate readtime (269 words per minute, minimum 1 minute)
26
+ readtime = (words / 269.0).ceil
27
27
  readtime = 1 if readtime < 1
28
-
28
+
29
29
  readtime.to_s
30
30
  end
31
-
31
+
32
32
  private
33
-
33
+
34
34
  def resolve_content(context)
35
35
  if @markup.empty?
36
36
  # No argument, use page content
@@ -42,7 +42,7 @@ module Jekyll
42
42
  resolve_input(context, @markup)
43
43
  end
44
44
  end
45
-
45
+
46
46
  def strip_html(content)
47
47
  # Remove HTML tags
48
48
  content = content.to_s.gsub(/<script.*?<\/script>/m, '')
@@ -51,7 +51,7 @@ module Jekyll
51
51
  content = content.gsub(/\s+/, ' ')
52
52
  content.strip
53
53
  end
54
-
54
+
55
55
  def count_words(text)
56
56
  # Count words (split by whitespace)
57
57
  text.split(/\s+/).length
@@ -59,4 +59,4 @@ module Jekyll
59
59
  end
60
60
  end
61
61
 
62
- Liquid::Template.register_tag('uj_readtime', Jekyll::UJReadtimeTag)
62
+ Liquid::Template.register_tag('uj_readtime', Jekyll::UJReadtimeTag)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-uj-powertools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.13
4
+ version: 1.6.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - ITW Creative Works
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-20 00:00:00.000000000 Z
11
+ date: 2025-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll