Module: Middleman::Sitemap::Extensions::ContentType

Included in:
Resource
Defined in:
lib/middleman-core/sitemap/extensions/content_type.rb

Overview

Content type is implemented as a module so it can be overridden by other sitemap extensions

Instance Method Summary collapse

Instance Method Details

#content_typeObject

The preferred MIME content type for this resource



7
8
9
10
11
12
13
14
# File 'lib/middleman-core/sitemap/extensions/content_type.rb', line 7

def content_type
  # Allow explcitly setting content type from page/proxy options
  meta_type = [:options][:content_type]
  return meta_type if meta_type

  # Look up mime type based on extension
  ::Rack::Mime.mime_type(ext, nil)
end