Files
Portfolio/src/app/core/content/placeholder-content.ts

59 lines
1.8 KiB
TypeScript

import { type AppLocale } from '../i18n/locale';
import { ROUTE_IDS, type RouteId } from '../routing/route-ids';
import { type PageCopy, type SiteContent } from './content.contracts';
const PAGE_TITLES: Record<RouteId, Record<AppLocale, string>> = {
home: { de: 'Startseite', en: 'Home' },
services: { de: 'Leistungen', en: 'Services' },
servicesSoftware: { de: 'Software', en: 'Software' },
servicesHardwareNetwork: { de: 'Hardware und Netzwerk', en: 'Hardware and network' },
servicesClusters: { de: 'Cluster', en: 'Clusters' },
servicesAi: { de: 'KI-Integration', en: 'AI integration' },
projects: { de: 'Projekte', en: 'Projects' },
stack: { de: 'Stack', en: 'Stack' },
about: { de: 'Über mich', en: 'About' },
contact: { de: 'Kontakt', en: 'Contact' },
imprint: { de: 'Impressum', en: 'Legal notice' },
privacy: { de: 'Datenschutz', en: 'Privacy' },
notFound: { de: 'Seite nicht gefunden', en: 'Page not found' },
};
function scaffoldPage(routeId: RouteId, locale: AppLocale): PageCopy {
const title = PAGE_TITLES[routeId][locale];
const description =
locale === 'de' ? 'Diese Seite wird derzeit aufgebaut.' : 'This page is being built.';
return {
routeId,
title,
description,
hero: {
headline: title,
body: [description],
},
sections: [],
ctas:
routeId === 'notFound'
? [
{
label: locale === 'de' ? 'Zur Startseite' : 'Back to home',
routeId: 'home',
},
]
: [],
};
}
function pagesFor(locale: AppLocale): SiteContent {
const pages = Object.fromEntries(
ROUTE_IDS.map((routeId) => [routeId, scaffoldPage(routeId, locale)]),
) as Record<RouteId, PageCopy>;
return { pages };
}
export const PLACEHOLDER_CONTENT: Record<AppLocale, SiteContent> = {
de: pagesFor('de'),
en: pagesFor('en'),
};