feat : big update
CI / Verify (push) Successful in 51s
CI / Build immutable images and deploy (push) Successful in 1m36s

This commit is contained in:
2026-08-30 10:52:37 +00:00 Unverified
parent 0a643dd60e
commit 273baa55d8
22 changed files with 4025 additions and 87 deletions
+2 -14
View File
@@ -3,6 +3,7 @@ import { ImageResponse } from "next/og";
import sharp from "sharp";
import { rarityGradient } from "@/lib/catalog/rarity";
import { imageContentDisposition } from "@/lib/guides/export-image";
import { getPublicTeamExport } from "@/lib/guides/queries";
const anuphanFonts = Promise.all(
@@ -29,19 +30,6 @@ function amount(value: number): string {
return new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format(value);
}
function contentDisposition(teamName: string): string {
const displayName = teamName.trim() || "team";
const fallback = displayName
.normalize("NFKD")
.replace(/[^a-z0-9]+/giu, "-")
.replace(/^-|-$/gu, "") || "team";
const encoded = encodeURIComponent(`${displayName}.png`).replace(
/['()*]/gu,
(character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`,
);
return `attachment; filename="${fallback}.png"; filename*=UTF-8''${encoded}`;
}
async function pngDataUrl(url: string): Promise<string | null> {
try {
const response = await fetch(url);
@@ -186,7 +174,7 @@ export async function GET(
fonts: fonts.length ? fonts : undefined,
headers: {
"Cache-Control": "no-store",
"Content-Disposition": contentDisposition(team.title),
"Content-Disposition": imageContentDisposition(team.title, "team"),
"Content-Type": "image/png",
},
},