aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/views/wiki/robots_txt.py
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-07-10 14:53:59 +0100
committerGravatar Gareth Coles <[email protected]>2018-07-10 14:53:59 +0100
commit28b72409b43cb401f5bef03747e888e1cf27262a (patch)
tree4fa4998816fe6ff4bf80db281dc12b3d68323490 /pysite/views/wiki/robots_txt.py
parentMerge branch 'fix-numbers-in-channel-names' into 'master' (diff)
All domains: sitemap.xml and robots.txt
Diffstat (limited to 'pysite/views/wiki/robots_txt.py')
-rw-r--r--pysite/views/wiki/robots_txt.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pysite/views/wiki/robots_txt.py b/pysite/views/wiki/robots_txt.py
new file mode 100644
index 00000000..308fe2a2
--- /dev/null
+++ b/pysite/views/wiki/robots_txt.py
@@ -0,0 +1,15 @@
+from flask import Response, url_for
+
+from pysite.base_route import RouteView
+
+
+class RobotsTXT(RouteView):
+ path = "/robots.txt"
+ name = "robots_txt"
+
+ def get(self):
+ return Response(
+ self.render(
+ "robots.txt", sitemap_url=url_for("api.sitemap_xml", _external=True)
+ ), content_type="text/plain"
+ )