Neue Gruppe "Logo und Favicon" unter Admin > Inhalte mit drei Bildfeldern: Logo (Kopfzeile), optionales Logo fuer dunkle Flaechen (Mobilmenue, Fusszeile, Admin-Leiste; faellt sonst auf das normale Logo zurueck) und Favicon. Leer bleibt alles wie bisher (gezeichnetes Waben-Zeichen bzw. Standard-Icon). - lib/brand.ts liest die Pfade und prueft sie erneut gegen das Upload-Muster, bevor sie in ein src-Attribut gelangen. - Statische app/icon.svg und app/favicon.ico ersetzt durch dynamische app/icon.tsx (512 px PNG) und app/apple-icon.tsx (180 px auf Creme); lib/brand-icon.ts rendert Upload oder Standard-Icon per sharp und liest Dateien nur ueber resolveUploadPath. Cache-Control no-cache, damit ein neues Favicon ohne Tage Verzoegerung erscheint. - /favicon.ico per Rewrite auf /icon, Manifest nutzt /icon. - Hochgeladenes Logo mit fester Hoehe und begrenzter Breite (Kopfzeile mobil 56 px, ab sm 112 px), damit breite Wortmarken nichts sprengen. Uploads bleiben auf Rasterbilder beschraenkt (kein SVG, XSS-Schutz). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
34 lines
977 B
TypeScript
34 lines
977 B
TypeScript
import type { MetadataRoute } from "next";
|
|
import { getCompanyInfo } from "@/lib/company-info";
|
|
import { getLocale } from "@/i18n/locale";
|
|
import { getDictionary } from "@/i18n/get-dictionary";
|
|
|
|
/**
|
|
* Web-App-Manifest fuer "Zum Startbildschirm hinzufuegen" auf Mobilgeraeten.
|
|
* Icon ist das im Admin austauschbare Favicon (app/icon.tsx, 512 px PNG).
|
|
* Sprachabhaengig wie der Rest der Seite.
|
|
*/
|
|
export default async function manifest(): Promise<MetadataRoute.Manifest> {
|
|
const locale = await getLocale();
|
|
const t = getDictionary(locale);
|
|
const company = await getCompanyInfo();
|
|
|
|
return {
|
|
name: `${company.name} — ${t.footer.tagline}`,
|
|
short_name: company.name,
|
|
description: t.common.siteDescription,
|
|
start_url: "/",
|
|
display: "standalone",
|
|
background_color: "#FAF8F3",
|
|
theme_color: "#24352B",
|
|
icons: [
|
|
{
|
|
src: "/icon",
|
|
sizes: "512x512",
|
|
type: "image/png",
|
|
purpose: "any",
|
|
},
|
|
],
|
|
};
|
|
}
|