Class: Jekyll::CollectionPages::CollectionConfig
- Inherits:
-
Object
- Object
- Jekyll::CollectionPages::CollectionConfig
- Defined in:
- lib/jekyll/collection_pages/collection_config.rb
Instance Attribute Summary collapse
-
#collection_name ⇒ Object
readonly
Returns the value of attribute collection_name.
-
#per_page ⇒ Object
readonly
Returns the value of attribute per_page.
-
#tag_base_path ⇒ Object
readonly
Returns the value of attribute tag_base_path.
-
#tag_field ⇒ Object
readonly
Returns the value of attribute tag_field.
-
#tag_layout ⇒ Object
readonly
Returns the value of attribute tag_layout.
Instance Method Summary collapse
-
#initialize(config) ⇒ CollectionConfig
constructor
A new instance of CollectionConfig.
Constructor Details
#initialize(config) ⇒ CollectionConfig
Returns a new instance of CollectionConfig.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jekyll/collection_pages/collection_config.rb', line 8 def initialize(config) unless config.is_a?(Hash) Jekyll.logger.error('CollectionPages:', "Invalid collection config entry: #{config.inspect}.") raise ArgumentError, "Invalid collection_pages config entry. #{config.inspect}." end @collection_name = config['collection'] @tag_field = config['field'] @tag_base_path = config['path'] || @collection_name @tag_layout = normalize_layout(config['layout'] || 'collection_layout') @per_page = normalize_paginate_value(config['paginate']) validate_config end |
Instance Attribute Details
#collection_name ⇒ Object (readonly)
Returns the value of attribute collection_name.
6 7 8 |
# File 'lib/jekyll/collection_pages/collection_config.rb', line 6 def collection_name @collection_name end |
#per_page ⇒ Object (readonly)
Returns the value of attribute per_page.
6 7 8 |
# File 'lib/jekyll/collection_pages/collection_config.rb', line 6 def per_page @per_page end |
#tag_base_path ⇒ Object (readonly)
Returns the value of attribute tag_base_path.
6 7 8 |
# File 'lib/jekyll/collection_pages/collection_config.rb', line 6 def tag_base_path @tag_base_path end |
#tag_field ⇒ Object (readonly)
Returns the value of attribute tag_field.
6 7 8 |
# File 'lib/jekyll/collection_pages/collection_config.rb', line 6 def tag_field @tag_field end |
#tag_layout ⇒ Object (readonly)
Returns the value of attribute tag_layout.
6 7 8 |
# File 'lib/jekyll/collection_pages/collection_config.rb', line 6 def tag_layout @tag_layout end |