Correction des balises meta #39
This commit is contained in:
+1
-38
@@ -1,5 +1,4 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
|
||||||
|
|
||||||
import dash_bootstrap_components as dbc
|
import dash_bootstrap_components as dbc
|
||||||
from dash import Dash, dcc, html, page_container, page_registry
|
from dash import Dash, dcc, html, page_container, page_registry
|
||||||
@@ -8,47 +7,11 @@ from flask import send_from_directory
|
|||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
domain_name = (
|
|
||||||
"test.decp.info" if os.getenv("DEVELOPMENT").lower() == "true" else "decp.info"
|
|
||||||
)
|
|
||||||
image_url = f"https://{domain_name}/assets/decp.info.png"
|
|
||||||
title = "decp.info - exploration des marchés publics français"
|
|
||||||
description = (
|
|
||||||
"Explorez et analysez les données des marchés publics français avec cet outil libre et gratuit. "
|
|
||||||
"Pour une commande publique accessible à toutes et tous."
|
|
||||||
)
|
|
||||||
|
|
||||||
app = Dash(
|
app = Dash(
|
||||||
external_stylesheets=[dbc.themes.SIMPLEX],
|
external_stylesheets=[dbc.themes.SIMPLEX],
|
||||||
title="decp.info",
|
title="decp.info",
|
||||||
use_pages=True,
|
use_pages=True,
|
||||||
compress=True,
|
compress=True,
|
||||||
meta_tags=[
|
|
||||||
{
|
|
||||||
"property": "og:image",
|
|
||||||
"content": image_url,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "twitter:image",
|
|
||||||
"content": image_url,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"property": "og:title",
|
|
||||||
"content": title,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "twitter:title",
|
|
||||||
"content": title,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"property": "og:description",
|
|
||||||
"content": description,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "twitter:description",
|
|
||||||
"content": description,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
# COSMO (belle font, blue),
|
# COSMO (belle font, blue),
|
||||||
# UNITED (rouge, ubuntu font),
|
# UNITED (rouge, ubuntu font),
|
||||||
@@ -71,7 +34,7 @@ logging.basicConfig(
|
|||||||
|
|
||||||
app.index_string = """
|
app.index_string = """
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="fr">
|
||||||
<head>
|
<head>
|
||||||
{%metas%}
|
{%metas%}
|
||||||
<title>{%title%}</title>
|
<title>{%title%}</title>
|
||||||
|
|||||||
+10
-3
@@ -3,18 +3,25 @@ import os
|
|||||||
from dash import dcc, html, register_page
|
from dash import dcc, html, register_page
|
||||||
|
|
||||||
from src.figures import get_sources_tables
|
from src.figures import get_sources_tables
|
||||||
|
from src.utils import meta_content
|
||||||
|
|
||||||
title = "À propos"
|
name = "À propos"
|
||||||
|
|
||||||
register_page(
|
register_page(
|
||||||
__name__, path="/a-propos", title=f"decp.info - {title}", name=title, order=5
|
__name__,
|
||||||
|
path="/a-propos",
|
||||||
|
title=meta_content["title"],
|
||||||
|
name=name,
|
||||||
|
description=meta_content["description"],
|
||||||
|
image_url=meta_content["image_url"],
|
||||||
|
order=5,
|
||||||
)
|
)
|
||||||
|
|
||||||
layout = [
|
layout = [
|
||||||
html.Div(
|
html.Div(
|
||||||
className="container",
|
className="container",
|
||||||
children=[
|
children=[
|
||||||
html.H2(title),
|
html.H2(name),
|
||||||
dcc.Markdown(
|
dcc.Markdown(
|
||||||
"""Outil d'exploration libre et gratuit des données de marchés publics, développé par Colin Maudry.
|
"""Outil d'exploration libre et gratuit des données de marchés publics, développé par Colin Maudry.
|
||||||
|
|
||||||
|
|||||||
@@ -10,13 +10,16 @@ from src.utils import (
|
|||||||
get_annuaire_data,
|
get_annuaire_data,
|
||||||
get_departement_region,
|
get_departement_region,
|
||||||
lf,
|
lf,
|
||||||
|
meta_content,
|
||||||
)
|
)
|
||||||
|
|
||||||
register_page(
|
register_page(
|
||||||
__name__,
|
__name__,
|
||||||
path_template="/acheteurs/<acheteur_id>",
|
path_template="/acheteurs/<acheteur_id>",
|
||||||
title="decp.info - acheteur",
|
title=meta_content["title"],
|
||||||
name="Acheteur",
|
name="Acheteur",
|
||||||
|
description=meta_content["description"],
|
||||||
|
image_url=meta_content["image_url"],
|
||||||
order=5,
|
order=5,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+11
-3
@@ -10,6 +10,7 @@ from src.utils import (
|
|||||||
filter_table_data,
|
filter_table_data,
|
||||||
format_number,
|
format_number,
|
||||||
lf,
|
lf,
|
||||||
|
meta_content,
|
||||||
sort_table_data,
|
sort_table_data,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -18,9 +19,16 @@ update_date = datetime.fromtimestamp(update_date).strftime("%d/%m/%Y")
|
|||||||
|
|
||||||
schema = lf.collect_schema()
|
schema = lf.collect_schema()
|
||||||
|
|
||||||
|
name = "Tableau"
|
||||||
title = "Tableau"
|
register_page(
|
||||||
register_page(__name__, path="/", title="decp.info", name=title, order=1)
|
__name__,
|
||||||
|
path="/",
|
||||||
|
title=meta_content["title"],
|
||||||
|
name=name,
|
||||||
|
description=meta_content["description"],
|
||||||
|
image_url=meta_content["image_url"],
|
||||||
|
order=1,
|
||||||
|
)
|
||||||
|
|
||||||
datatable = html.Div(
|
datatable = html.Div(
|
||||||
className="marches_table",
|
className="marches_table",
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
from dash import dcc, html, register_page
|
from dash import dcc, html, register_page
|
||||||
|
|
||||||
from src.figures import get_barchart_sources, get_map_count_marches
|
from src.figures import get_barchart_sources, get_map_count_marches
|
||||||
from src.utils import lf
|
from src.utils import lf, meta_content
|
||||||
|
|
||||||
title = "Statistiques"
|
name = "Statistiques"
|
||||||
|
|
||||||
register_page(
|
register_page(
|
||||||
__name__, path="/statistiques", title=f"decp.info - {title}", name=title, order=3
|
__name__,
|
||||||
|
path="/statistiques",
|
||||||
|
title=meta_content["title"],
|
||||||
|
name=name,
|
||||||
|
description=meta_content["description"],
|
||||||
|
image_url=meta_content["image_url"],
|
||||||
|
order=3,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -14,7 +20,7 @@ layout = [
|
|||||||
html.Div(
|
html.Div(
|
||||||
className="container",
|
className="container",
|
||||||
children=[
|
children=[
|
||||||
html.H2(title),
|
html.H2(name),
|
||||||
dcc.Loading(
|
dcc.Loading(
|
||||||
overlay_style={"visibility": "visible", "filter": "blur(2px)"},
|
overlay_style={"visibility": "visible", "filter": "blur(2px)"},
|
||||||
id="loading-statistques",
|
id="loading-statistques",
|
||||||
|
|||||||
@@ -10,13 +10,16 @@ from src.utils import (
|
|||||||
get_annuaire_data,
|
get_annuaire_data,
|
||||||
get_departement_region,
|
get_departement_region,
|
||||||
lf,
|
lf,
|
||||||
|
meta_content,
|
||||||
)
|
)
|
||||||
|
|
||||||
register_page(
|
register_page(
|
||||||
__name__,
|
__name__,
|
||||||
path_template="/titulaires/<titulaire_id>",
|
path_template="/titulaires/<titulaire_id>",
|
||||||
title="decp.info - titulaire",
|
title=meta_content["title"],
|
||||||
name="Fournisseur",
|
name="Titulaire",
|
||||||
|
description=meta_content["description"],
|
||||||
|
image_url=meta_content["image_url"],
|
||||||
order=5,
|
order=5,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -245,7 +248,7 @@ def get_last_marches_table(data) -> html.Div:
|
|||||||
"whiteSpace": "normal",
|
"whiteSpace": "normal",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"if": {"column_id": "acheteur_nom"},
|
"if": {"column_id": " acheteur_nom"},
|
||||||
"minWidth": "200px",
|
"minWidth": "200px",
|
||||||
"textAlign": "left",
|
"textAlign": "left",
|
||||||
"overflow": "hidden",
|
"overflow": "hidden",
|
||||||
|
|||||||
@@ -227,3 +227,14 @@ def sort_table_data(lff: pl.LazyFrame, sort_by: list) -> pl.LazyFrame:
|
|||||||
|
|
||||||
lf = get_decp_data()
|
lf = get_decp_data()
|
||||||
departements = get_departements()
|
departements = get_departements()
|
||||||
|
domain_name = (
|
||||||
|
"test.decp.info" if os.getenv("DEVELOPMENT").lower() == "true" else "decp.info"
|
||||||
|
)
|
||||||
|
meta_content = {
|
||||||
|
"image_url": f"https://{domain_name}/assets/decp.info.png",
|
||||||
|
"title": "decp.info - exploration des marchés publics français",
|
||||||
|
"description": (
|
||||||
|
"Explorez et analysez les données des marchés publics français avec cet outil libre et gratuit. "
|
||||||
|
"Pour une commande publique accessible à toutes et tous."
|
||||||
|
),
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user