Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit dc71162

Browse files
committedJul 18, 2018
fix(pagination): Disable jekyll-paginate-v2 pages when indexing
1 parent 856cade commit dc71162

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed
 

‎lib/jekyll/algolia/configurator.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,13 @@ def self.disable_other_plugins(config)
253253
# Disable archive pages from jekyll-archives
254254
config['jekyll-archives'] = nil
255255

256-
# Disable paginatio from jekyll-paginate
256+
# Disable pagination from jekyll-paginate
257257
config['paginate'] = nil
258258

259+
# Disable pagination for jekyll-paginate-v2
260+
config['pagination'] = {} unless config['pagination'].is_a?(Hash)
261+
config['pagination']['enabled'] = false
262+
259263
# Disable tags from jekyll-tagging
260264
config['tag_page_dir'] = nil
261265
config['tag_page_layout'] = nil

‎spec/jekyll/algolia/configurator_spec.rb

+14
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,20 @@
442442
it { should include('paginate' => nil) }
443443
end
444444

445+
context 'disable jekyll-paginate-v2' do
446+
context 'with no pagination key' do
447+
it { should include('pagination' => { 'enabled' => false }); }
448+
end
449+
context 'with a pagination key' do
450+
let(:config) { { 'pagination' => { 'foo' => 'bar' } } }
451+
it {
452+
should include(
453+
'pagination' => { 'foo' => 'bar', 'enabled' => false }
454+
)
455+
}
456+
end
457+
end
458+
445459
context 'disable jekyll-tagging' do
446460
it { should include('tag_page_dir' => nil) }
447461
it { should include('tag_page_layout' => nil) }

0 commit comments

Comments
 (0)
Failed to load comments.