# for static assets
config.add_static_view('static', 'xonstat:static')
+ # robots
+ config.add_route("robots", "robots.txt")
+ config.add_view(robots, route_name="robots")
+
# for 404s
config.add_view(notfound, context=HTTPNotFound, renderer="404.mako")
--- /dev/null
+User-agent: *
+Disallow: /players/
+Disallow: /player/
+Disallow: /games/
+Disallow: /game/
+Disallow: /servers/
+Disallow: /server/
from xonstat.views.main import top_servers_by_players, top_maps_by_times_played
from xonstat.views.admin import forbidden, login, merge
+
+from xonstat.views.static import robots
--- /dev/null
+import os
+from pyramid.response import FileResponse
+
+def robots(request):
+ here = os.path.dirname(__file__)
+ robots_txt = os.path.join(here, "../static", "robots.txt")
+ return FileResponse(robots_txt, request=request)