Assets Groupe KA (og.png, favicon.svg, apple-touch-icon) + correction du débordement à 768 px
- ka-assets/ → frontend/ (servi à la racine par StaticFiles) : og.png (1200×630), favicon.svg, apple-touch-icon.png. - index.html : liens icônes + og:image/og:image:width/height + twitter:card summary_large_image + twitter:image. - seo.py : OG_IMAGE_TAGS par défaut (contact, événements sans image), retombée twitter pour les événements avec image ; _render retire les balises statiques pour éviter les doublons. - header : header-inner passait en pile seulement à ≤760 px alors que la ligne exige ~882 px — flex-wrap autorisé à toute largeur (cause racine du débordement horizontal de +114 px à 768 px). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 changed files +30 −4
added
frontend/apple-touch-icon.png
+0 −0
Binary file not shown.
added
frontend/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="#d6336c" 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="#d6336c" transform="rotate(-4 32 32)">Ka</text> | |
| 5 | +</svg> | |
| \ No newline at end of file | ||
modified
frontend/index.html
+9 −2
@@ -18,6 +18,13 @@ | ||
| 18 | 18 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 19 | 19 | <title>Sorti-Ka — Un service Groupe KA</title> |
| 20 | 20 | <meta name="description" content="Agrégateur indépendant de sorties et d'événements — concerts, festivals, spectacles, expositions, famille — dans les 17 régions du Québec, avec dates, lieux et gratuité."> |
| 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.sorti-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.sorti-ka.com/og.png"> | |
| 21 | 28 | <!--SSR_HEAD--> |
| 22 | 29 | <link rel="preconnect" href="https://fonts.googleapis.com"> |
| 23 | 30 | <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
@@ -62,11 +69,11 @@ button{font-family:inherit} | ||
| 62 | 69 | @media(prefers-reduced-motion:reduce){.ticker-track{animation:none}*{transition-duration:.01ms!important}} |
| 63 | 70 | .header{position:sticky;top:0;z-index:50;background:rgba(245,243,238,.9); |
| 64 | 71 | backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1.5px solid var(--ink)} |
| 65 | −.header-inner{display:flex;align-items:center;gap:18px;height:64px} | |
| 72 | +.header-inner{display:flex;align-items:center;flex-wrap:wrap;gap:6px 18px;height:auto;min-height:64px;padding:6px 0} | |
| 66 | 73 | .header-inner .gk-badge{flex:none} |
| 67 | 74 | @media(max-width:760px){ |
| 68 | 75 | /* le header s'empile (badge Groupe KA + nav visibles) — pas de débordement */ |
| 69 | − .header-inner{flex-wrap:wrap;height:auto;min-height:56px;padding:8px 0;gap:6px 12px} | |
| 76 | + .header-inner{min-height:56px;padding:8px 0;gap:6px 12px} | |
| 70 | 77 | .nav{margin-left:0;flex-wrap:wrap} |
| 71 | 78 | } |
| 72 | 79 | .brand{font-family:var(--font-display);font-weight:700;font-size:24px;letter-spacing:-.03em; |
added
frontend/og.png
+0 −0
Binary file not shown.
modified
sortika/seo.py
+16 −2
@@ -27,6 +27,15 @@ FRONTEND_INDEX = ROOT / "frontend" / "index.html" | ||
| 27 | 27 | |
| 28 | 28 | BASE_URL = "https://www.sorti-ka.com" |
| 29 | 29 | SITE_NAME = "Sorti-Ka" |
| 30 | +OG_IMAGE = f"{BASE_URL}/og.png" | |
| 31 | +# balises image de partage par défaut (og.png 1200×630 « Sorti-Ka — par Groupe KA ») | |
| 32 | +OG_IMAGE_TAGS = ( | |
| 33 | + f'<meta property="og:image" content="{OG_IMAGE}">\n' | |
| 34 | + '<meta property="og:image:width" content="1200">\n' | |
| 35 | + '<meta property="og:image:height" content="630">\n' | |
| 36 | + '<meta name="twitter:card" content="summary_large_image">\n' | |
| 37 | + f'<meta name="twitter:image" content="{OG_IMAGE}">' | |
| 38 | +) | |
| 30 | 39 | SITEMAP_CHUNK = 10000 |
| 31 | 40 | |
| 32 | 41 | _SRC_LABELS = { |
@@ -48,6 +57,8 @@ def _render(head: str, ssr_body: str) -> HTMLResponse: | ||
| 48 | 57 | # retirer title/description/canonical par défaut (remplacés par le SSR) |
| 49 | 58 | tpl = re.sub(r"<title>.*?</title>\s*", "", tpl, count=1, flags=re.S) |
| 50 | 59 | tpl = re.sub(r'<meta name="description"[^>]*>\s*', "", tpl, count=1) |
| 60 | + tpl = re.sub(r'<meta (?:property="og:image[^"]*"|name="twitter:[^"]*")[^>]*>\s*', | |
| 61 | + "", tpl) | |
| 51 | 62 | tpl = tpl.replace("<!--SSR_HEAD-->", head, 1) |
| 52 | 63 | tpl = tpl.replace("<!--SSR_BODY-->", ssr_body, 1) |
| 53 | 64 | return HTMLResponse(tpl) |
@@ -125,7 +136,9 @@ def event_page(uid: str) -> HTMLResponse: | ||
| 125 | 136 | f'<meta property="og:type" content="event">\n' |
| 126 | 137 | f'<meta property="og:url" content="{canonical}">\n' |
| 127 | 138 | + (f'<meta property="og:image" content="{_e(ev["image"])}">\n' |
| 128 | − if ev.get("image") else "") | |
| 139 | + '<meta name="twitter:card" content="summary_large_image">\n' | |
| 140 | + f'<meta name="twitter:image" content="{_e(ev["image"])}">\n' | |
| 141 | + if ev.get("image") else OG_IMAGE_TAGS + "\n") | |
| 129 | 142 | + '<script type="application/ld+json">' |
| 130 | 143 | + json.dumps(_jsonld(ev), ensure_ascii=False) |
| 131 | 144 | + "</script>" |
@@ -159,7 +172,8 @@ def contact_page() -> HTMLResponse: | ||
| 159 | 172 | f'<meta property="og:title" content="{_e(title)}">\n' |
| 160 | 173 | f'<meta property="og:description" content="{_e(desc)}">\n' |
| 161 | 174 | f'<meta property="og:type" content="website">\n' |
| 162 | − f'<meta property="og:url" content="{canonical}">' | |
| 175 | + f'<meta property="og:url" content="{canonical}">\n' | |
| 176 | + + OG_IMAGE_TAGS | |
| 163 | 177 | ) |
| 164 | 178 | ssr = ( |
| 165 | 179 | "<article><h1>Contact — Groupe KA</h1>" |
| 166 | 180 | |