From 027af7840da4ad2cfef767579a690190fdff1611 Mon Sep 17 00:00:00 2001 From: "R. Kent James" Date: Wed, 6 Mar 2024 11:54:43 -0500 Subject: [PATCH] Stop failing with small package count --- _ruby_libs/lunr.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/_ruby_libs/lunr.rb b/_ruby_libs/lunr.rb index 9e1612e7..7542b4ee 100644 --- a/_ruby_libs/lunr.rb +++ b/_ruby_libs/lunr.rb @@ -16,6 +16,7 @@ def precompile_lunr_index(site, index, ref, fields, output_dir, shard_count = 1) FileUtils.mkdir_p(site.dest) unless File.directory?(site.dest) FileUtils.mkdir_p(output_dirpath) unless File.directory?(output_dirpath) shard_size = index.length / shard_count + if shard_size == 0 then shard_size = 1 end Enumerator.new do |enum| shards = index.each_slice(shard_size).with_index.collect do |index_slice, i|