Suppresion des liens canoniques, pas trouvé comment les insérer assez tôt
This commit is contained in:
@@ -17,7 +17,6 @@ from dash import (
|
|||||||
from src.callbacks import get_top_org_table
|
from src.callbacks import get_top_org_table
|
||||||
from src.figures import DataTable, make_column_picker, point_on_map
|
from src.figures import DataTable, make_column_picker, point_on_map
|
||||||
from src.utils import (
|
from src.utils import (
|
||||||
add_canonical_link,
|
|
||||||
columns,
|
columns,
|
||||||
df,
|
df,
|
||||||
df_acheteurs,
|
df_acheteurs,
|
||||||
@@ -476,9 +475,3 @@ def toggle_acheteur_columns(click_open, click_close, is_open):
|
|||||||
)
|
)
|
||||||
def reset_view(n_clicks):
|
def reset_view(n_clicks):
|
||||||
return "", []
|
return "", []
|
||||||
|
|
||||||
|
|
||||||
@callback(Input("acheteur_url", "pathname"))
|
|
||||||
def cb_add_canonical_link(pathname):
|
|
||||||
print("coucou 2")
|
|
||||||
add_canonical_link(pathname)
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ from dash import (
|
|||||||
from figures import make_column_picker
|
from figures import make_column_picker
|
||||||
from src.figures import DataTable
|
from src.figures import DataTable
|
||||||
from src.utils import (
|
from src.utils import (
|
||||||
add_canonical_link,
|
|
||||||
columns,
|
columns,
|
||||||
df,
|
df,
|
||||||
filter_table_data,
|
filter_table_data,
|
||||||
@@ -534,14 +533,3 @@ def toggle_tableau_columns(click_open, click_close, is_open):
|
|||||||
)
|
)
|
||||||
def reset_view(n_clicks):
|
def reset_view(n_clicks):
|
||||||
return "", []
|
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)
|
|
||||||
#
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ from dash import (
|
|||||||
from src.callbacks import get_top_org_table
|
from src.callbacks import get_top_org_table
|
||||||
from src.figures import DataTable, make_column_picker, point_on_map
|
from src.figures import DataTable, make_column_picker, point_on_map
|
||||||
from src.utils import (
|
from src.utils import (
|
||||||
add_canonical_link,
|
|
||||||
columns,
|
columns,
|
||||||
df,
|
df,
|
||||||
df_titulaires,
|
df_titulaires,
|
||||||
@@ -490,8 +489,3 @@ def toggle_titulaire_columns(click_open, click_close, is_open):
|
|||||||
)
|
)
|
||||||
def reset_view(n_clicks):
|
def reset_view(n_clicks):
|
||||||
return "", []
|
return "", []
|
||||||
|
|
||||||
|
|
||||||
@callback(Input("titulaire_url", "pathname"))
|
|
||||||
def cb_add_canonical_link(pathname):
|
|
||||||
add_canonical_link(pathname)
|
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
import uuid
|
import uuid
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from time import localtime, sleep
|
from time import localtime, sleep
|
||||||
|
|
||||||
import dash
|
|
||||||
import polars as pl
|
import polars as pl
|
||||||
import polars.selectors as cs
|
import polars.selectors as cs
|
||||||
from dash import no_update
|
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
|
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()
|
df: pl.DataFrame = get_decp_data()
|
||||||
schema = df.collect_schema()
|
schema = df.collect_schema()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user