Class: Stratus::Resources::Layout

Inherits:
Template show all
Defined in:
lib/stratus/resources/layout.rb

Instance Attribute Summary

Attributes inherited from Base

#collection_type, #content_path, #content_type, #index, #slug, #source_path

Instance Method Summary collapse

Methods inherited from Template

#full_path

Methods inherited from Base

#<=>, #[], #[]=, #attachments, #attachments_hash, #fixup_meta, #full_path, #is_homepage, #metadata, #method_missing, #next_content, #output_path, #prev_content, #to_liquid

Constructor Details

#initialize(fullpath, content_path = '') ⇒ Layout



5
6
7
8
# File 'lib/stratus/resources/layout.rb', line 5

def initialize(fullpath, content_path='')
  super(fullpath, content_path)
  @content_type = :layout
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Stratus::Resources::Base

Instance Method Details

#validate!Object



10
11
12
13
14
# File 'lib/stratus/resources/layout.rb', line 10

def validate!
  [:layout] = nil unless .has_key? :layout
  #raise StandardError.new("Posts must have a published-on date! #{content_path}") unless metadata.has_key?(:publish_on)
  true
end