Class: Jekyll::Plugins::PaginateV3::Templates::DocumentTemplate
- Inherits:
-
Document
- Object
- Document
- Jekyll::Plugins::PaginateV3::Templates::DocumentTemplate
- Defined in:
- lib/jekyll-paginate-v3/templates/document_template.rb
Overview
Generated pagination template document for collection-based template locations.
Used by Templates::Builder for generated collection-document templates.
Instance Method Summary collapse
-
#initialize(site:, collection:, pagination_config:, frontmatter:, content:, generated_metadata:) ⇒ DocumentTemplate
constructor
Creates an in-memory collection document seeded from frontmatter and content supplied by generate config.
Constructor Details
#initialize(site:, collection:, pagination_config:, frontmatter:, content:, generated_metadata:) ⇒ DocumentTemplate
Creates an in-memory collection document seeded from frontmatter and content supplied by generate config.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/jekyll-paginate-v3/templates/document_template.rb', line 18 def initialize(site:, collection:, pagination_config:, frontmatter:, content:, generated_metadata:) virtual_path = build_virtual_path(site, collection, pagination_config, frontmatter, content) = Utils.safe_hash() initialise_document(site, collection, virtual_path) merge_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'] = trigger_hooks(:post_init) end |