Class: Mill::Resource::Robots

Inherits:
Mill::Resource show all
Defined in:
lib/mill/resources/robots.rb

Constant Summary

Constants inherited from Mill::Resource

FileTypes

Instance Attribute Summary

Attributes inherited from Mill::Resource

#content, #date, #input_file, #node, #output_file, #path, #public, #site

Instance Method Summary collapse

Methods inherited from Mill::Resource

#absolute_uri, #change_frequency, #children, #final_content, #initialize, #inspect, #load, #parent, #public?, #redirect?, #save, #siblings, #tag_uri, #text?, #uri

Constructor Details

This class inherits a constructor from Mill::Resource

Instance Method Details

#buildObject



9
10
11
12
13
14
15
16
# File 'lib/mill/resources/robots.rb', line 9

def build
  info = {}
  info['User-Agent'] = '*'
  info['Disallow'] = '/' unless @site.allow_robots
  info['Sitemap'] = @site.sitemap_resource.absolute_uri if @site.make_sitemap
  @content = info.map { |key, value| "#{key}: #{value}" }.join("\n")
  super
end