| 574 | |
| 575 | @app.route("/sitemap_<language>.xml") |
| 576 | def sitemap(language): |
| 577 | try: |
| 578 | titles = tutorial_data[get_host()][language].keys() |
| 579 | except KeyError: |
| 580 | return error404() |
| 581 | |
| 582 | # use today as lastmod to make sure the most recent version is always indexed |
| 583 | lastmod = datetime.datetime.utcnow().date() |
| 584 | response = make_response(render_template("sitemap.xml", titles=titles, lastmod=lastmod, language=language)) |
| 585 | response.headers['Content-Type'] = 'application/xml' |
| 586 | return response |
| 587 | |
| 588 | |
| 589 | @app.route("/robots.txt") |