Suppresion des liens canoniques, pas trouvé comment les insérer assez tôt

This commit is contained in:
Colin Maudry
2026-02-17 14:24:46 +01:00
parent 2b0b048520
commit adda58bada
4 changed files with 0 additions and 41 deletions
-7
View File
@@ -17,7 +17,6 @@ from dash import (
from src.callbacks import get_top_org_table
from src.figures import DataTable, make_column_picker, point_on_map
from src.utils import (
add_canonical_link,
columns,
df,
df_acheteurs,
@@ -476,9 +475,3 @@ def toggle_acheteur_columns(click_open, click_close, is_open):
)
def reset_view(n_clicks):
return "", []
@callback(Input("acheteur_url", "pathname"))
def cb_add_canonical_link(pathname):
print("coucou 2")
add_canonical_link(pathname)
-12
View File
@@ -22,7 +22,6 @@ from dash import (
from figures import make_column_picker
from src.figures import DataTable
from src.utils import (
add_canonical_link,
columns,
df,
filter_table_data,
@@ -534,14 +533,3 @@ def toggle_tableau_columns(click_open, click_close, is_open):
)
def reset_view(n_clicks):
return "", []
@callback(Input("tableau_url", "pathname"))
def cb_add_canonical_link(pathname):
add_canonical_link(pathname)
# @callback(Input("tableau_url", "pathname"), Output("btn-copy-url", "children"))
# def cb_add_canonical_link(pathname):
# add_canonical_link(pathname)
#
-6
View File
@@ -17,7 +17,6 @@ from dash import (
from src.callbacks import get_top_org_table
from src.figures import DataTable, make_column_picker, point_on_map
from src.utils import (
add_canonical_link,
columns,
df,
df_titulaires,
@@ -490,8 +489,3 @@ def toggle_titulaire_columns(click_open, click_close, is_open):
)
def reset_view(n_clicks):
return "", []
@callback(Input("titulaire_url", "pathname"))
def cb_add_canonical_link(pathname):
add_canonical_link(pathname)
-16
View File
@@ -1,12 +1,10 @@
import json
import logging
import os
import re
import uuid
from collections import OrderedDict
from time import localtime, sleep
import dash
import polars as pl
import polars.selectors as cs
from dash import no_update
@@ -741,20 +739,6 @@ def make_org_jsonld(org_id, org_type, org_name=None, type_org_id="SIRET") -> dic
return jsonld
def add_canonical_link(pathname):
@dash.hooks.index()
def update_index(html_string: str):
url = f"https://{domain_name}{pathname}"
canonical_tag = f'<link rel="canonical" href="{url}" />'
html_string = re.sub(
r'<link rel="canonical" href="https://([a-z\./0-9]+)" />',
canonical_tag,
html_string,
)
html_string = html_string.replace("<!-- canonical link -->", canonical_tag)
return html_string
df: pl.DataFrame = get_decp_data()
schema = df.collect_schema()