feat: domain-based branding (humorunits.com / dickloads.com)

- src/lib/brand.ts: Brand config map, getBrand() reads hostname server-side
- src/routes/+layout.server.ts: new, passes brand to layout
- +layout.svelte: site name and footer driven by brand config
- humorunits.com footer: 'invented conversions for ridiculous people'
- dickloads.com footer: placeholder (pending Shannon's pick)
This commit is contained in:
Falkan
2026-03-18 19:27:49 -04:00
parent b1a5586c25
commit 6e38522a89
4 changed files with 61 additions and 21 deletions

32
src/lib/brand.ts Normal file
View File

@@ -0,0 +1,32 @@
/**
* Brand configuration keyed by hostname (www-stripped).
* Add new domains here — no other changes needed.
*/
export interface Brand {
/** Site name shown in nav and page titles. */
name: string;
/** Footer tagline. */
footer: string;
}
const BRANDS: Record<string, Brand> = {
'humorunits.com': {
name: 'Humor Units',
footer: 'Humor Units — invented conversions for ridiculous people.',
},
'dickloads.com': {
name: 'Dick Loads',
footer: 'Dick Loads — serious units for serious people.',
},
};
const DEFAULT_BRAND = BRANDS['humorunits.com'];
export function getBrand(requestUrl: string): Brand {
try {
const host = new URL(requestUrl).hostname.replace(/^www\./, '');
return BRANDS[host] ?? DEFAULT_BRAND;
} catch {
return DEFAULT_BRAND;
}
}