Module: Middleman::CoreExtensions::FrontMatter::ResourceInstanceMethods

Defined in:
lib/middleman-core/core_extensions/front_matter.rb

Instance Method Summary collapse

Instance Method Details

#content_typeObject

Override Resource#content_type to take into account frontmatter



74
75
76
77
78
79
# File 'lib/middleman-core/core_extensions/front_matter.rb', line 74

def content_type
  # Allow setting content type in frontmatter too
  raw_data.fetch :content_type do
    super
  end
end

#dataHash

This page’s frontmatter

Returns:

  • (Hash)


69
70
71
# File 'lib/middleman-core/core_extensions/front_matter.rb', line 69

def data
  @enhanced_data ||= ::Middleman::Util.recursively_enhance(raw_data).freeze
end

#ignored?Boolean

Returns:

  • (Boolean)


51
52
53
54
55
56
57
# File 'lib/middleman-core/core_extensions/front_matter.rb', line 51

def ignored?
  if !proxy? && raw_data[:ignored] == true
    true
  else
    super
  end
end