SPB Git forge

spb/lou-ka

Public

Lou·Ka — tous les logements à louer du Québec, un seul endroit.

232commits 1branches 0releases
172.9 MBsize
maindefault branch
4 days agolast push
HTML 98.9% Python 0.6%

Ajoute les assets de partage Groupe KA (og.png, favicon.svg, apple-touch-icon) et complète le head SSR

- Nouveau favicon SVG et apple-touch-icon servis à la racine via frontend/public
- Image Open Graph 1200×630 par défaut (og.png) : meta og:image + dimensions + twitter:card/twitter:image dans index.html
- seo.py : og:image par défaut sur toutes les pages SSR, twitter:image, et retrait des meta statiques du gabarit pour éviter les doublons

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Simon-Pierre Boucher committed 1 mo ago (Aug 18, 2026) parent 0d96e0d

5 changed files +21 −4

modified frontend/index.html +7 −1
@@ -18,7 +18,13 @@
18 18 <link rel="preconnect" href="https://fonts.googleapis.com" />
19 19 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
20 20 <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap" rel="stylesheet" />
21 − <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='14' fill='%230B1330'/%3E%3Crect x='14.6' y='5.9' width='34.8' height='52.2' rx='11' fill='none' stroke='%23FF6A00' stroke-width='5' stroke-linejoin='round'/%3E%3Cpath d='M19.8 12.9 L41.3 16.1 L39 45.6 L19.8 48.8 Z' fill='%23ffffff' stroke='%23ffffff' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M22 48.2 L39.5 45.8 L45.5 55.9 L20 55.9 Z' fill='%23FF6A00'/%3E%3C/svg%3E" />
21 + <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
22 + <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
23 + <meta property="og:image" content="https://www.lou-ka.com/og.png" />
24 + <meta property="og:image:width" content="1200" />
25 + <meta property="og:image:height" content="630" />
26 + <meta name="twitter:card" content="summary_large_image" />
27 + <meta name="twitter:image" content="https://www.lou-ka.com/og.png" />
22 28 </head>
23 29 <body>
24 30 <div id="root"></div>
added frontend/public/apple-touch-icon.png +0 −0

Binary file not shown.

added frontend/public/favicon.svg +5 −0
@@ -0,0 +1,5 @@
1 +<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
2 +<rect width="64" height="64" rx="14" fill="#141814"/>
3 +<rect x="4.5" y="4.5" width="55" height="55" rx="11" fill="none" stroke="#ff6a00" stroke-opacity="0.35" stroke-width="2"/>
4 +<text x="32" y="43" text-anchor="middle" font-family="'Space Grotesk','Arial Black',sans-serif" font-size="30" font-weight="700" letter-spacing="-1" fill="#ff6a00" transform="rotate(-4 32 32)">Ka</text>
5 +</svg>
\ No newline at end of file
added frontend/public/og.png +0 −0

Binary file not shown.

modified louka/seo.py +9 −3
@@ -99,6 +99,8 @@ def _render(*, title: str, description: str, path: str, jsonld: list[dict] | Non
99 99 page = re.sub(r'<meta name="description"[^>]*/>',
100 100 f'<meta name="description" content="{html.escape(description, quote=True)}" />',
101 101 page, count=1)
102 + # retire du gabarit statique les meta og:image/twitter (re-injectées ci-dessous)
103 + page = re.sub(r'\s*<meta (?:property="og:image[^"]*"|name="twitter:(?:card|image)")[^>]*/>', "", page)
102 104 extras = [
103 105 f'<link rel="canonical" href="{canonical}" />',
104 106 f'<link rel="alternate" hreflang="fr-ca" href="{canonical}" />',
@@ -109,11 +111,15 @@ def _render(*, title: str, description: str, path: str, jsonld: list[dict] | Non
109 111 f'<meta property="og:title" content="{html.escape(title, quote=True)}" />',
110 112 f'<meta property="og:description" content="{html.escape(description, quote=True)}" />',
111 113 f'<meta property="og:url" content="{canonical}" />',
112 − f'<meta name="twitter:card" content="{"summary_large_image" if og_image else "summary"}" />',
114 + '<meta name="twitter:card" content="summary_large_image" />',
113 115 f'<meta name="twitter:title" content="{html.escape(title, quote=True)}" />',
114 116 ]
115 − if og_image:
116 − extras.append(f'<meta property="og:image" content="{html.escape(og_image, quote=True)}" />')
117 + img = og_image or (BASE_URL + "/og.png")
118 + extras.append(f'<meta property="og:image" content="{html.escape(img, quote=True)}" />')
119 + if not og_image:
120 + extras.append('<meta property="og:image:width" content="1200" />')
121 + extras.append('<meta property="og:image:height" content="630" />')
122 + extras.append(f'<meta name="twitter:image" content="{html.escape(img, quote=True)}" />')
117 123 for obj in (jsonld or []):
118 124 blob = json.dumps(obj, ensure_ascii=False).replace("</", "<\\/")
119 125 extras.append(f'<script type="application/ld+json">{blob}</script>')
120 126