From 56b7a8a0a1d2422ba5d59d6acb975b545a2435a5 Mon Sep 17 00:00:00 2001 From: Colin Maudry Date: Sat, 20 Sep 2025 08:13:45 +0200 Subject: [PATCH] robots.txt #31 --- src/app.py | 8 ++++++++ src/assets/robots.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 src/assets/robots.txt diff --git a/src/app.py b/src/app.py index 07583ab..e45d9ef 100644 --- a/src/app.py +++ b/src/app.py @@ -2,6 +2,7 @@ import logging import dash_bootstrap_components as dbc from dash import Dash, dcc, html, page_container, page_registry +from flask import send_from_directory app = Dash( external_stylesheets=[dbc.themes.SIMPLEX], @@ -14,6 +15,13 @@ app = Dash( # LUMEN (gros séparateur, blue clair), # SIMPLEX (rouge, séparateur) + +# robots.txt +@app.server.route("/robots.txt") +def robots(): + return send_from_directory("./assets", "robots.txt", mimetype="text/plain") + + logger = logging.getLogger("decp.info") logging.basicConfig( format="%(asctime)s %(levelname)-8s %(message)s", diff --git a/src/assets/robots.txt b/src/assets/robots.txt new file mode 100644 index 0000000..bbb5aa1 --- /dev/null +++ b/src/assets/robots.txt @@ -0,0 +1,43 @@ +# START YOAST BLOCK +# Copié depuis https://next.ink/robots.txt +# --------------------------- +User-agent: * + +Sitemap: https://next.ink/sitemap_index.xml +Allow: / + +# --------------------------- +# END YOAST BLOCK + +User-agent: GPTBot +Disallow: / +User-agent: ChatGPT-User +Disallow: / +User-agent: Google-Extended +Disallow: / +User-agent: PerplexityBot +Disallow: / +User-agent: Amazonbot +Disallow: / +User-agent: ClaudeBot +Disallow: / +User-Agent: FacebookBot +Disallow: / +User-Agent: Applebot +Disallow: / +User-agent: anthropic-ai +Disallow: / +User-agent: Bytespider +Disallow: / +User-agent: Claude-Web +Disallow: / +User-agent: Diffbot +Disallow: / +User-agent: ImagesiftBot +Disallow: / +User-agent: Omgilibot +Disallow: / +User-agent: Omgili +Disallow: / +User-agent: YouBot +Disallow: /