jekyll-meilisearch 0.4.6 → 0.4.7
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/lib/jekyll-meilisearch/generator.rb +18 -10
- data/lib/jekyll-meilisearch/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: '09cff948b7ec1b219157c7c66c47592cfb3696fe4c338bb2b107878bfeda315f'
|
4
|
+
data.tar.gz: a706dd8eff495d9225006a5c0f6c73ccb5210580a2b2898228a4614acfd2863c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14d0e8a496a93775fde2f7d913e54afee9db82c50ab8795615473969ddd1bb5c85e411918854dbd1ce9fc5709abcab48b44c1b14866b8f2b5edb526d655ba161
|
7
|
+
data.tar.gz: b90285171c4d20d388b86dedb0a4254ebb19f9a572d3c8d7d3edc7d7ee4209c2ee3f7724bcc6cb36b60e107db12c51b2fedbe436a0bf3941014763a6a05c1397
|
@@ -36,22 +36,30 @@ module JekyllMeilisearch
|
|
36
36
|
|
37
37
|
# Determine if indexing should occur based on changed files
|
38
38
|
def should_index?
|
39
|
-
#
|
39
|
+
# Always index if not in incremental mode (full build)
|
40
40
|
return true unless @site.incremental?
|
41
41
|
|
42
42
|
# Get the collections to monitor from config
|
43
43
|
collections_config = config["collections"] || { "posts" => { "fields" => %w(title content url date) } }
|
44
44
|
monitored_collections = collections_config.keys
|
45
45
|
|
46
|
-
# Check if
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
# Check if regenerator supports modified_files (Jekyll version compatibility)
|
47
|
+
if @site.regenerator.respond_to?(:modified_files)
|
48
|
+
changed_files = @site.regenerator.modified_files
|
49
|
+
return false if changed_files.empty?
|
50
|
+
|
51
|
+
changed_files.any? do |file|
|
52
|
+
relative_path = file.relative_path.sub(%r!^/!, "")
|
53
|
+
collection_name = relative_path.split("/").first
|
54
|
+
is_in_collection = @site.collections.key?(collection_name) && monitored_collections.include?(collection_name)
|
55
|
+
Jekyll.logger.info "Jekyll Meilisearch:",
|
56
|
+
"File: #{relative_path}, Collection: #{collection_name}, In monitored collection? #{is_in_collection}"
|
57
|
+
is_in_collection
|
58
|
+
end
|
59
|
+
else
|
60
|
+
# Fallback: Warn and assume indexing is needed if we can’t check changes
|
61
|
+
Jekyll.logger.warn "Jekyll Meilisearch:", "Incremental change detection not supported in this Jekyll version. Indexing all documents."
|
62
|
+
true
|
55
63
|
end
|
56
64
|
end
|
57
65
|
|