feat(seo): separate display headings and improve social metadata

This commit is contained in:
DeCentN2Madness committed 2026-10-08 14:50:54 -07:00
1 parent c720917627
commit 4ed01d7d28
17 files changed
+707 -12

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
/** Resolve social assets against the public site, never a preview host or canonical. */
export function socialImageUrl(image: string | undefined, site: string): string | undefined {
if (!image?.trim()) return undefined;
const url = new URL(image, new URL('/', site));
if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password) {
throw new Error(`Invalid social image URL: ${image}`);
}
return url.href;
}