Commit 54ef7bcf authored by Andreas Valder's avatar Andreas Valder
Browse files

added sitemap.xml closes #10

parent ed820782
......@@ -399,6 +399,24 @@ def new_featured():
return redirect(request.values['ref'])
return id, 200
@app.route('/sitemap.xml', methods=['GET'])
def sitemap():
# static pages
for rule in app.url_map.iter_rules():
if 'GET' in rule.methods and len(rule.arguments)==0:
if rule.endpoint not in mod_endpoints:
for i in query('select * from courses where visible and listed'):
for j in query('select * from lectures where (course_id = ? and visible)',i['id']):
return Response(render_template('sitemap.xml', pages=pages), 200, {'Content-Type': 'application/atom+xml'} )
import feeds
import importer
import schedule
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="">
{% for page in pages %}
{% endfor %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment