Class: Jekyll::Plugins::PaginateV3::Pagination::Pages::ShadowPage

Inherits:
Page
  • Object
show all
Defined in:
lib/jekyll-paginate-v3/pagination/pages/shadow_page.rb

Overview

In-memory index page that behaves like a page while exposing collection metadata for compatibility checks.

Used by Pagination::Model when emitting collection: shadow indexes.

Instance Attribute Summary collapse

Attributes inherited from Page

#pager

Instance Method Summary collapse

Constructor Details

#initialize(template_item, current_page, total_pages, index_filename, collection:) ⇒ ShadowPage

Mirrors Page generation but publishes collection metadata without becoming a true collection document.



19
20
21
22
23
24
25
# File 'lib/jekyll-paginate-v3/pagination/pages/shadow_page.rb', line 19

def initialize(template_item, current_page, total_pages, index_filename, collection:)
	super(template_item, current_page, total_pages, index_filename)
	@collection = collection
	return if @collection.nil?

	self.data['collection'] = @collection.label.to_s
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



15
16
17
# File 'lib/jekyll-paginate-v3/pagination/pages/shadow_page.rb', line 15

def collection
  @collection
end