Repository Public
1import { readFile } from "node:fs/promises";2import { join } from "node:path";3import { ImageResponse } from "next/og";4import { HEADLINE } from "@/lib/seo";56export const alt = "ATLAS IA — Comprendre l’IA. Construire avec l’IA.";7export const size = { width: 1200, height: 630 };8export const contentType = "image/png";910const font = (file: string) => readFile(join(process.cwd(), "node_modules/@fontsource/fira-sans/files", file));1112/** Social card, generated at build time with the site’s own self-hosted font. */13export default async function OpenGraphImage() {14 const [regular, semibold] = await Promise.all([font("fira-sans-latin-400-normal.woff"), font("fira-sans-latin-600-normal.woff")]);15 const [first, second] = HEADLINE.split(". ");16 return new ImageResponse(17 (18 <div style={{ width: "100%", height: "100%", display: "flex", flexDirection: "column", justifyContent: "space-between", padding: 72, background: "#0B1426", color: "#F5F1E6", fontFamily: "Fira Sans" }}>19 <div style={{ display: "flex", alignItems: "center", gap: 22 }}>20 <svg width="76" height="76" viewBox="0 0 48 48" fill="none">21 <circle cx="24" cy="24" r="22" stroke="#5B6D93" strokeWidth="1.6" />22 <path d="M3.3 31.5A22 8.8 0 0 0 44.7 31.5" stroke="#5B6D93" strokeWidth="1.1" />23 <path d="M12.1 37.2 24 9.5l11.9 27.7" stroke="#F5F1E6" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" />24 <path d="M16.7 26.6h14.6" stroke="#4C9AFF" strokeWidth="2.6" strokeLinecap="round" />25 <circle cx="24" cy="9.5" r="3.6" fill="#2FCBAA" /><circle cx="12.1" cy="37.2" r="3.6" fill="#4C9AFF" /><circle cx="35.9" cy="37.2" r="3.6" fill="#FFB938" />26 </svg>27 <div style={{ display: "flex", fontSize: 38, fontWeight: 600, letterSpacing: 7 }}>ATLAS <span style={{ color: "#4C9AFF", marginLeft: 14 }}>IA</span></div>28 </div>29 <div style={{ display: "flex", flexDirection: "column" }}>30 <div style={{ display: "flex", fontSize: 84, fontWeight: 600, letterSpacing: -2.5, lineHeight: 1.04 }}>{first}.</div>31 <div style={{ display: "flex", fontSize: 84, fontWeight: 600, letterSpacing: -2.5, lineHeight: 1.04, color: "#6AABFF" }}>{second}</div>32 <div style={{ display: "flex", fontSize: 30, color: "#AEB9CC", marginTop: 30, lineHeight: 1.3 }}>Cours ouvert et gratuit, en français, sans compte.</div>33 </div>34 <div style={{ display: "flex", justifyContent: "space-between", fontSize: 24, color: "#AEB9CC", borderTop: "2px solid #27375A", paddingTop: 24 }}>35 <span>Simon-Pierre Boucher — Professeur, UQO</span><span>atlas.spboucher.ai</span>36 </div>37 </div>38 ),39 { ...size, fonts: [{ name: "Fira Sans", data: regular, weight: 400, style: "normal" }, { name: "Fira Sans", data: semibold, weight: 600, style: "normal" }] },40 );41}42