Class: Jekyll::Plugins::PaginateV3::Templates::PageTemplate

Inherits:
Jekyll::Page
  • Object
show all
Defined in:
lib/jekyll-paginate-v3/templates/page_template.rb

Overview

Generated pagination template page backed by in-memory frontmatter and content.

Used by Templates::Builder for generated page-based templates.

Instance Method Summary collapse

Constructor Details

#initialize(site:, pagination_config:, frontmatter:, content:, generated_metadata:) ⇒ PageTemplate

Creates an in-memory page that behaves like a hand-authored pagination template.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/jekyll-paginate-v3/templates/page_template.rb', line 15

def initialize(site:, pagination_config:, frontmatter:, content:, generated_metadata:)
	@site = site
	@base = site.source
	@dir = '/'
	@name = 'index.html'
	@url = '/'
	@path = build_virtual_path(site, pagination_config, frontmatter, content)

	process(@name)

	 = Utils.safe_hash()
	self.data = Utils.safe_hash(frontmatter)
	self.content = content.to_s
	self.data['pagination'] = Utils.safe_hash(pagination_config)
	self.data['pagination']['template'] = true
	self.data['paginate_v3'] = 

	apply_v2_compatibility_metadata!
	apply_permalink!

	data.default_proc = proc do |_, key|
		site.frontmatter_defaults.find(relative_path, type, key)
	end
end