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



81
82
83
84
85
86
# File 'lib/middleman-core/core_extensions/front_matter.rb', line 81

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)


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

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