jekyll-pagefind 0.1.0 → 0.1.1
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/pagefind/version.rb +1 -1
- metadata +2 -9
- data/.vscode/settings.json +0 -3
- data/CHANGELOG.md +0 -5
- data/CODE_OF_CONDUCT.md +0 -10
- data/README.md +0 -89
- data/Rakefile +0 -15
- data/sig/jekyll/pagefind.rbs +0 -6
- data/test/pagefind_generator_test.rb +0 -48
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ad57a7ff7993ca5c0f02f17fd8eab415d7b27f6790459ee6bdc32b903e94a11
|
|
4
|
+
data.tar.gz: 9c475ef6c650ad99a124dbe4315f7aa7602516fbcfe4d712f3561e83839fd9e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: daaf14c041c9f9958695d4ddd4715ed73bb4a41b7f6bd4bd4e6d1c51c0662315cc4472c60078ad4e2b0f02f7da6ba9924b71a9d0dfa15ad04394f69ceedc1d52
|
|
7
|
+
data.tar.gz: d65894bd80b37ff3687b1a5bcc30d5f1cbbcc7f66edcf18d526f877754b6b4636ae7351d9efdb58258a5cdf7af708bb248ab26fe0c070943f5b0017a8de163e1
|
metadata
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-pagefind
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- phothinmg
|
|
8
|
-
bindir:
|
|
8
|
+
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
@@ -37,16 +37,9 @@ executables: []
|
|
|
37
37
|
extensions: []
|
|
38
38
|
extra_rdoc_files: []
|
|
39
39
|
files:
|
|
40
|
-
- ".vscode/settings.json"
|
|
41
|
-
- CHANGELOG.md
|
|
42
|
-
- CODE_OF_CONDUCT.md
|
|
43
40
|
- LICENSE.txt
|
|
44
|
-
- README.md
|
|
45
|
-
- Rakefile
|
|
46
41
|
- lib/jekyll/pagefind.rb
|
|
47
42
|
- lib/jekyll/pagefind/version.rb
|
|
48
|
-
- sig/jekyll/pagefind.rbs
|
|
49
|
-
- test/pagefind_generator_test.rb
|
|
50
43
|
homepage: https://github.com/phothinmg/jekyll-pagefind
|
|
51
44
|
licenses:
|
|
52
45
|
- MIT
|
data/.vscode/settings.json
DELETED
data/CHANGELOG.md
DELETED
data/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Code of Conduct
|
|
2
|
-
|
|
3
|
-
"jekyll-pagefind" follows [The Ruby Community Conduct Guideline](https://www.ruby-lang.org/en/conduct) in all "collaborative space", which is defined as community communications channels (such as mailing lists, submitted patches, commit comments, etc.):
|
|
4
|
-
|
|
5
|
-
* Participants will be tolerant of opposing views.
|
|
6
|
-
* Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
|
|
7
|
-
* When interpreting the words and actions of others, participants should always assume good intentions.
|
|
8
|
-
* Behaviour which can be reasonably considered harassment will not be tolerated.
|
|
9
|
-
|
|
10
|
-
If you have any concerns about behaviour within this project, please contact us at ["phothinmg@disroot.org"](mailto:"phothinmg@disroot.org").
|
data/README.md
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# jekyll-pagefind
|
|
2
|
-
|
|
3
|
-
`jekyll-pagefind` is a Jekyll plugin that runs the Pagefind CLI after your site is written. It lets you keep search indexing as part of the normal Jekyll build instead of running a separate manual step.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Add the gem to your site's Gemfile:
|
|
8
|
-
|
|
9
|
-
```ruby
|
|
10
|
-
gem "jekyll-pagefind"
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Then install dependencies:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
bundle install
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Enable the plugin in your Jekyll configuration:
|
|
20
|
-
|
|
21
|
-
```yml
|
|
22
|
-
plugins:
|
|
23
|
-
- jekyll-pagefind
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
This plugin shells out to the Pagefind CLI, so make sure `pagefind` is installed and available on your system. For example:
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
npm install -g pagefind
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Usage
|
|
33
|
-
|
|
34
|
-
With the plugin enabled, a normal Jekyll build will run Pagefind after the site output has been written:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
bundle exec jekyll build
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
By default the plugin executes:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
./pagefind --site _site
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
You can override the Pagefind executable location in `_config.yml`:
|
|
47
|
-
|
|
48
|
-
```yml
|
|
49
|
-
pagefind:
|
|
50
|
-
pf_location: /path/to/pagefind
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
That value is used to build the command:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
/path/to/pagefind --site _site
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Development
|
|
60
|
-
|
|
61
|
-
After checking out the repository, run:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
bin/setup
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
To build the gem locally:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
gem build jekyll-pagefind.gemspec
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
To install it into your local Ruby environment:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
bundle exec rake install
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Contributing
|
|
80
|
-
|
|
81
|
-
Bug reports and pull requests are welcome at https://github.com/phothinmg/jekyll-pagefind.
|
|
82
|
-
|
|
83
|
-
## License
|
|
84
|
-
|
|
85
|
-
This project is available under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
86
|
-
|
|
87
|
-
## Code of Conduct
|
|
88
|
-
|
|
89
|
-
Please review [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) before contributing.
|
data/Rakefile
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/gem_tasks"
|
|
4
|
-
require "rake/testtask"
|
|
5
|
-
require "rubocop/rake_task"
|
|
6
|
-
|
|
7
|
-
Rake::TestTask.new(:test) do |test|
|
|
8
|
-
test.libs << "lib"
|
|
9
|
-
test.libs << "test"
|
|
10
|
-
test.pattern = "test/**/*_test.rb"
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
RuboCop::RakeTask.new
|
|
14
|
-
|
|
15
|
-
task default: %i[test rubocop]
|
data/sig/jekyll/pagefind.rbs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "minitest/autorun"
|
|
4
|
-
require "jekyll"
|
|
5
|
-
require_relative "../lib/jekyll/pagefind"
|
|
6
|
-
|
|
7
|
-
module SystemCapture
|
|
8
|
-
class << self
|
|
9
|
-
attr_reader :commands
|
|
10
|
-
|
|
11
|
-
def reset!
|
|
12
|
-
@commands = []
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def system(command) # rubocop:disable Naming/PredicateMethod
|
|
17
|
-
SystemCapture.commands << command
|
|
18
|
-
true
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
Kernel.prepend(SystemCapture) unless Kernel.ancestors.include?(SystemCapture)
|
|
23
|
-
|
|
24
|
-
class PagefindGeneratorTest < Minitest::Test
|
|
25
|
-
SiteStub = Struct.new(:config, :dest)
|
|
26
|
-
|
|
27
|
-
def setup
|
|
28
|
-
SystemCapture.reset!
|
|
29
|
-
@registry = Jekyll::Hooks.instance_variable_get(:@registry)
|
|
30
|
-
@hook_priority = Jekyll::Hooks.instance_variable_get(:@hook_priority)
|
|
31
|
-
@original_post_write_hooks = @registry[:site][:post_write].dup
|
|
32
|
-
@original_hook_priority = @hook_priority.dup
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def teardown
|
|
36
|
-
@registry[:site][:post_write] = @original_post_write_hooks
|
|
37
|
-
Jekyll::Hooks.instance_variable_set(:@hook_priority, @original_hook_priority)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def test_runs_pagefind_with_configured_executable_after_site_write
|
|
41
|
-
site = SiteStub.new({ "pagefind" => { "pf_location" => "/tmp/pagefind" } }, "_site")
|
|
42
|
-
|
|
43
|
-
Jekyll::Pagefind::PagefindGenerator.new.generate(site)
|
|
44
|
-
Jekyll::Hooks.trigger(:site, :post_write, site)
|
|
45
|
-
|
|
46
|
-
assert_equal ["/tmp/pagefind --site _site"], SystemCapture.commands
|
|
47
|
-
end
|
|
48
|
-
end
|