// Package-owned project configuration. import { THEME_CONFIG } from '@anglefeint/user-config'; import { getLocaleConfig, getLocaleResolutionChain, type Locale } from '../i18n/config.ts'; /** * Site identity config. Override via environment variables: * PUBLIC_SITE_URL, PUBLIC_SITE_TITLE, PUBLIC_SITE_AUTHOR, PUBLIC_SITE_DESCRIPTION, PUBLIC_SITE_TAGLINE */ const env = (import.meta as ImportMeta & { env?: Record }).env ?? {}; export const SITE_TITLE = (env.PUBLIC_SITE_TITLE as string | undefined) ?? THEME_CONFIG.site.title; export const SITE_DESCRIPTION = (env.PUBLIC_SITE_DESCRIPTION as string | undefined) ?? THEME_CONFIG.site.description; export const SITE_URL = (env.PUBLIC_SITE_URL as string | undefined) ?? (env.SITE as string | undefined) ?? THEME_CONFIG.site.url; export const SITE_AUTHOR = (env.PUBLIC_SITE_AUTHOR as string | undefined) ?? THEME_CONFIG.site.author; export const SITE_TAGLINE = (env.PUBLIC_SITE_TAGLINE as string | undefined) ?? THEME_CONFIG.site.tagline; /** Homepage heading only; site identity and metadata retain SITE_TITLE. */ export function getHomeTitle(locale: Locale): string { for (const code of getLocaleResolutionChain(locale)) { const title = getLocaleConfig(code).site.homeTitle?.trim(); if (title) return title; } return SITE_TITLE; } export function getSiteHero(locale: Locale): string | undefined { for (const code of getLocaleResolutionChain(locale)) { const hero = getLocaleConfig(code).site.hero; if (hero !== undefined) return hero; } return undefined; }