Module: Middleman::CoreExtensions::FrontMatter::ResourceInstanceMethods
- Defined in:
- lib/middleman-core/core_extensions/front_matter.rb
Instance Method Summary collapse
-
#content_type ⇒ Object
Override Resource#content_type to take into account frontmatter.
-
#data ⇒ Hash
This page’s frontmatter.
- #ignored? ⇒ Boolean
-
#raw_data ⇒ Hash
This page’s frontmatter without being enhanced for access by either symbols or strings.
Instance Method Details
#content_type ⇒ Object
Override Resource#content_type to take into account frontmatter
76 77 78 79 80 81 |
# File 'lib/middleman-core/core_extensions/front_matter.rb', line 76 def content_type # Allow setting content type in frontmatter too raw_data.fetch :content_type do super end end |
#data ⇒ Hash
This page’s frontmatter
71 72 73 |
# File 'lib/middleman-core/core_extensions/front_matter.rb', line 71 def data @enhanced_data ||= ::Middleman::Util.recursively_enhance(raw_data).freeze end |
#ignored? ⇒ Boolean
53 54 55 56 57 58 59 |
# File 'lib/middleman-core/core_extensions/front_matter.rb', line 53 def ignored? if !proxy? && raw_data[:ignored] == true true else super end end |
#raw_data ⇒ Hash
This page’s frontmatter without being enhanced for access by either symbols or strings. Used internally
65 66 67 |
# File 'lib/middleman-core/core_extensions/front_matter.rb', line 65 def raw_data app.extensions[:frontmatter].data(source_file).first end |