lib/mill/resources/robots.rb in mill-0.1 vs lib/mill/resources/robots.rb in mill-0.3
- old
+ new
@@ -1,20 +1,17 @@
# see http://www.robotstxt.org/robotstxt.html
-class Mill
+module Mill
class Resource
class Robots < Resource
- def self.type
- :robots
- end
-
- def load
- info = {
- 'Sitemap' => @mill.sitemap_resource.absolute_uri,
- }
+ 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
end
\ No newline at end of file