Skip to content

Commit

Permalink
Handle robots.tt as suggested in #1757 (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed May 27, 2015
1 parent ee3e113 commit 972d67d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nikola/plugins/command/auto/__init__.py
Expand Up @@ -211,7 +211,10 @@ def serve_static(self, environ, start_response):
if os.path.isdir(f_path):
f_path = os.path.join(f_path, self.site.config['INDEX_FILE'])

if os.path.isfile(f_path):
if puri.path == '/robots.txt':
start_response(b'200 OK', [(b'Content-type', 'txt/plain')])
return '''User-Agent: *\nDisallow: /\n'''
elif os.path.isfile(f_path):
with open(f_path) as fd:
start_response(b'200 OK', [(b'Content-type', mimetype)])
return self.inject_js(mimetype, fd.read())
Expand Down

0 comments on commit 972d67d

Please sign in to comment.