Add robots.txt
This commit is contained in:
@@ -40,6 +40,8 @@ class WebHandler(BaseHandler):
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
if route == 'robots.txt':
|
||||||
|
self.set_header('Content-Type', 'text/plain')
|
||||||
self.write(views[route]())
|
self.write(views[route]())
|
||||||
except:
|
except:
|
||||||
log.error("Failed doing web request '%s': %s", (route, traceback.format_exc()))
|
log.error("Failed doing web request '%s': %s", (route, traceback.format_exc()))
|
||||||
@@ -60,6 +62,13 @@ def index():
|
|||||||
addView('', index)
|
addView('', index)
|
||||||
|
|
||||||
|
|
||||||
|
# Web view
|
||||||
|
def robots():
|
||||||
|
return 'User-agent: * \n' \
|
||||||
|
'Disallow: /'
|
||||||
|
addView('robots.txt', robots)
|
||||||
|
|
||||||
|
|
||||||
# API docs
|
# API docs
|
||||||
def apiDocs():
|
def apiDocs():
|
||||||
routes = list(api.keys())
|
routes = list(api.keys())
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="robots" content="noindex, nofollow" />
|
||||||
|
|
||||||
{% for url in fireEvent('clientscript.get_styles', as_html = True, location = 'front', single = True) %}
|
{% for url in fireEvent('clientscript.get_styles', as_html = True, location = 'front', single = True) %}
|
||||||
<link rel="stylesheet" href="{{ Env.get('web_base') }}{{ url }}" type="text/css">{% end %}
|
<link rel="stylesheet" href="{{ Env.get('web_base') }}{{ url }}" type="text/css">{% end %}
|
||||||
|
|||||||
Reference in New Issue
Block a user