jekyll-pagefind 0.2.1 → 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 +4 -4
- data/README.md +184 -35
- data/jekyll-pagefind.gemspec +26 -3
- data/lib/jekyll-pagefind.rb +64 -14
- data/lib/{jekyll/pagefind/version.rb → version.rb} +1 -1
- metadata +9 -10
- data/assets/linux-arm64/pagefind +0 -0
- data/assets/linux-x64/pagefind +0 -0
- data/assets/macos-arm64/pagefind +0 -0
- data/assets/macos-x64/pagefind +0 -0
- data/assets/windows-x64/pagefind.exe +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c6a6ae1c10bcf3ddee440029416aa37c11b0d70e5f90a59e1685691f0a87f65e
|
|
4
|
+
data.tar.gz: 145d9445e2fcbf64a2671ede567f55aedd69c97431c29032add38fd29593ae91
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0ae99d131a81b48e55c73f01c63bf17dfdf1badea3a66244d2fce2d563610e20af64d3bf1d73636e20bd4d4012ad70784f7df6db66b5f9876ea1b76427a09ea
|
|
7
|
+
data.tar.gz: c8d0cc4a8cc1ac8ce6b36b7f4c96150f30e37cbf7c4e43d4e41ef10d7fff85f50ee7638b2c2544a84681352a8efb89896f22ec957244845ba2ada14c86bba995
|
data/README.md
CHANGED
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
<!-- markdownlint-disable MD033 -->
|
|
2
2
|
<!-- markdownlint-disable MD041 -->
|
|
3
3
|
<p align="center">
|
|
4
|
-
<img src="https://
|
|
4
|
+
<img src="https://susee.phothin.dev/logo/rubygems_logo.png" width="160" height="160" alt="mmdevs" style="border-radius:50%" />
|
|
5
5
|
</p>
|
|
6
|
-
<h1 align="center">
|
|
6
|
+
<h1 align="center">jekyll-pagefind</h1>
|
|
7
7
|
|
|
8
8
|
[](https://badge.fury.io/rb/jekyll-pagefind)
|
|
9
9
|
|
|
10
10
|
## Overview
|
|
11
11
|
|
|
12
|
-
Jekyll-Pagefind is a plugin
|
|
12
|
+
Jekyll-Pagefind is a plugin that runs the Pagefind binary for a Jekyll site.
|
|
13
13
|
|
|
14
14
|
## Install
|
|
15
15
|
|
|
16
|
-
Install the gem and add to
|
|
16
|
+
Install the gem and add it to your application's Gemfile by running:
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
19
|
bundle add jekyll-pagefind
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
bundle install
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
In `Gemfile`
|
|
22
|
+
In your `Gemfile`:
|
|
27
23
|
|
|
28
24
|
```ruby
|
|
29
25
|
group :jekyll_plugins do
|
|
@@ -32,53 +28,211 @@ group :jekyll_plugins do
|
|
|
32
28
|
end
|
|
33
29
|
```
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
```sh
|
|
32
|
+
bundle install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If Bundler is not being used to manage dependencies, install the gem by running:
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
38
|
gem install jekyll-pagefind
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
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`.
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
## Use
|
|
44
45
|
|
|
45
|
-
###
|
|
46
|
+
### Jekyll site configuration
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
**`_config.yml`**
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
```yaml
|
|
51
|
+
plugins:
|
|
52
|
+
# other plugin
|
|
53
|
+
- jekyll-pagefind
|
|
54
|
+
# other config
|
|
55
|
+
# Optional Jekyll Pagefind Options
|
|
56
|
+
jekyll_pagefind:
|
|
57
|
+
output_subdir: pagefind
|
|
58
|
+
```
|
|
50
59
|
|
|
51
|
-
|
|
52
|
-
2. For deployment to GitHub Pages, the binary must be `pagefind-v{version}-x86_64-unknown-linux-musl.tar.gz`.
|
|
60
|
+
---
|
|
53
61
|
|
|
54
|
-
###
|
|
62
|
+
### Jekyll Pagefind options (optional)
|
|
55
63
|
|
|
56
|
-
|
|
64
|
+
These options map to the settings available in [Pagefind config files](https://pagefind.app/docs/config-sources/#:~:text=overriding%20configuration%20files.-,Config%20files,-Pagefind%20will%20look).
|
|
57
65
|
|
|
58
|
-
|
|
66
|
+
For more details, see [Pagefind CLI configuration options](https://pagefind.app/docs/config-options/). `jekyll_pagefind` supports the following options.
|
|
59
67
|
|
|
60
|
-
|
|
68
|
+
#### 1. output_subdir
|
|
69
|
+
|
|
70
|
+
The folder where the search bundle is written, relative to Jekyll `{{ site.dest }}`. The default is `pagefind`.
|
|
71
|
+
|
|
72
|
+
**Example:**
|
|
61
73
|
|
|
62
74
|
```yaml
|
|
63
|
-
|
|
64
|
-
# other plugin
|
|
65
|
-
- jekyll-pagefind
|
|
75
|
+
output_subdir: pf # becomes _site/pf
|
|
66
76
|
```
|
|
67
77
|
|
|
68
|
-
|
|
78
|
+
#### 2. exclude_selectors
|
|
79
|
+
|
|
80
|
+
Pass extra element selectors that Pagefind should ignore when indexing.
|
|
81
|
+
|
|
82
|
+
**Example :**
|
|
69
83
|
|
|
70
84
|
```yaml
|
|
71
|
-
|
|
85
|
+
exclude_selectors:
|
|
86
|
+
- "#my_navigation"
|
|
87
|
+
- "blockquote > span"
|
|
88
|
+
- "[id^='prefix-']"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### 3. keep_index_url
|
|
92
|
+
|
|
93
|
+
Keeps `index.html` at the end of search result paths. The default is `false`.
|
|
94
|
+
|
|
95
|
+
By default, a file at `animals/cat/index.html` will be given the URL `/animals/cat/`. Setting this option to true will result in the URL `/animals/cat/index.html`.
|
|
96
|
+
|
|
97
|
+
#### 4. quiet
|
|
98
|
+
|
|
99
|
+
Logs only errors and warnings while indexing the site.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
### Pagefind UI
|
|
104
|
+
|
|
105
|
+
#### 1. Using the Default UI
|
|
106
|
+
|
|
107
|
+
Using the Default UI is still supported, but it is no longer Pagefind's primary recommendation.
|
|
108
|
+
|
|
109
|
+
You can add the Pagefind UI to any page with the following snippet. The `/pagefind/` directory, or the directory specified by `output_subdir` in the [config](#1-output_subdir), will be created along with its files.
|
|
110
|
+
|
|
111
|
+
```liquid
|
|
112
|
+
<script src="{{ '/pagefind/pagefind-ui.js' | relative_url }}"></script>
|
|
113
|
+
<link rel="stylesheet" href="{{ '/pagefind/pagefind-ui.css' | relative_url }}" />
|
|
114
|
+
|
|
115
|
+
<div id="search"></div>
|
|
116
|
+
<script>
|
|
117
|
+
window.addEventListener('DOMContentLoaded', (event) => {
|
|
118
|
+
new PagefindUI({ element: "#search", showSubResults: true });
|
|
119
|
+
});
|
|
120
|
+
</script>
|
|
72
121
|
```
|
|
73
122
|
|
|
74
|
-
|
|
123
|
+
For dark mode:
|
|
124
|
+
|
|
125
|
+
```css
|
|
126
|
+
body.dark {
|
|
127
|
+
--pagefind-ui-primary: #eeeeee;
|
|
128
|
+
--pagefind-ui-text: #eeeeee;
|
|
129
|
+
--pagefind-ui-background: #152028;
|
|
130
|
+
--pagefind-ui-border: #152028;
|
|
131
|
+
--pagefind-ui-tag: #152028;
|
|
132
|
+
}
|
|
133
|
+
```
|
|
75
134
|
|
|
76
|
-
|
|
135
|
+
For more details, see [Using the Default UI](https://pagefind.app/docs/ui-usage/).
|
|
77
136
|
|
|
78
|
-
|
|
137
|
+
#### 2. Pagefind Component UI
|
|
138
|
+
|
|
139
|
+
Add the following snippet to `<head>`. The `/pagefind/` directory, or the directory specified by `output_subdir` in the [config](#1-output_subdir), will be created along with its files.
|
|
140
|
+
|
|
141
|
+
```liquid
|
|
142
|
+
<script src="{{ '/pagefind/pagefind-component-ui.js' | relative_url }}" type="module"></script>
|
|
143
|
+
<link rel="stylesheet" href="{{ '/pagefind/pagefind-component-ui.css' | relative_url }}" />
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
For dark mode:
|
|
147
|
+
|
|
148
|
+
```html
|
|
149
|
+
<div data-pf-theme="dark">
|
|
150
|
+
<pagefind-searchbox></pagefind-searchbox>
|
|
151
|
+
</div>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
```css
|
|
155
|
+
@media (prefers-color-scheme: dark) {
|
|
156
|
+
:root {
|
|
157
|
+
--pf-text: #e5e5e5;
|
|
158
|
+
--pf-text-secondary: #a0a0a0;
|
|
159
|
+
--pf-text-muted: #949494;
|
|
160
|
+
--pf-background: #1a1a1a;
|
|
161
|
+
--pf-border: #333;
|
|
162
|
+
--pf-border-focus: #555;
|
|
163
|
+
--pf-skeleton: #2a2a2a;
|
|
164
|
+
--pf-skeleton-shine: #333;
|
|
165
|
+
--pf-hover: #252525;
|
|
166
|
+
--pf-mark: #e5e5e5;
|
|
167
|
+
--pf-scroll-shadow: rgba(255, 255, 255, 0.1);
|
|
168
|
+
--pf-outline-focus: #58a6ff;
|
|
169
|
+
|
|
170
|
+
--pf-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
171
|
+
--pf-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
|
|
172
|
+
--pf-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
|
|
173
|
+
|
|
174
|
+
--pf-error-bg: #2a1a1a;
|
|
175
|
+
--pf-error-border: #5c2828;
|
|
176
|
+
--pf-error-text: #f87171;
|
|
177
|
+
--pf-error-text-secondary: #ef4444;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
For more details, see [Pagefind Component UI](https://pagefind.app/docs/search-ui/).
|
|
183
|
+
|
|
184
|
+
---
|
|
79
185
|
|
|
80
186
|
## Contributing
|
|
81
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
|
+
|
|
82
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).
|
|
83
237
|
|
|
84
238
|
## License
|
|
@@ -87,9 +241,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
87
241
|
|
|
88
242
|
## Code of Conduct
|
|
89
243
|
|
|
90
|
-
Everyone interacting in the Jekyll::Pagefind project's
|
|
91
|
-
|
|
92
|
-
<!-- markdownlint-disable MD053 -->
|
|
93
|
-
|
|
94
|
-
[pf_release_page]: https://github.com/Pagefind/pagefind/releases/latest
|
|
95
|
-
[pf_to_jekyll]: https://www.bfoliver.com/2025/pagefind
|
|
244
|
+
Everyone interacting in the Jekyll::Pagefind project's codebase, issue trackers, chat rooms, and mailing lists is expected to follow the [code of conduct](https://github.com/phothinmg/jekyll-pagefind/blob/master/CODE_OF_CONDUCT.md).
|
data/jekyll-pagefind.gemspec
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require "rbconfig"
|
|
4
|
+
require_relative "lib/version"
|
|
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"
|
|
4
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
|
|
|
@@ -12,13 +32,16 @@ Gem::Specification.new do |spec|
|
|
|
12
32
|
spec.description = "Run pagefind binary in jekyll site"
|
|
13
33
|
spec.homepage = "https://rubygems.org/gems/jekyll-pagefind"
|
|
14
34
|
spec.license = "MIT"
|
|
15
|
-
spec.required_ruby_version = ">= 3.
|
|
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
|
-
|
|
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"
|
data/lib/jekyll-pagefind.rb
CHANGED
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
require "rbconfig"
|
|
4
4
|
require "open3"
|
|
5
5
|
require "jekyll"
|
|
6
|
+
require "shellwords"
|
|
6
7
|
|
|
7
|
-
require_relative "
|
|
8
|
+
require_relative "version"
|
|
8
9
|
|
|
9
10
|
module Jekyll
|
|
10
11
|
# module Jekyll::Pagefind
|
|
11
12
|
module Pagefind
|
|
12
13
|
GEM_ROOT = File.expand_path("..", __dir__)
|
|
13
14
|
|
|
14
|
-
def self.pagefind_binary_path # rubocop:disable Metrics/MethodLength
|
|
15
|
+
def self.pagefind_binary_path # rubocop:disable Metrics/MethodLength,Metrics/PerceivedComplexity
|
|
15
16
|
os = RbConfig::CONFIG["host_os"]
|
|
16
17
|
cpu = RbConfig::CONFIG["host_cpu"]
|
|
17
18
|
|
|
@@ -34,13 +35,52 @@ module Jekyll
|
|
|
34
35
|
end
|
|
35
36
|
# spellchecker:disable-next-line
|
|
36
37
|
when /mswin|msys|mingw|cygwin|bccwin/i
|
|
37
|
-
|
|
38
|
+
# Differentiate between Intel/AMD and ARM Windows machines
|
|
39
|
+
if cpu =~ /arm64|aarch64/i
|
|
40
|
+
File.join(GEM_ROOT, "assets", "windows-arm64", "pagefind.exe")
|
|
41
|
+
else
|
|
42
|
+
File.join(GEM_ROOT, "assets", "windows-x64", "pagefind.exe")
|
|
43
|
+
end
|
|
38
44
|
else
|
|
39
|
-
raise "Jekyll-
|
|
45
|
+
raise "Jekyll-Pagefind Mismatch Error: Pagefind binary not provided for host environment: #{os} (#{cpu})"
|
|
40
46
|
end
|
|
41
47
|
end
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
# valid the cli flag
|
|
50
|
+
def self.valid_arg?(arg)
|
|
51
|
+
%w[output_subdir exclude_selectors keep_index_url quiet].include?(arg)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Converts Jekyll config options into matching Pagefind command line flags
|
|
55
|
+
def self.build_cli_arguments(config) # rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity
|
|
56
|
+
plugin_config = config["jekyll_pagefind"] || {}
|
|
57
|
+
args = []
|
|
58
|
+
|
|
59
|
+
plugin_config.each do |key, value|
|
|
60
|
+
next unless valid_arg?(key)
|
|
61
|
+
|
|
62
|
+
# Transform snake_case keys to kebab-case (e.g., keep_index_url -> keep-index-url)
|
|
63
|
+
flag_name = key.to_s.gsub("_", "-")
|
|
64
|
+
|
|
65
|
+
case value
|
|
66
|
+
when TrueClass
|
|
67
|
+
# Boolean flags like --keep-index-url require no attached value
|
|
68
|
+
args << "--#{flag_name}"
|
|
69
|
+
when FalseClass
|
|
70
|
+
# Ignore false booleans unless Pagefind specifically supports a negative override
|
|
71
|
+
next
|
|
72
|
+
when Array
|
|
73
|
+
# Arrays like exclude_selectors need to be repeated: --exclude-selectors ".footer" --exclude-selectors "nav"
|
|
74
|
+
value.each { |val| args << "--#{flag_name} \"#{val}\"" }
|
|
75
|
+
else
|
|
76
|
+
# Strings or numbers like --bundle-dir "search"
|
|
77
|
+
args << "--#{flag_name} \"#{value}\""
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
args.join(" ")
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def self.run_pagefind(site_destination, extra_arguments = "") # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
|
|
44
84
|
binary = pagefind_binary_path
|
|
45
85
|
|
|
46
86
|
# Force execution bits on UNIX hosts because gem unpacking can reset permissions flags
|
|
@@ -49,15 +89,23 @@ module Jekyll
|
|
|
49
89
|
File.chmod(0o755, binary)
|
|
50
90
|
end
|
|
51
91
|
|
|
52
|
-
#
|
|
53
|
-
|
|
54
|
-
|
|
92
|
+
# Combine the mandatory --site parameter with any user-defined configuration flags
|
|
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)
|
|
100
|
+
|
|
101
|
+
Jekyll.logger.info "Jekyll-Pagefind:", "Running Pagefind..."
|
|
102
|
+
_stdout, stderr, status = Open3.capture3(full_command)
|
|
55
103
|
|
|
56
104
|
if status.success?
|
|
57
|
-
|
|
58
|
-
|
|
105
|
+
elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - started_at
|
|
106
|
+
Jekyll.logger.info "Jekyll-Pagefind:", format("Done in %.2fs", elapsed)
|
|
59
107
|
else
|
|
60
|
-
Jekyll.logger.error "Jekyll-
|
|
108
|
+
Jekyll.logger.error "Jekyll-Pagefind Error:", stderr
|
|
61
109
|
raise "Pagefind binary exited with non-zero status code: #{status.exitstatus}"
|
|
62
110
|
end
|
|
63
111
|
end
|
|
@@ -66,6 +114,8 @@ end
|
|
|
66
114
|
|
|
67
115
|
# Hook ensures Jekyll is entirely done writing HTML pages to disk
|
|
68
116
|
Jekyll::Hooks.register :site, :post_write do |site|
|
|
69
|
-
#
|
|
70
|
-
Jekyll::Pagefind.
|
|
71
|
-
|
|
117
|
+
# Parse plugin settings out of site.config
|
|
118
|
+
custom_flags = Jekyll::Pagefind.build_cli_arguments(site.config)
|
|
119
|
+
# Run Pagefind with the compiled flags
|
|
120
|
+
Jekyll::Pagefind.run_pagefind(site.dest, custom_flags)
|
|
121
|
+
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.
|
|
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:
|
|
11
|
+
date: 2026-06-08 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: jekyll
|
|
@@ -46,21 +47,18 @@ 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-x64/pagefind.exe
|
|
54
50
|
- jekyll-pagefind.gemspec
|
|
55
51
|
- lib/jekyll-pagefind.rb
|
|
56
|
-
- lib/
|
|
52
|
+
- lib/version.rb
|
|
57
53
|
homepage: https://rubygems.org/gems/jekyll-pagefind
|
|
58
54
|
licenses:
|
|
59
55
|
- MIT
|
|
60
56
|
metadata:
|
|
57
|
+
rubygems_mfa_required: 'true'
|
|
61
58
|
homepage_uri: https://rubygems.org/gems/jekyll-pagefind
|
|
62
59
|
source_code_uri: https://github.com/phothinmg/jekykll-pagefind
|
|
63
60
|
changelog_uri: https://github.com/phothinmg/jekykll-pagefind/blob/main/CHANGELOG.md
|
|
61
|
+
post_install_message:
|
|
64
62
|
rdoc_options: []
|
|
65
63
|
require_paths:
|
|
66
64
|
- lib
|
|
@@ -68,14 +66,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
68
66
|
requirements:
|
|
69
67
|
- - ">="
|
|
70
68
|
- !ruby/object:Gem::Version
|
|
71
|
-
version: 3.
|
|
69
|
+
version: 3.1.0
|
|
72
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
71
|
requirements:
|
|
74
72
|
- - ">="
|
|
75
73
|
- !ruby/object:Gem::Version
|
|
76
74
|
version: '0'
|
|
77
75
|
requirements: []
|
|
78
|
-
rubygems_version: 4.
|
|
76
|
+
rubygems_version: 3.4.19
|
|
77
|
+
signing_key:
|
|
79
78
|
specification_version: 4
|
|
80
79
|
summary: Pagefind plugin for Jekyll
|
|
81
80
|
test_files: []
|
data/assets/linux-arm64/pagefind
DELETED
|
Binary file
|
data/assets/linux-x64/pagefind
DELETED
|
Binary file
|
data/assets/macos-arm64/pagefind
DELETED
|
Binary file
|
data/assets/macos-x64/pagefind
DELETED
|
Binary file
|
|
Binary file
|