vercors.me : version publique (forum annoncé, sans faux liens), robots.txt, sitemap
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cette révision appartient à :
1 Parent
8e22a0185b
révision
c955635e4e
3 fichiers modifiés
+35
-1
Aucun fichier ne correspond à votre recherche
@@ -21,7 +21,19 @@ def main():
|
||||
src = os.path.join(ICI, "a-propos-build.html" if nom == "a-propos.html" else nom)
|
||||
if os.path.exists(src):
|
||||
shutil.copy(src, os.path.join(DEST, nom))
|
||||
for dossier in ("polices", "tuiles", "forum"):
|
||||
# forum non ouvert : pas de lien vers des pages qui n'existent pas encore en ligne
|
||||
ip = os.path.join(DEST, "index.html")
|
||||
t = open(ip, encoding="utf-8").read()
|
||||
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)
|
||||
open(os.path.join(DEST, "robots.txt"), "w", encoding="utf-8").write("User-agent: *
|
||||
Allow: /
|
||||
Sitemap: https://vercors.me/sitemap.xml
|
||||
")
|
||||
urls = "".join("<url><loc>https://vercors.me/%s</loc></url>" % u for u in ("", "a-propos", "cgu", "confidentialite"))
|
||||
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>
|
||||
' % urls)
|
||||
for dossier in ("polices", "tuiles"):
|
||||
src = os.path.join(ICI, dossier)
|
||||
if os.path.isdir(src):
|
||||
shutil.copytree(src, os.path.join(DEST, dossier), ignore=shutil.ignore_patterns("*.css"))
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur