Ajout d'un fichier sitemap.xml
parent
5a12cb23f2
commit
b781ebe8cf
9
app.py
9
app.py
|
@ -19,6 +19,7 @@ from flask import Flask
|
|||
from flask import render_template
|
||||
from flask import url_for
|
||||
from flask import request
|
||||
from flask.helpers import make_response
|
||||
|
||||
# Fichiers locaux :
|
||||
import date_tools
|
||||
|
@ -34,6 +35,7 @@ GLOBAL_CONTEXT["SOURCE"] = "https://forge.chapril.org/Wantoo/UniSquat_Python" #
|
|||
GLOBAL_CONTEXT["CREDITSLINK"] = "https://forge.chapril.org/Wantoo" # Le lien de l'organisation
|
||||
GLOBAL_CONTEXT["CREDITSNAME"] = "Wantoo" # Le nom de l'organisation
|
||||
GLOBAL_CONTEXT["DEBUG"] = False # Fait en sorte que le logiciel soit un peu plus expressif
|
||||
GLOBAL_CONTEXT["DOMAIN"] = "https://unisquat.alwaysdata.net" # Le domaine sur lequel est host l'instance
|
||||
|
||||
# Globales
|
||||
logs = [] # Stoque les différentes requêtes faite sur la route /free_rooms/, sous la forme {"timestamp":timestamp,"depts":[]}
|
||||
|
@ -310,6 +312,13 @@ def date_select() :
|
|||
|
||||
return render_template("date-select.html", **context, **GLOBAL_CONTEXT)
|
||||
|
||||
@app.route("/sitemap.xml")
|
||||
def sitemap():
|
||||
sitemap_xml = render_template("sitemap.xml", **GLOBAL_CONTEXT)
|
||||
response= make_response(sitemap_xml)
|
||||
response.headers["Content-Type"] = "application/xml"
|
||||
return response
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
def error(e):
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>{{DOMAIN}}</loc>
|
||||
<changefreq>monthly</changefreq>
|
||||
<priority>1</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>{{DOMAIN}}/app</loc>
|
||||
<changefreq>monthly</changefreq>
|
||||
<priority>1</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>{{DOMAIN}}/stats</loc>
|
||||
<changefreq>daily</changefreq>
|
||||
<priority>0.5</priority>
|
||||
</url>
|
||||
</urlset>
|
Loading…
Reference in New Issue