jekyll-pagefind 0.3.0 → 0.3.3

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: 7354120e9ae2690548d13b7f1caca98d7d9565b3326c1dca67ec417c82c0be12
4
- data.tar.gz: cb762ce2575300b20c80cba8c99e6dd3cc2981af14101b3f8e657679b9ed5197
3
+ metadata.gz: c6a6ae1c10bcf3ddee440029416aa37c11b0d70e5f90a59e1685691f0a87f65e
4
+ data.tar.gz: 145d9445e2fcbf64a2671ede567f55aedd69c97431c29032add38fd29593ae91
5
5
  SHA512:
6
- metadata.gz: 4110df9a227f32c095f5b569a59b103794c842f935ecb5ef717daa20cc87398ff8d1480a518601728bcc69ad9d3779e5fc3cb489fdac65d14561b50dfafcca65
7
- data.tar.gz: 90a8d55735e526c12fed6cae896a9c1c03b19bd547a6c04c1039c216b34a851fbeed0846ad8603e7ebc270f774bca1c01732cf0669b2ff8174f1005cbf86fc57
6
+ metadata.gz: e0ae99d131a81b48e55c73f01c63bf17dfdf1badea3a66244d2fce2d563610e20af64d3bf1d73636e20bd4d4012ad70784f7df6db66b5f9876ea1b76427a09ea
7
+ data.tar.gz: c8d0cc4a8cc1ac8ce6b36b7f4c96150f30e37cbf7c4e43d4e41ef10d7fff85f50ee7638b2c2544a84681352a8efb89896f22ec957244845ba2ada14c86bba995
data/README.md CHANGED
@@ -38,6 +38,9 @@ If Bundler is not being used to manage dependencies, install the gem by running:
38
38
  gem install jekyll-pagefind
39
39
  ```
40
40
 
41
+ RubyGems will install the platform-specific package that matches the host OS and CPU.
42
+ If no matching platform gem is selected, the generic `ruby` gem raises a clear error telling the user to add the deploy platform to `Gemfile.lock`.
43
+
41
44
  ## Use
42
45
 
43
46
  ### Jekyll site configuration
@@ -176,12 +179,60 @@ For dark mode:
176
179
  }
177
180
  ```
178
181
 
179
- For more details, see [Using the Default UI](https://pagefind.app/docs/search-ui/).
182
+ For more details, see [Pagefind Component UI](https://pagefind.app/docs/search-ui/).
180
183
 
181
184
  ---
182
185
 
183
186
  ## Contributing
184
187
 
188
+ ## Maintainer Release Notes
189
+
190
+ This gem is published as platform-specific packages so users only download the binary for their host OS.
191
+
192
+ Build the current host variant:
193
+
194
+ ```sh
195
+ make build
196
+ ```
197
+
198
+ Run the fixture-based smoke test:
199
+
200
+ ```sh
201
+ make smoke-test
202
+ ```
203
+
204
+ Build every supported variant:
205
+
206
+ ```sh
207
+ make build-all
208
+ ```
209
+
210
+ Publish the built platform gems for a version:
211
+
212
+ ```sh
213
+ make publish
214
+ ```
215
+
216
+ GitHub Actions trusted publishing is supported.
217
+
218
+ To enable it on RubyGems.org for this repo:
219
+
220
+ 1. Open the `jekyll-pagefind` gem page.
221
+ 2. Go to `Trusted publishers`.
222
+ 3. Create a publisher with repository `phothinmg/jekyll-pagefind`, workflow filename `release.yml`, and environment `release`.
223
+
224
+ After that, pushing a tag like `v0.3.2` will run `.github/workflows/release.yml` and publish all built gems without a stored API token or manual OTP entry.
225
+
226
+ `bin/build-platform-gems` currently maps these asset folders to RubyGems platforms:
227
+
228
+ - `ruby` -> `ruby` (generic fallback gem with no bundled binary)
229
+ - `assets/linux-x64` -> `x86_64-linux-gnu`, `x86_64-linux-musl`
230
+ - `assets/linux-arm64` -> `aarch64-linux-gnu`, `aarch64-linux-musl`
231
+ - `assets/macos-x64` -> `x86_64-darwin`
232
+ - `assets/macos-arm64` -> `arm64-darwin`
233
+ - `assets/windows-x64` -> `x64-mingw32`, `x64-mingw-ucrt`
234
+ - `assets/windows-arm64` -> `arm64-mingw32`, `arm64-mingw-ucrt`
235
+
185
236
  Bug reports and pull requests are welcome on GitHub at <https://github.com/phothinmg/jekyll-pagefind>. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/phothinmg/jekyll-pagefind/blob/master/CODE_OF_CONDUCT.md).
186
237
 
187
238
  ## License
@@ -1,10 +1,30 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "rbconfig"
3
4
  require_relative "lib/version"
4
5
 
6
+ host_os = RbConfig::CONFIG["host_os"]
7
+ host_cpu = RbConfig::CONFIG["host_cpu"]
8
+
9
+ default_pagefind_asset_directory = case host_os
10
+ when /darwin|mac os/i
11
+ host_cpu =~ /arm64|aarch64/i ? "assets/macos-arm64" : "assets/macos-x64"
12
+ when /linux/i
13
+ host_cpu =~ /arm64|aarch64/i ? "assets/linux-arm64" : "assets/linux-x64"
14
+ when /mswin|msys|mingw|cygwin|bccwin/i
15
+ host_cpu =~ /arm64|aarch64/i ? "assets/windows-arm64" : "assets/windows-x64"
16
+ else
17
+ raise "Unable to determine a default Pagefind asset directory for host environment: #{host_os} (#{host_cpu})" # rubocop:disable Layout/LineLength
18
+ end
19
+
20
+ pagefind_asset_directory = ENV.fetch("PAGEFIND_ASSET_DIR", default_pagefind_asset_directory)
21
+ pagefind_gem_platform = ENV.fetch("PAGEFIND_GEM_PLATFORM", Gem::Platform::RUBY)
22
+ pagefind_include_assets = ENV.fetch("PAGEFIND_INCLUDE_ASSETS", "true") == "true"
23
+
5
24
  Gem::Specification.new do |spec|
6
25
  spec.name = "jekyll-pagefind"
7
26
  spec.version = Jekyll::Pagefind::VERSION
27
+ spec.platform = Gem::Platform.new(pagefind_gem_platform)
8
28
  spec.authors = ["phothinmg"]
9
29
  spec.email = ["phothinmg@disroot.org"]
10
30
 
@@ -13,12 +33,15 @@ Gem::Specification.new do |spec|
13
33
  spec.homepage = "https://rubygems.org/gems/jekyll-pagefind"
14
34
  spec.license = "MIT"
15
35
  spec.required_ruby_version = ">= 3.1.0"
36
+ spec.metadata["rubygems_mfa_required"] = "true"
16
37
  spec.metadata["homepage_uri"] = spec.homepage
17
38
  spec.metadata["source_code_uri"] = "https://github.com/phothinmg/jekykll-pagefind"
18
39
  spec.metadata["changelog_uri"] = "https://github.com/phothinmg/jekykll-pagefind/blob/main/CHANGELOG.md"
19
40
 
20
41
  spec.files = Dir.chdir(__dir__) do
21
- Dir["README.md", "LICENSE.txt", "lib/**/*", "assets/**/*", "jekyll-pagefind.gemspec"]
42
+ files = ["README.md", "LICENSE.txt", "lib/**/*", "jekyll-pagefind.gemspec"]
43
+ files << "#{pagefind_asset_directory}/**/*" if pagefind_include_assets
44
+ Dir[*files]
22
45
  end
23
46
  spec.require_paths = ["lib"]
24
47
  spec.add_dependency "jekyll", "~> 4.4"
@@ -3,6 +3,7 @@
3
3
  require "rbconfig"
4
4
  require "open3"
5
5
  require "jekyll"
6
+ require "shellwords"
6
7
 
7
8
  require_relative "version"
8
9
 
@@ -46,7 +47,7 @@ module Jekyll
46
47
  end
47
48
 
48
49
  # valid the cli flag
49
- def self.valid_args(arg)
50
+ def self.valid_arg?(arg)
50
51
  %w[output_subdir exclude_selectors keep_index_url quiet].include?(arg)
51
52
  end
52
53
 
@@ -56,7 +57,7 @@ module Jekyll
56
57
  args = []
57
58
 
58
59
  plugin_config.each do |key, value|
59
- next unless valid_args(key)
60
+ next unless valid_arg?(key)
60
61
 
61
62
  # Transform snake_case keys to kebab-case (e.g., keep_index_url -> keep-index-url)
62
63
  flag_name = key.to_s.gsub("_", "-")
@@ -79,7 +80,7 @@ module Jekyll
79
80
  args.join(" ")
80
81
  end
81
82
 
82
- def self.run_pagefind(site_destination, extra_arguments = "") # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
83
+ def self.run_pagefind(site_destination, extra_arguments = "") # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
83
84
  binary = pagefind_binary_path
84
85
 
85
86
  # Force execution bits on UNIX hosts because gem unpacking can reset permissions flags
@@ -89,14 +90,20 @@ module Jekyll
89
90
  end
90
91
 
91
92
  # Combine the mandatory --site parameter with any user-defined configuration flags
92
- full_command = "#{binary} --site \"#{site_destination}\" #{extra_arguments}".strip
93
+ full_command = [
94
+ Shellwords.escape(binary),
95
+ "--site",
96
+ Shellwords.escape(site_destination),
97
+ extra_arguments
98
+ ].join(" ").strip
99
+ started_at = Process.clock_gettime(Process::CLOCK_MONOTONIC)
93
100
 
94
- Jekyll.logger.info "Jekyll-Pagefind:", "Running command: #{full_command}"
95
- stdout, stderr, status = Open3.capture3(full_command)
101
+ Jekyll.logger.info "Jekyll-Pagefind:", "Running Pagefind..."
102
+ _stdout, stderr, status = Open3.capture3(full_command)
96
103
 
97
104
  if status.success?
98
- Jekyll.logger.info "Jekyll-Pagefind:", "Indexing finished successfully!"
99
- puts stdout
105
+ elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - started_at
106
+ Jekyll.logger.info "Jekyll-Pagefind:", format("Done in %.2fs", elapsed)
100
107
  else
101
108
  Jekyll.logger.error "Jekyll-Pagefind Error:", stderr
102
109
  raise "Pagefind binary exited with non-zero status code: #{status.exitstatus}"
@@ -107,8 +114,8 @@ end
107
114
 
108
115
  # Hook ensures Jekyll is entirely done writing HTML pages to disk
109
116
  Jekyll::Hooks.register :site, :post_write do |site|
110
- # 1. Parse your plugin settings out of site.config
117
+ # Parse plugin settings out of site.config
111
118
  custom_flags = Jekyll::Pagefind.build_cli_arguments(site.config)
112
- # 2. Run Pagefind with the compiled flags
119
+ # Run Pagefind with the compiled flags
113
120
  Jekyll::Pagefind.run_pagefind(site.dest, custom_flags)
114
121
  end
data/lib/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Pagefind
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-pagefind
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - phothinmg
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-06-08 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: jekyll
@@ -46,12 +47,6 @@ extra_rdoc_files: []
46
47
  files:
47
48
  - LICENSE.txt
48
49
  - README.md
49
- - assets/linux-arm64/pagefind
50
- - assets/linux-x64/pagefind
51
- - assets/macos-arm64/pagefind
52
- - assets/macos-x64/pagefind
53
- - assets/windows-arm64/pagefind.exe
54
- - assets/windows-x64/pagefind.exe
55
50
  - jekyll-pagefind.gemspec
56
51
  - lib/jekyll-pagefind.rb
57
52
  - lib/version.rb
@@ -59,9 +54,11 @@ homepage: https://rubygems.org/gems/jekyll-pagefind
59
54
  licenses:
60
55
  - MIT
61
56
  metadata:
57
+ rubygems_mfa_required: 'true'
62
58
  homepage_uri: https://rubygems.org/gems/jekyll-pagefind
63
59
  source_code_uri: https://github.com/phothinmg/jekykll-pagefind
64
60
  changelog_uri: https://github.com/phothinmg/jekykll-pagefind/blob/main/CHANGELOG.md
61
+ post_install_message:
65
62
  rdoc_options: []
66
63
  require_paths:
67
64
  - lib
@@ -76,7 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
73
  - !ruby/object:Gem::Version
77
74
  version: '0'
78
75
  requirements: []
79
- rubygems_version: 4.0.11
76
+ rubygems_version: 3.4.19
77
+ signing_key:
80
78
  specification_version: 4
81
79
  summary: Pagefind plugin for Jekyll
82
80
  test_files: []
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file