diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2020-08-19 23:00:34 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2020-08-19 23:00:36 -0700 |
commit | c6b33542398c933a6272586e6280f7026b63a124 (patch) | |
tree | f95b5eb848ea3eceff910cd44b172e86f0332c1b /python/fatcat_web/routes.py | |
parent | 5f282a6267182214080ca36bcec4da1755589b46 (diff) | |
download | fatcat-c6b33542398c933a6272586e6280f7026b63a124.tar.gz fatcat-c6b33542398c933a6272586e6280f7026b63a124.zip |
update robots.txt and sitemap.xml
- show minimal robots/sitemap if not in prod environment
- default to allow all in robots.txt; link to sitemap index files
- basic sitemap.xml without entity-level links
Diffstat (limited to 'python/fatcat_web/routes.py')
-rw-r--r-- | python/fatcat_web/routes.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index da2bb6cf..c66c7f0c 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -1157,7 +1157,18 @@ def page_rfc(): return render_template('rfc.html') @app.route('/robots.txt', methods=['GET']) -def robots(): +def page_robots_txt(): + if conf.FATCAT_DOMAIN == "fatcat.wiki": + robots_path = "robots.txt" + else: + robots_path = "robots.deny_all.txt" return send_from_directory(os.path.join(app.root_path, 'static'), - 'robots.txt', + robots_path, mimetype='text/plain') + +@app.route('/sitemap.xml', methods=['GET']) +def page_sitemap_xml(): + if conf.FATCAT_DOMAIN == "fatcat.wiki": + return redirect('/sitemaps/sitemap.xml') + else: + abort(404) |