From a6e49098c8fcee78958c18bb3fa9daf4bed37ff2 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 20 Dec 2014 22:15:27 +0100 Subject: [PATCH] Add robots.txt --- couchpotato/__init__.py | 9 +++++++++ couchpotato/templates/login.html | 1 + 2 files changed, 10 insertions(+) diff --git a/couchpotato/__init__.py b/couchpotato/__init__.py index daa93bc..9df1612 100644 --- a/couchpotato/__init__.py +++ b/couchpotato/__init__.py @@ -40,6 +40,8 @@ class WebHandler(BaseHandler): return try: + if route == 'robots.txt': + self.set_header('Content-Type', 'text/plain') self.write(views[route]()) except: log.error("Failed doing web request '%s': %s", (route, traceback.format_exc())) @@ -60,6 +62,13 @@ def index(): addView('', index) +# Web view +def robots(): + return 'User-agent: * \n' \ + 'Disallow: /' +addView('robots.txt', robots) + + # API docs def apiDocs(): routes = list(api.keys()) diff --git a/couchpotato/templates/login.html b/couchpotato/templates/login.html index e33db2d..c30ab6b 100644 --- a/couchpotato/templates/login.html +++ b/couchpotato/templates/login.html @@ -6,6 +6,7 @@ + {% for url in fireEvent('clientscript.get_styles', as_html = True, location = 'front', single = True) %} {% end %}