Skip to content

Commit 972d67d

Browse files
committedMay 27, 2015
Handle robots.tt as suggested in #1757 (untested)
1 parent ee3e113 commit 972d67d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎nikola/plugins/command/auto/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ def serve_static(self, environ, start_response):
211211
if os.path.isdir(f_path):
212212
f_path = os.path.join(f_path, self.site.config['INDEX_FILE'])
213213

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

0 commit comments

Comments
 (0)
Please sign in to comment.