vercors.me : mentions légales lisibles, rubriques Performance et carte, mesure d'audience sans cookie décrite, statistiques assemblées
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cette révision appartient à :
1 Parent
574cf2e6f5
révision
4fb53a0df2
5 fichiers modifiés
+88
-8
Aucun fichier ne correspond à votre recherche
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Assemble le site publiable de vercors.me dans <projet>/site-v2/ à partir de la maquette.
|
||||
|
||||
site-v2/index.html, a-propos.html, 404.html, llms.txt, llms-full.txt, (cgu.html, confidentialite.html si présents), polices/, tuiles/, data/ (vide)
|
||||
site-v2/index.html, a-propos.html, statistiques.html, 404.html, llms.txt, llms-full.txt, (cgu.html, confidentialite.html si présents), polices/, tuiles/, data/ (vide)
|
||||
Les JSON de données (data/*.json, data/semaine/) sont produits sur cornafserver et copiés sur le serveur public à part.
|
||||
Usage : python assembler.py
|
||||
"""
|
||||
@@ -12,7 +12,7 @@ import sys
|
||||
ICI = os.path.dirname(os.path.abspath(__file__))
|
||||
DEST = os.path.join(os.path.dirname(os.path.dirname(ICI)), "site-v2")
|
||||
# CGU et confidentialité : retirées de la version publique jusqu'à la relecture juridique (textes dans maquettes/ et Documents/Meteo-Vercors/08-Juridique)
|
||||
PAGES = ("index.html", "a-propos.html")
|
||||
PAGES = ("index.html", "a-propos.html", "statistiques.html")
|
||||
|
||||
|
||||
def main():
|
||||
@@ -28,11 +28,18 @@ def main():
|
||||
t = t.replace('<li><a href="cgu.html">CGU</a></li>', '').replace('<li><a href="confidentialite.html">Confidentialité</a></li>', '')
|
||||
t = t.replace('href="forum/index.html"', 'aria-disabled="true"').replace('href="forum/connexion.html"', 'aria-disabled="true"')
|
||||
open(ip, "w", encoding="utf-8").write(t)
|
||||
# statistiques : CGU et confidentialité non publiées, on retire leurs liens de la page copiée
|
||||
sp = os.path.join(DEST, "statistiques.html")
|
||||
if os.path.exists(sp):
|
||||
t = open(sp, encoding="utf-8").read()
|
||||
t = t.replace(' Voir la <a href="confidentialite.html">politique de confidentialité</a>.', '')
|
||||
t = t.replace('<a href="cgu.html">Conditions d\'utilisation</a> · <a href="confidentialite.html">Confidentialité</a> · ', '')
|
||||
open(sp, "w", encoding="utf-8").write(t)
|
||||
for fixe in ("404.html", "llms.txt", "llms-full.txt"):
|
||||
if os.path.exists(os.path.join(ICI, fixe)):
|
||||
shutil.copy(os.path.join(ICI, fixe), os.path.join(DEST, fixe))
|
||||
open(os.path.join(DEST, "robots.txt"), "w", encoding="utf-8").write("User-agent: *\nAllow: /\nSitemap: https://vercors.me/sitemap.xml\n")
|
||||
urls = "".join("<url><loc>https://vercors.me/%s</loc></url>" % u for u in ("", "a-propos"))
|
||||
urls = "".join("<url><loc>https://vercors.me/%s</loc></url>" % u for u in ("", "a-propos", "statistiques"))
|
||||
open(os.path.join(DEST, "sitemap.xml"), "w", encoding="utf-8").write('<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">%s</urlset>\n' % urls)
|
||||
for dossier in ("polices", "tuiles"):
|
||||
src = os.path.join(ICI, dossier)
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur